Visualize Playwright tests as product requirements
Transform npx playwright test --list output into a beautiful, readable requirements document.
- Smart Display - Deduplicates project/file names, shows hierarchical structure
- Color Coding -
skip= gray,fixme= red, active = green - Coverage Summary - Shows total/skip/fixme counts and health percentage
- Multiple Formats - Terminal (ANSI colors), Markdown, JSON
npm install -g playwright-requirements
# or
pnpm add -g playwright-requirements# Basic usage (terminal output)
npx playwright-requirements
# Short alias
npx pw-req
# Markdown output
npx playwright-requirements --format markdown
# Save to file
npx playwright-requirements --format markdown --output requirements.md
# Filter by project
npx playwright-requirements --project chromium
# Filter by tag
npx playwright-requirements --tag @smoke
# JSON output for programmatic use
npx playwright-requirements --format json╭──────────────────────────────────────────────────────────╮
│ 📋 REQUIREMENTS playwright-requirements │
╰──────────────────────────────────────────────────────────╯
[unauthenticated] 19 tests
────────────────────────────────────────────────────────────
📁 landing.spec.ts
▸ Landing Page (4 tests)
✓ should display landing page with hero
✓ should have accessible navigation
⊘ should handle 2FA flow [skip]
✗ should recover from OAuth timeout [fixme]
╭──────────────────────────────────────────────────────────╮
│ Total: 171 ✓ 165 ⊘ 4 ✗ 2 Health: 96.5% │
╰──────────────────────────────────────────────────────────╯
# Requirements
## Summary
| Total | Active | Skip | Fixme | Health |
|-------|--------|------|-------|--------|
| 171 | 165 | 4 | 2 | 🟢 96.5% |
## [unauthenticated] (19 tests)
### 📁 landing.spec.ts
#### Landing Page (4 tests)
- ✅ should display landing page with hero
- ✅ should have accessible navigation
- ⏭️ ~~should handle 2FA flow~~ `[skip]`
- 🔴 should recover from OAuth timeout `[fixme]`| Option | Alias | Description | Default |
|---|---|---|---|
--format |
-f |
Output format: terminal, markdown, json |
terminal |
--tag |
-t |
Filter by tag (e.g., @smoke) |
- |
--project |
-p |
Filter by project name | - |
--output |
-o |
Output file path | stdout |
--no-color |
- | Disable colored output | false |
--config |
-c |
Path to Playwright config | auto-detect |
import {
parsePlaywrightJSON,
formatTerminal,
formatMarkdown,
filterByTag,
} from 'playwright-requirements'
// Parse Playwright JSON output
const requirements = parsePlaywrightJSON(playwrightJson)
// Filter by tag
const smokeTests = filterByTag(requirements, '@smoke')
// Format as terminal output
console.log(formatTerminal(requirements))
// Format as Markdown
console.log(formatMarkdown(requirements))MIT