Hello, guys! I am writing e2e tests for magento based websites. I have about 37 tests and 2 or 3 are usual fails. But they are not the same all the time. Most of reason System.TimeoutException : Timeout 30000ms exceeded. What is the best practice in solving these issue? WE want to add script with retry on CI for such kind of tests. Please, advice if this is on solution? Thanks in advance!
This thread is trying to answer question "What is the best practice in solving flaky tests in e2e tests for Magento based websites?"
Hi, the first thing I recommend is enabling recording and publishing of trace files for failed tests.
Failed tests in CI are much easier to troubleshoot when having trace files. In NodeJS (
@playwright/test) I set the traces to 'retain-on-failure'.
What to so if test fails in different place from time to time? And it seems that element wasn't load or so. I have added some checks to weak places, but i can't to use it everywhere😢
Yep, it might be that the test machine is too busy and some pages under test are getting so slow they hit the 30s time out.
How many workers do you use, and how many cores does your test machine have? Or are you aware of some other heavy process going on during your tests?
Also to alleviate these seemingly random failures, you could add more expectations, for intermediate states of the elements and network
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email firstname.lastname@example.org.