Playwright E2E testing patterns — web-first assertions, user-visible locators, network interception, fixtures, authentication, and parallel execution
98
99%
Does it follow best practices?
Impact
98%
1.81xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent proactively uses storageState for authentication reuse, fixtures, page objects, and Playwright best practices when writing E2E tests for an authenticated dashboard. The task does not prescribe authentication patterns, locator strategy, or test structure.",
"type": "weighted_checklist",
"checklist": [
{
"name": "storageState for auth reuse",
"description": "The agent uses Playwright's storageState mechanism with a setup project to authenticate once and reuse the session across tests, rather than logging in before every test or in beforeEach.",
"max_score": 16
},
{
"name": "Setup project in config",
"description": "playwright.config.ts defines a setup project (testMatch: /.*setup.*/) and dependent projects that use storageState from the setup output.",
"max_score": 12
},
{
"name": "Web-first assertions",
"description": "All element verification uses expect(locator).toBeVisible(), .toHaveText(), .toContainText(), .toHaveCount() -- not page.$(), page.textContent(), or manual boolean checks.",
"max_score": 14
},
{
"name": "User-visible locators",
"description": "Elements use getByRole, getByLabel, getByText, getByPlaceholder, or getByTestId -- not CSS selectors.",
"max_score": 12
},
{
"name": "No explicit waits",
"description": "No page.waitForTimeout() or page.waitForSelector() before locator actions.",
"max_score": 10
},
{
"name": "API mocking with page.route",
"description": "At least one test uses page.route() to mock an API response (e.g., mock /api/dashboard/stats for deterministic data or mock a failure scenario).",
"max_score": 10
},
{
"name": "test.describe grouping",
"description": "Tests are organized with test.describe blocks grouping related tests.",
"max_score": 6
},
{
"name": "webServer configured",
"description": "playwright.config.ts includes a webServer block to auto-start the dev server.",
"max_score": 8
},
{
"name": "Screenshot and trace config",
"description": "Config includes screenshot: 'only-on-failure' and trace: 'on-first-retry'.",
"max_score": 6
},
{
"name": "Page objects or fixtures for reuse",
"description": "The agent extracts reusable page interactions into page object classes or custom Playwright fixtures rather than duplicating locator logic across tests.",
"max_score": 6
}
]
}