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:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →