Fixture
A known, reusable piece of setup—data, state, or context—that establishes the preconditions a test needs before it runs.
What is Fixture?
What is Fixture?
A fixture provides the consistent starting conditions a test depends on: a logged-in user, a seeded database, a configured browser context, or a set of sample records. By centralizing setup and teardown, fixtures keep tests focused on behavior, reduce duplication, and improve reliability because every run starts from the same known state. Playwright's fixture model makes this composable and efficient. Golden fixtures—captured reference inputs and expected outputs—also underpin reliable, repeatable validation of recorded and executed flows.