Skip to content

[Docs]: Add guidance on shared state pitfalls in parallel test execution #2059

Description

@Roseleyne

Summary

The current documentation covers --workers and fullyParallel options,
but doesn't address common shared-state pitfalls that QA teams encounter
when running tests in parallel.

Missing documentation

  • Browser context reuse across workers causing test interference
  • Fixture scope collisions (session vs test scope)
  • Global setup/teardown side effects in parallel runs
  • Race conditions with shared test data (databases, files, env vars)

Suggested addition

A dedicated section or cookbook example titled something like
"Avoiding shared state in parallel test execution" would significantly
help teams migrating from Selenium or Cypress.

Context

This gap is especially impactful for QA/SDET teams adopting Playwright
in CI environments with high parallelism (e.g., GitHub Actions matrix,
Docker sharding).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions