Skip to main content

Overview

The e2e-runner agent is an expert end-to-end testing specialist. Its mission is to ensure critical user journeys work correctly by creating, maintaining, and executing comprehensive E2E tests with proper artifact management and flaky test handling.
string
default:"e2e-runner"
Agent identifier
string
default:"sonnet"
Uses Claude Sonnet for E2E test generation and maintenance
array
Available tools: Read, Write, Edit, Bash, Grep, Glob

When to Use

Testing critical user flows (auth, checkout, core features)
After implementing new user-facing features
Before production deployments
Maintaining existing E2E test suite
The e2e-runner agent activates PROACTIVELY for generating, maintaining, and running E2E tests.

Core Responsibilities

  1. Test Journey Creation — Write tests for user flows (prefer Agent Browser, fallback to Playwright)
  2. Test Maintenance — Keep tests up to date with UI changes
  3. Flaky Test Management — Identify and quarantine unstable tests
  4. Artifact Management — Capture screenshots, videos, traces
  5. CI/CD Integration — Ensure tests run reliably in pipelines
  6. Test Reporting — Generate HTML reports and JUnit XML

Primary Tool: Agent Browser

Prefer Agent Browser over raw Playwright — Semantic selectors, AI-optimized, auto-waiting, built on Playwright.

Fallback: Playwright

When Agent Browser isn’t available, use Playwright directly.

Workflow

1. Plan

  • Identify critical user journeys (auth, core features, payments, CRUD)
  • Define scenarios: happy path, edge cases, error cases
  • Prioritize by risk: HIGH (financial, auth), MEDIUM (search, nav), LOW (UI polish)

2. Create

  • Use Page Object Model (POM) pattern
  • Prefer data-testid locators over CSS/XPath
  • Add assertions at key steps
  • Capture screenshots at critical points
  • Use proper waits (never waitForTimeout)

3. Execute

  • Run locally 3-5 times to check for flakiness
  • Quarantine flaky tests with test.fixme() or test.skip()
  • Upload artifacts to CI

Example: User Authentication Flow

Page Object Model (POM)

Key Principles

Use Semantic Locators

[data-testid="..."] > CSS selectors > XPath

Wait for Conditions

waitForResponse() > waitForTimeout()

Auto-Wait Built In

page.locator().click() auto-waits; raw page.click() doesn’t

Isolate Tests

Each test should be independent; no shared state

Fail Fast

Use expect() assertions at every key step

Trace on Retry

Configure trace: 'on-first-retry' for debugging failures

Flaky Test Handling

Common causes:
  • Race conditions (use auto-wait locators)
  • Network timing (wait for response)
  • Animation timing (wait for networkidle)

Configuration Example

Artifact Management

Success Metrics

All critical journeys passing (100%)
Overall pass rate > 95%
Flaky rate < 5%
Test duration < 10 minutes
Artifacts uploaded and accessible

Usage Example

For detailed Playwright patterns, Page Object Model examples, configuration templates, CI/CD workflows, and artifact management strategies, see skill: e2e-testing.
E2E tests are your last line of defense before production. They catch integration issues that unit tests miss. Invest in stability, speed, and coverage.