---
description: "E2E testing workflow — generate, run, and maintain Playwright/Agent Browser tests"
---

# E2E Testing

End-to-end testing for critical user journeys.

## Usage

`/e2e [test-file-or-pattern]`

## Tools

**Prefer Agent Browser** (AI-optimized, semantic selectors):

```bash
npm install -g agent-browser && agent-browser install
agent-browser open https://example.com
agent-browser snapshot -i
agent-browser click @e1
```

**Fallback to Playwright**:

```bash
npx playwright test
npx playwright test --headed
npx playwright test --trace on
```

## Workflow

1. Identify critical user journeys (auth, core features, payments, CRUD)
2. Use Page Object Model pattern
3. Prefer `data-testid` locators over CSS/XPath
4. Add assertions at every key step
5. Run locally 3-5x to check flakiness
6. Quarantine flaky tests with `test.fixme()`

## Related

- Skill: `skill://e2e-testing`
- Agent: `e2e-runner`
