Closed Maxi-droid closed 2 years ago
I have exactly the same issue. Someone knows?
I just try to run a test, it passed, and 5 minutes later try to run the same test and it failed on the second step because it didn't reconized the same button.
More than that, I have the other problem. I have a test that clik a button, the test pass this step, and failed the next step because, on the screenshot, you can see that it didn't click and can't make the next step.
Please help!
I am having the same issue with Codeceptjs@3.0.2
with Webdriver. It clicks on Element and tries to click again and then fails.
We also have similar issues.
Sometimes the click will fail, but the failure picture captured is on the next page, indicating that the click worked fine. Was this ever resolved?
Done some more investigation on my end;
Lowering the cpu allocated to the test seems to let me get a fail every time;
cpulimit -i -l 40 -- npm run test:t
This align with the fact that tests fail a lot more in our CI environment than on our dev machines.
Actually, nvm, when updating to latest the issue seems to have been resolved for me
Cool. Let's conclude this then.
@TobiasLaving Did this error return for you? It happens for us, exactly in the same way as described by you. Any ideas how to solve this?
E: For anyone else stumbling on this. I found my solution here: https://github.com/codeceptjs/CodeceptJS/issues/3244
It happens because Playwrights default timeout is only 5 seconds long. If your web page is slow (thanks Docker on Mac :D), it does not register the new page load and retries the button click. You can change this in your config file (see link above).
What are you trying to achieve?
Clicks in tests should be recognised as executed.
What do you get instead?
Tests fail randomly when clicking a link/button that take the user to a new page with the error "could not find selector abc". When checking screenshots, I see that CodeceptJS is already on the new page so the link/button HAS been clicked. This doesn't happen all the time and cannot be reproduced locally. It seems to happen more often the "warmer" a system is and the faster the tests run so my first idea was that it happens so fast that CodeceptJS doesn't get the message that the link/button has been clicked.
What I've tried so far
Details