borghei/Claude-Skills / engineering/playwright-pro
playwright-pro
VerifiedEnd-to-end testing with Playwright: test generation, page objects, locator strategy, flaky- test diagnosis, visual regression, and CI integration. Use when writing E2E tests, fixing flaky tests, or migrating from Cypress/Selenium.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.6 KB |
| assets/flawed_tests/profile.spec.ts | script | 468 B |
| assets/reports/run1.json | config | 1.2 KB |
| assets/reports/run2.json | config | 1.3 KB |
| assets/reports/run3.json | config | 1.4 KB |
| assets/sample_flows.json | config | 800 B |
| assets/sample_login.html | other | 489 B |
| assets/tests/login.spec.ts | script | 906 B |
| references/core-rules-and-patterns.md | markdown | 7.2 KB |
| references/diagnosis-migration-and-ci.md | markdown | 8.7 KB |
| references/playwright-patterns.md | markdown | 4.5 KB |
| scripts/coverage_mapper.py | script | 11.0 KB |
| scripts/flaky_detector.py | script | 10.6 KB |
| scripts/page_object_generator.pyexecutable | script | 14.8 KB |
| scripts/test_analyzer.pyexecutable | script | 12.3 KB |
| scripts/test_generator.py | script | 11.1 KB |
| scripts/test_report_parser.pyexecutable | script | 14.8 KB |
| skills/browserstack.md | markdown | 2.4 KB |
| skills/coverage.md | markdown | 1.9 KB |
| skills/fix.md | markdown | 2.6 KB |
| skills/generate.md | markdown | 2.4 KB |
| skills/init.md | markdown | 2.1 KB |
| skills/migrate.md | markdown | 2.5 KB |
| skills/report.md | markdown | 2.0 KB |
| skills/review.md | markdown | 2.2 KB |
| skills/testrail.md | markdown | 2.5 KB |
skills/generate.md
View on GitHub# Sub-Skill: Test Generation
**Parent:** playwright-pro
**Trigger:** "generate tests for", "write e2e tests", "create Playwright tests from"
## Purpose
Generate Playwright test files from user stories, page descriptions, or API endpoint lists. Produces spec files with Page Objects, proper assertions, and test isolation.
## Workflow
### Step 1: Gather Input
Accept one of:
- **User story:** "As a user, I can log in with email and password"
- **Page description:** "Login page with email field, password field, submit button, forgot password link"
- **URL + selectors:** Crawl a page and extract interactive elements
### Step 2: Identify Test Scenarios
For each input, derive:
- **Happy path:** Primary success flow
- **Validation errors:** Empty fields, invalid formats, boundary values
- **Edge cases:** Network failure, timeout, concurrent sessions
- **Negative paths:** Wrong credentials, expired tokens, unauthorized access
### Step 3: Generate Page Object
If no Page Object exists for the target page, generate one using the locator priority from the parent skill (getByRole > getByLabel > getByText > getByTestId > CSS).
### Step 4: Generate Spec File
```typescript
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
// Navigate and set up
});
test('happy path description', async ({ page }) => {
// Arrange, Act, Assert
});
test('validation: empty required field', async ({ page }) => {
// Test validation behavior
});
});
```
### Step 5: Validate Generated Tests
- Every test has at least one `expect()` assertion
- No `waitForTimeout()` calls
- All locators use semantic strategies
- Tests are isolated (no shared mutable state)
## Rules
1. One behavior per test -- multiple related assertions within a behavior are fine
2. Use Page Object methods, never raw locators in spec files
3. Name tests as "expected behavior when condition" (e.g., "redirects to dashboard after valid login")
4. Group related tests in `test.describe()` blocks
5. Use `test.beforeEach()` for common setup, never shared variables
## Inputs
| Input | Required | Description |
|-------|----------|-------------|
| Source | Yes | User story, page description, or URL |
| Page name | Yes | Target page for Page Object naming |
| Auth required | No | Whether tests need authenticated state |
## Outputs
- Page Object class (if new)
- Spec file with happy path + error path tests
- Suggested additional test scenarios
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |