Koskamo

Fixtures for test environments

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

Playwright Test is based on test fixtures, which establish the environment for each test — giving the test everything it needs and nothing else — and are isolated between tests, so tests can be grouped by meaning instead of common setup. The built-in fixtures cover most needs: page provides an isolated page for the test run; context provides an isolated BrowserContext that the page belongs to; browser is a browser shared across tests to optimize resources; browserName reports the running browser, either chromium, firefox, or webkit; and request provides an isolated APIRequestContext instance. Tests receive fixtures by declaring them as arguments, as in test('basic test', async ({ page }) => ...). To create your own fixture, use test.extend() to create a new test object that includes it, such as a TodoPage page object — this replaces the manual beforeEach construction typical of traditional test styles. Scope: Playwright. Reviewed October 4, 2026.

Source and provenance

Original source
playwright.dev
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.