Playwright Test runs tests from a single file in the order of declaration, unless you parallelize tests in a single file.
There is no guarantee about the order of test execution across the files, because Playwright Test runs test files in parallel by default. However, if you disable parallelism, you can control test order by either naming your files in alphabetical order or using a "test list" file.
Sort test files alphabetically
When you disable parallel test execution, Playwright Test runs test files in alphabetical order. You can use some naming convention to control the test order, for example 001-user-signin-flow.spec.ts
, 002-create-new-document.spec.ts
and so on.
Comments
Post a Comment