I’m on module 2.4.2 of MoT’s Foundation Certificate in Test Automation (JS version), and one of the example tests is failing only when it’s run in the pipeline because of not finding the .card-title element; locally, it’s fine.
I already tried the suggested sleep 10 command and curl --head -X GET --retry 60 --retry-connrefused --retry-delay 1 http://localhost:3000 in the .yml file, as well as adding await browser.pause(2000) before the call for the element, but I’m still getting the same error. I even increased it to 15000, just to be sure.
Havent used wdio before, but is there a config to enable videos or screenshot of the test runs? If you can do that then update the github actions to make the video available.
Feel if you can’t see what the pipeline is doing will be tricky to know whats going on here.
Otherwise maybe try logging the url before the button click and after , then before the await card title and after also and see what page its on. Assuming the button click takes you to another url?
I added a URL log, which shows that the page isn’t changing after login. I added a wait for the URL to change, but even after 60 seconds, it stays the same. I tried to add screenshots, but I can’t get that working in the pipeline either, only locally. I’m kind of going round in circles…
The test did pass in the pipeline randomly twice, which shows that it can work, but upon rerunning the job against the same commit, it always failed.