playwright-test-workflow
v1.0.0
Published
Global test workflow package for Playwright with custom reporters
Maintainers
Readme
Playwright Test Workflow
A global testing workflow package for Playwright that provides:
- Automated test grouping by serial numbers (TEST#1, TEST#2, etc.)
- Custom reporters for text and HTML output
- Separate reports for each test group
- Template files for consistent testing across projects
Installation
# Install globally
npm install -g playwright-test-workflow
# Or install locally in your project
npm install --save-dev playwright-test-workflowQuick Start
# Initialize workflow in your project
test-workflow init my-app
# Run tests
npx playwright test
# Check results in test-results/ folderFeatures
Custom Reporters
- Text Reporter: Generates simple text files with pass/fail status
- HTML Reporter: Creates beautiful HTML reports with styling
- Group Reports: Separate files for each test group (TEST#1, TEST#2, etc.)
File Structure
your-project/
├── test.md # Test planning document
├── playwright.config.js # Playwright configuration
├── tests/ # Test files
├── test-results/ # Generated reports
│ ├── TEST#1-results.txt # Group-specific text report
│ ├── TEST#1-results.html # Group-specific HTML report
│ ├── TEST#2-results.txt
│ ├── TEST#2-results.html
│ └── test-results.json # Overall JSON report
└── reporters/ # Custom reporter filesUsage
1. Initialize Workflow
test-workflow init [project-name]2. Plan Your Tests
Edit test.md to add your specific test cases:
### TEST#1 - Core Functionality
- [ ] Feature loads successfully
- [ ] Main functionality works as expected
### TEST#2 - User Interface
- [ ] UI elements display correctly
- [ ] User interactions are responsive3. Write Tests
Create test files in tests/ directory. The reporters automatically group tests based on keywords.
4. Run Tests
npx playwright test5. Check Results
- Individual group reports:
test-results/TEST#1-results.txt,test-results/TEST#1-results.html - Overall reports:
test-results/test-results.json,playwright-report/index.html
Test Grouping Logic
Tests are automatically grouped based on keywords in test names:
- TEST#1: load, display, show, heading, button, input, result display
- TEST#2: calculate, sum, negative, zero, large, decimal
- TEST#3: empty, non-numeric, precision, error, validation
- TEST#4: responsive, clickable, accept, update, ui, ux
Configuration
You can customize test grouping patterns in your playwright.config.js:
reporter: [
['playwright-test-workflow/reporters/text-reporter.js', {
outputFile: 'test-results/test-results.txt',
testGroupPatterns: {
'TEST#1': ['login', 'auth', 'signup'],
'TEST#2': ['dashboard', 'navigation', 'menu'],
// ... custom patterns
}
}]
]Workflow
- Create Feature → 2. Update test.md → 3. Number Tests → 4. Run Tests → 5. Generate Reports → 6. Update test.md with Results
Perfect for maintaining consistent testing across multiple projects!
