# Playwright E2E Testing Patterns (e2e-testing)

> Playwright E2E testing patterns covering Page Object Model, configuration, CI/CD integration, artifact management and flaky test strategies.

- Category: [Testing & Debugging](https://www.myskills.tools/en/categories/testing-debugging/)
- Source: Community · Affaan Mustafa
- Repository: https://github.com/affaan-m/ECC/tree/main/skills/e2e-testing (commit d29cf65)
- SKILL.md: https://github.com/affaan-m/ECC/blob/main/skills/e2e-testing/SKILL.md
- Install command: `npx skills add affaan-m/ECC --skill e2e-testing`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot, OpenCode
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✗
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.

## Core rule

Wait for specific conditions such as auto-waiting locators or a particular response, not arbitrary timeouts.

## Execution Phases

1. **Organize the tests** — Group test files by feature under tests/e2e, add fixtures, and write Page Object classes with data-testid locators.
2. **Write the tests** — Structure cases with test.describe and beforeEach, drive pages through page objects, and assert on results.
3. **Configure Playwright** — Set CI retries, reporters, trace, screenshot and video on failure, multiple browsers and webServer in playwright.config.ts.
4. **Handle flaky tests** — Quarantine with test.fixme or test.skip, find flakiness with --repeat-each, and fix race, network and animation timing issues.
5. **Artifacts and CI** — Capture screenshots, traces and video, run tests in GitHub Actions with the report uploaded, and fill in the test report template.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Writes test files, page objects, playwright.config.ts and a CI workflow. |
| Command execution | Tests only | Runs npx playwright test, including with --repeat-each and --retries. |
| Network outbound | Not required | Tests default to a local baseURL; the patterns include no other network steps. |

## SKILL.md frontmatter (YAML)

```yaml
---
name: e2e-testing
description: Playwright E2E testing patterns, Page Object Model, configuration, CI/CD integration, artifact management, and flaky test strategies. Use when writing Playwright tests, structuring page objects, or fixing flaky E2E runs in CI.
metadata:
  origin: ECC
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/e2e-testing/
