This thread is trying to answer question "Does Playwright maintain the execution order of tests within a file when sharding?"
Playwright orchestrates test execution based on files, so all the tests in a file should get executed together within the same worker process. The same should apply when sharded. If you want tests within the same file to run in parallel, you need to enable that explicitly (https://playwright.dev/docs/test-parallel#parallelize-tests-in-a-single-file). If you need to force tests to run sequentially, you can also set that explicitly (https://playwright.dev/docs/test-parallel#parallelize-tests-in-a-single-file), though it's not recommended.
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].