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/testrail.md
View on GitHub# Sub-Skill: TestRail Integration
**Parent:** playwright-pro
**Trigger:** "TestRail", "test management", "sync test results to TestRail"
## Purpose
Integrate Playwright test execution with TestRail for test case management, run tracking, and reporting. Sync test results automatically from CI.
## Workflow
### Step 1: Install Reporter
```bash
pnpm add -D playwright-testrail-reporter
```
### Step 2: Configure Reporter
Add TestRail reporter to `playwright.config.ts`:
```typescript
reporter: [
['html'],
['playwright-testrail-reporter', {
host: process.env.TESTRAIL_HOST,
username: process.env.TESTRAIL_USERNAME,
password: process.env.TESTRAIL_API_KEY,
projectId: 1,
suiteId: 1,
runName: `Automated Run - ${new Date().toISOString()}`,
includeAllInTestRun: false,
}],
],
```
### Step 3: Map Tests to TestRail Cases
Add TestRail case IDs to test titles or annotations:
```typescript
// Option A: In test title
test('C12345 - User can log in with valid credentials', async ({ page }) => {
// ...
});
// Option B: Via annotation
test('User can log in', async ({ page }) => {
test.info().annotations.push({ type: 'testrail', description: 'C12345' });
// ...
});
```
### Step 4: Sync Results
When tests run in CI, the reporter automatically:
1. Creates a new test run in TestRail (or updates existing)
2. Maps Playwright test results to TestRail case IDs
3. Uploads pass/fail status with execution time
4. Attaches failure messages and screenshots
### Step 5: CI Configuration
```yaml
- run: pnpm exec playwright test
env:
TESTRAIL_HOST: ${{ secrets.TESTRAIL_HOST }}
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
```
## Best Practices
1. Use TestRail case IDs consistently (prefix `C` + number)
2. Map every automated test to a TestRail case for full traceability
3. Keep manual-only test cases separate from automated ones in TestRail
4. Use TestRail milestones to group runs by release
5. Review unmapped tests periodically -- they indicate coverage drift
## Inputs
| Input | Required | Description |
|-------|----------|-------------|
| TestRail credentials | Yes | Host, username, API key |
| Project and suite IDs | Yes | TestRail project/suite to sync to |
| Case ID mapping | Yes | Test-to-case ID mapping (in titles or annotations) |
## Outputs
- TestRail reporter configured in Playwright
- Test runs created and synced automatically
- Pass/fail results with failure details in TestRail
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 |