lecture 4 of 170 completed

Fixture dependency graphs

Fixtures depend on fixtures, and Playwright resolves the graph for you. Designing that graph badly couples everything to everything.

What you'll learn

  • How Playwright resolves a fixture graph
  • Why lazy creation is the property worth protecting
  • Why you split fixtures rather than deepen them

Here is a failure worth understanding before you build a large fixture layer.

A team added a database-seeding dependency to their authedPage fixture. Reasonable change. Every test in the suite used authedPage, so every test now seeded the database, and the suite went from eight minutes to thirty-five. Nobody had changed a single test.

Fixtures form a dependency graph. When a fixture asks for another fixture in its parameters, that is an edge:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →