This thread is trying to answer question "How can I ensure that the teardown function runs only after all tests are complete in Playwright?"
I've added them there: https://github.com/microsoft/playwright/issues/29068
Hi @dorfsmay , actually in your sample/repro code, I don't see where the problem is. But I did a test locally by starting from zero and for me it worked as expected.
Instead of console.log I wrote log files, just to avoid the risk that console.log might get intercepted by reporters and might output in a different order than the actual execution order.
eveltman@erics-air playwright-proj-deps % cat *.log | sort
1705691574285 starting setup
1705691575098 starting testA
1705691575099 starting testB
1705691575847 starting teardown
I've attached the combined project files used for this test.
Seems to be as per documentation: https://playwright.dev/docs/test-ui-mode#filtering-tests "If you are using project dependencies make sure to run your setup tests first before running the tests that depend on them. The UI mode will not take into consideration the setup tests and therefore you will have to manually run them first."
Edit: Hmm not exactly as you describe.
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].