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 applies Playwright best practices when writing E2E tests for a dynamic page with API interactions, empty states, and UI updates. The task does not prescribe locator patterns, assertion types, API mocking approaches, or configuration.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Web-first assertions",
"description": "All element checks use expect(locator).toBeVisible(), .toHaveText(), .toHaveCount(), .toContainText(). No page.$(), page.textContent(), or page.evaluate().",
"max_score": 14
},
{
"name": "User-visible locators",
"description": "Elements use getByRole, getByLabel, getByText, or getByTestId -- not CSS selectors.",
"max_score": 12
},
{
"name": "No explicit waits",
"description": "No page.waitForTimeout() or page.waitForSelector(). Uses web-first assertions to wait for UI updates after actions like 'Mark all as read'.",
"max_score": 12
},
{
"name": "page.route for controlled data",
"description": "Tests use page.route() to mock /api/notifications with controlled data (e.g., specific notification list, empty list for empty state test, mix of read/unread).",
"max_score": 14
},
{
"name": "Empty state test with mocked API",
"description": "A specific test mocks the notifications API to return an empty list and asserts the empty state message is visible.",
"max_score": 10
},
{
"name": "waitForResponse for mutations",
"description": "Tests that click 'Mark all as read' or individual notifications use page.waitForResponse() (set up BEFORE the action) to verify the PATCH/POST API call.",
"max_score": 10
},
{
"name": "test.describe grouping",
"description": "Tests are organized in test.describe blocks.",
"max_score": 6
},
{
"name": "test.beforeEach for setup",
"description": "Common setup (navigation, API mocking for default state) is in test.beforeEach.",
"max_score": 6
},
{
"name": "webServer configured",
"description": "playwright.config.ts includes webServer 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": 8
}
]
}