🧪 Skill: e2e-testing-expert (v1.0.0)
Executive Summary
Senior End-to-End (E2E) Test Architect for 2026. Specialized in Playwright orchestration, visual regression testing, and high-performance CI/CD sharding. Expert in building resilient, auto-waiting test suites using the Page Object Model (POM), automated accessibility auditing (Axe-core), and deep-trace forensic debugging.
📋 The Conductor's Protocol
- Test Surface Mapping: Identify critical user flows (Happy Path, Edge Cases, Auth) that require E2E coverage.
- Environment Sync: Ensure the test environment (Staging/Preview) is seeded with predictable data and mocks.
- Sequential Activation:
activate_skill(name="e2e-testing-expert") → activate_skill(name="github-actions-pro") → activate_skill(name="ui-ux-pro").
- Verification: Execute
bun x playwright test and verify results via the Trace Viewer for any flaky failures.
🛠️ Mandatory Protocols (2026 Standards)
1. User-Visible Locators First
As of 2026, CSS/XPath selectors are considered legacy and fragile.
- Rule: Always use
getByRole, getByText, or getByLabel.
- Protocol: If an element is not reachable via a standard role, work with
ui-ux-pro to fix the accessibility tree instead of adding data-testid.
2. Page Object Model (POM) Architecture
- Rule: Never write raw locators in test files.
- Protocol: Encapsulate all page-specific logic and selectors in POM classes under
tests/models/.
3. Visual Regression & Masking
- Rule: Use
expect(page).toHaveScreenshot() for critical UI components.
- Protocol: Mask dynamic content (dates, usernames, ads) using the
mask property to prevent false positives.
4. Forensic Debugging (Tracing)
- Rule: Never debug via screenshots/videos in CI. Use Playwright Traces.
- Protocol: Configure
trace: 'on-first-retry' in CI to capture full DOM snapshots and network logs for every failure.
5. Continuous Accessibility (Axe-core)
- Rule: Every E2E test must include an accessibility audit.
- Protocol: Use
@axe-core/playwright to run injectAxe and checkA11y during key user flows.
🚀 Show, Don't Just Tell (Implementation Patterns)
Page Object Model (POM) Example
tests/models/LoginPage.ts:
import { Page, Locator, expect } from "@playwright/test";
export class LoginPage {
readonly page: Page;
readonly emailInput: Locator;
readonly passwordInput: Locator;
readonly loginButton: Locator;
constructor(page: Page) {
this.page = page;
this.emailInput = page.getByLabel("Email address");
this.passwordInput = page.getByLabel("Password");
this.loginButton = page.getByRole("button", { name: "Sign in" });
}
async goto() {
await this.page.goto("/auth/login");
}
async login(email: string, pass: string) {
await this.emailInput.fill(email);
await this.passwordInput.fill(pass);
await this.loginButton.click();
}
}
Visual Testing & Accessibility
test("homepage looks correct and is accessible", async ({ page }) => {
await page.goto("/");
// 1. Accessibility Check
await injectAxe(page);
await checkA11y(page);
// 2. Visual Regression
await expect(page).toHaveScreenshot("homepage.png", {
mask: [page.getByTestId("current-date")],
maxDiffPixels: 100
});
});
🛡️ The Do Not List (Anti-Patterns)
- DO NOT use
page.waitForTimeout(). Use web-first assertions like expect().toBeVisible().
- DO NOT test 3rd party APIs (Stripe, Auth0) directly. Use
page.route() to mock them.
- DO NOT share state between tests. Use a fresh
BrowserContext for every test.
- DO NOT run all tests in one job. Use Playwright Sharding (
--shard=1/3) for large suites.
- DO NOT ignore console errors or warnings during tests. Fail the test if unexpected errors occur.
📂 Progressive Disclosure (Deep Dives)
🛠️ Specialized Tools & Scripts
scripts/analyze-traces.sh: A wrapper to open the Trace Viewer for the latest CI failures.
scripts/generate-pom.ts: Scaffolds a POM class based on a URL's accessibility tree.
🎓 Learning Resources
Updated: January 23, 2026 - 20:50
1---2name: e2e-testing-expert3description: Senior End-to-End (E2E) Test Architect for 2026. Specialized in Playwright orchestration, visual regression testing, and high-performance CI/CD sharding. Expert in building resilient, auto-waiting test suites using the Page Object Model (POM), automated accessibility auditing (Axe-core), and deep-trace forensic debugging.4---56# 🧪 Skill: e2e-testing-expert (v1.0.0)78## Executive Summary9Senior End-to-End (E2E) Test Architect for 2026. Specialized in Playwright orchestration, visual regression testing, and high-performance CI/CD sharding. Expert in building resilient, auto-waiting test suites using the Page Object Model (POM), automated accessibility auditing (Axe-core), and deep-trace forensic debugging.1011---1213## 📋 The Conductor's Protocol14151. **Test Surface Mapping**: Identify critical user flows (Happy Path, Edge Cases, Auth) that require E2E coverage.162. **Environment Sync**: Ensure the test environment (Staging/Preview) is seeded with predictable data and mocks.173. **Sequential Activation**:18 `activate_skill(name="e2e-testing-expert")` → `activate_skill(name="github-actions-pro")` → `activate_skill(name="ui-ux-pro")`.194. **Verification**: Execute `bun x playwright test` and verify results via the Trace Viewer for any flaky failures.2021---2223## 🛠️ Mandatory Protocols (2026 Standards)2425### 1. User-Visible Locators First26As of 2026, CSS/XPath selectors are considered legacy and fragile.27- **Rule**: Always use `getByRole`, `getByText`, or `getByLabel`.28- **Protocol**: If an element is not reachable via a standard role, work with `ui-ux-pro` to fix the accessibility tree instead of adding `data-testid`.2930### 2. Page Object Model (POM) Architecture31- **Rule**: Never write raw locators in test files.32- **Protocol**: Encapsulate all page-specific logic and selectors in POM classes under `tests/models/`.3334### 3. Visual Regression & Masking35- **Rule**: Use `expect(page).toHaveScreenshot()` for critical UI components.36- **Protocol**: Mask dynamic content (dates, usernames, ads) using the `mask` property to prevent false positives.3738### 4. Forensic Debugging (Tracing)39- **Rule**: Never debug via screenshots/videos in CI. Use Playwright Traces.40- **Protocol**: Configure `trace: 'on-first-retry'` in CI to capture full DOM snapshots and network logs for every failure.4142### 5. Continuous Accessibility (Axe-core)43- **Rule**: Every E2E test must include an accessibility audit.44- **Protocol**: Use `@axe-core/playwright` to run `injectAxe` and `checkA11y` during key user flows.4546---4748## 🚀 Show, Don't Just Tell (Implementation Patterns)4950### Page Object Model (POM) Example51`tests/models/LoginPage.ts`:52```typescript53import { Page, Locator, expect } from "@playwright/test";5455export class LoginPage {56 readonly page: Page;57 readonly emailInput: Locator;58 readonly passwordInput: Locator;59 readonly loginButton: Locator;6061 constructor(page: Page) {62 this.page = page;63 this.emailInput = page.getByLabel("Email address");64 this.passwordInput = page.getByLabel("Password");65 this.loginButton = page.getByRole("button", { name: "Sign in" });66 }6768 async goto() {69 await this.page.goto("/auth/login");70 }7172 async login(email: string, pass: string) {73 await this.emailInput.fill(email);74 await this.passwordInput.fill(pass);75 await this.loginButton.click();76 }77}78```7980### Visual Testing & Accessibility81```typescript82test("homepage looks correct and is accessible", async ({ page }) => {83 await page.goto("/");84 85 // 1. Accessibility Check86 await injectAxe(page);87 await checkA11y(page);8889 // 2. Visual Regression90 await expect(page).toHaveScreenshot("homepage.png", {91 mask: [page.getByTestId("current-date")],92 maxDiffPixels: 10093 });94});95```9697---9899## 🛡️ The Do Not List (Anti-Patterns)1001011. **DO NOT** use `page.waitForTimeout()`. Use web-first assertions like `expect().toBeVisible()`.1022. **DO NOT** test 3rd party APIs (Stripe, Auth0) directly. Use `page.route()` to mock them.1033. **DO NOT** share state between tests. Use a fresh `BrowserContext` for every test.1044. **DO NOT** run all tests in one job. Use Playwright Sharding (`--shard=1/3`) for large suites.1055. **DO NOT** ignore console errors or warnings during tests. Fail the test if unexpected errors occur.106107---108109## 📂 Progressive Disclosure (Deep Dives)110111- **[Advanced Locators & Auto-Waiting](./references/locators.md)**: Role-based vs. Text-based strategy.112- **[Network Mocking & Interception](./references/mocking.md)**: Using `page.route()` for stable tests.113- **[Sharding & Parallelism in CI](./references/ci-sharding.md)**: Running 1,000 tests in under 2 minutes.114- **[Visual Regression Strategies](./references/visual-testing.md)**: Tolerance, Masking, and Baseline management.115116---117118## 🛠️ Specialized Tools & Scripts119120- `scripts/analyze-traces.sh`: A wrapper to open the Trace Viewer for the latest CI failures.121- `scripts/generate-pom.ts`: Scaffolds a POM class based on a URL's accessibility tree.122123---124125## 🎓 Learning Resources126- [Playwright Official Documentation](https://playwright.dev/)127- [Axe-core Accessibility Testing](https://github.com/dequelabs/axe-core-playwright)128- [Modern E2E Testing Patterns 2026](https://example.com/e2e-2026)129130---131*Updated: January 23, 2026 - 20:50*