This video illustrates the problem in an excellent way, and not only it shows a real solution, but even more than 1 solution! I did much research and most of the sites propose to use wait(1000) but I wasn't convinced with this solution since it could still fail if 1000 ms are not enough. Thank you so much! Keep up the good work.
I prefer using cy.intercept as you demonstrated. If i find the test is flaky, it usually fails attempting to interact with some DOM element or waiting for an action to finish, in that case I'll add a timeout for that action only and usually resolve the issue. I've yet to run my tests in CI so I'm anxiously waiting to see how the tests will behave there. Quality explanation, thanks 👍
This is a good video, but I think many people (such as myself) encounter this problem with more complex SPAs. With a framework like React, and given the nature of async, elements may re-render at times that are completely disconnected from the actions the user/test runner is performing at the time.
I will wait for a reproducible example, since a) Cypress Dashboard is a complex React application with background data sync, etc that seems to be working quite well during tests b) Mercari US is a complex React application that seems to be working quite well during tests c) if everything else fails add cy.wait(xxx) plus enable test retries and move on
Q.1) Hi Gleb, I have 1 question So there is one button i.e 3 dots I am click on 3 dots(button) then It will open 4 options (edit,share,duplicate,delete) & then I am finally click on the 4th option(delete).-->this the flow So there is 3 dots button & 4th option button is there. but If I do not provide wait before 3 dots button & after 3 dots It will not click on the 4th option(delete) & by using cy.wait(); it is working but we can't use wait so my question is, Is there any method to replace the cy.wait();?
I am sorry, I don't understand, RUclips comments are really hard to read this way. Could you ask your Cypress question at on.cypress.io/chat or on.cypress.io/discord or the specific repo via GH issues? It will be easier for your to provide code snippets, screenshots, etc to explain what you are trying to do. You could also help me answer Cypress-related questions faster by supporting me via GitHub sponsors github.com/sponsors/bahmutov, by buying my Cypress courses at cypress.tips/courses, or by inviting me to teach Cypress cypress.tips/workshops
will you please tell how it works on puppeteer framework? Like i have selected an element with same classname and i want to click one by one but the problem is once it click on first link it will go to new page and Automate that page and come back again and then click on next link and automate that one also . On the second time i am getting an error like "Node is detached from document " Please help
@@gleb i mean suppose if u have 5 matching element link and u have to click one by one . So i am clicking on 1st link and it will render to that page and close that page and click on the 2nd link and so on when at the second time looping the puppeteer says that "node is detached from document".
@@gleb i am just asking if u help me with puppeteer because i faced the same issue in puppeteer. So if u know about puppeteer then please let me know it would be helpful for me. Thanks in advance
This video illustrates the problem in an excellent way, and not only it shows a real solution, but even more than 1 solution! I did much research and most of the sites propose to use wait(1000) but I wasn't convinced with this solution since it could still fail if 1000 ms are not enough. Thank you so much! Keep up the good work.
I prefer using cy.intercept as you demonstrated. If i find the test is flaky, it usually fails attempting to interact with some DOM element or waiting for an action to finish, in that case I'll add a timeout for that action only and usually resolve the issue. I've yet to run my tests in CI so I'm anxiously waiting to see how the tests will behave there.
Quality explanation, thanks 👍
Iterative assertions pattern!
Thanks for taking the time to explain it.
Thank you for your efforts, this is awesome!
This is a good video, but I think many people (such as myself) encounter this problem with more complex SPAs. With a framework like React, and given the nature of async, elements may re-render at times that are completely disconnected from the actions the user/test runner is performing at the time.
I will wait for a reproducible example, since a) Cypress Dashboard is a complex React application with background data sync, etc that seems to be working quite well during tests b) Mercari US is a complex React application that seems to be working quite well during tests c) if everything else fails add cy.wait(xxx) plus enable test retries and move on
Q.1) Hi Gleb, I have 1 question So there is one button i.e 3 dots I am click on 3 dots(button) then It will open 4 options (edit,share,duplicate,delete) & then I am finally click on the 4th option(delete).-->this the flow
So there is 3 dots button & 4th option button is there. but If I do not provide wait before 3 dots button & after 3 dots It will not click on the 4th option(delete) & by using cy.wait(); it is working but we can't use wait
so my question is, Is there any method to replace the cy.wait();?
I am sorry, I don't understand, RUclips comments are really hard to read this way. Could you ask your Cypress question at on.cypress.io/chat or on.cypress.io/discord or the specific repo via GH issues? It will be easier for your to provide code snippets, screenshots, etc to explain what you are trying to do. You could also help me answer Cypress-related questions faster by supporting me via GitHub sponsors github.com/sponsors/bahmutov, by buying my Cypress courses at cypress.tips/courses, or by inviting me to teach Cypress cypress.tips/workshops
THANKS,very usefull,
i do have many problems with cypress automation.
Great video! Thanks, Gleb
Excellent video. Thank you
Thx, i got the solution!
Nice. Thanks
will you please tell how it works on puppeteer framework?
Like i have selected an element with same classname and i want to click one by one but the problem is once it click on first link it will go to new page and Automate that page and come back again and then click on next link and automate that one also .
On the second time i am getting an error like "Node is detached from document "
Please help
I’m sorry I don’t understand your question. I’m showing Cypress and not Puppeteer
@@gleb i mean suppose if u have 5 matching element link and u have to click one by one . So i am clicking on 1st link and it will render to that page and close that page and click on the 2nd link and so on when at the second time looping the puppeteer says that "node is detached from document".
@@gleb i am just asking if u help me with puppeteer because i faced the same issue in puppeteer. So if u know about puppeteer then please let me know it would be helpful for me. Thanks in advance
@@balramshrivastav8214 can you make a public repo showing what you mean a f the test that gets an error?
@@balramshrivastav8214 unfortunately I don’t use puppeteer
Lots of angry comments :D