The app I am testing is slow and breaks often. Also the flows are quite long.
So: many tests are tagged with .slow() and take a while to complete.
Recently I realized when I am debugging a failing test, when some element (which the test has to .click()
) is missing, I have to wait for the entire timeout of the test (90s) just to see that it wasn't there 5s into the test.
Reading https://playwright.dev/docs/test-timeouts#advanced-low-level-timeouts it says "you should not need to change these", but I'm not sure if it is worth it to respect the docs if it means I have to waste my time waiting for nothing?
This thread is trying to answer question "Should I keep the default low level timeouts if my tests are slow?"
Another approach would be to dynamically increase the timeout using https://playwright.dev/docs/api/class-testinfo#test-info-set-timeout for some group of function. For example every time performing a login +5s, create new account +10s, verify email +10s...
I had the same dilemma with timeouts and asked a question here too. People suggested to add a setTimeout() for slower tests or slow(). However, what we did is we increased the global timeout (for now the value is 130000) and it looks like it's enough. The point is - our app is slow, we have many integrated components that we wait to load etc. So it's impossible to not change the defaults and just go with it. 🤷♀️ But I get your question, we too wanted to go along with the documentation and not increase anything in configs at all [I was referring in my post to industry standards if any exist at all].
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 [email protected].