I am working on an abstraction for surfacing flaky tests (https://github.com/lucgagan/playwright-havoc/). and one of the common causes of flaky tests is interdependency of tests. I would like to surface those issues by forcing the tests to run in a different than usual order (e.g. backwards). How could I achieve this programmatically?
This thread is trying to answer question "How can one programmatically change the order in which tests are executed to surface issues related to interdependency of tests?"
There is nothing stopping tests from being dependent on each other at the moment.
That's pretty much the point of browser contexts, each test gets it's own context & page, unless you purposely re-use a page object between tests: https://playwright.dev/docs/test-retries#reuse-single-page-between-tests https://playwright.dev/docs/browser-contexts
I was just debugging a case the other day where another test created an authenticated session and it was leaking to the next test That's not a flaky test though, that issue would be the same every test run.
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@example.com.