Playwright Test Configuration Verification
✅ Installation Complete
Playwright has been successfully configured for structural regression testing of the Genesis Theme demo page.
Configuration Summary
Files Created/Modified
- playwright.config.js - Main Playwright configuration
- Base URL: https://asisaga.github.io/theme.asisaga.com (configurable)
- Support for local testing via
TEST_LOCAL=1 - Three viewport configurations: Desktop, Mobile, Tablet
- Timeout: 30 seconds per test
- Retries: 2 on CI
- tests/e2e/structural-regression.spec.js - Main test suite (277 lines)
- 24 unique test cases
- 8 test categories
- 72 total test runs (24 tests × 3 viewports)
- .github/workflows/playwright.yml - CI/CD automation
- Runs on push/PR to main
- Weekly scheduled runs (Sundays)
- Manual trigger support
- Uploads reports and screenshots as artifacts
- package.json - Updated with new scripts
test:e2e- Run tests against live sitetest:e2e:local- Run tests against local servertest:e2e:headed- Run with visible browsertest:e2e:ui- Run with Playwright UItest:e2e:report- View HTML report
- Documentation
/docs/PLAYWRIGHT-TESTING.md- Complete testing guide/tests/e2e/README.md- Test suite documentation
- Configuration Updates
.gitignore- Exclude playwright-report/, test-results/_config.yml- Exclude e2e tests from Jekyll build
Test Coverage
1. Semantic HTML Structure (4 tests)
- ✓ Proper document structure (html, head, body)
- ✓ Required meta tags (charset, viewport)
- ✓ Single main landmark (WCAG requirement)
- ✓ Proper heading hierarchy
2. Accessibility Landmarks (4 tests)
- ✓ Skip link for keyboard navigation
- ✓ Main landmark with skip target
- ✓ Header and footer landmarks
- ✓ Navigation with proper semantics
3. Component Structure (4 tests)
- ✓ Hero section presence
- ✓ Hero title visibility
- ✓ Demo sections
- ✓ Interactive elements
4. Responsive Behavior (3 tests)
- ✓ Mobile-friendly (375px viewport)
- ✓ Tablet adaptation (768px viewport)
- ✓ Desktop viewport (1440px viewport)
5. CSS and Styling (2 tests)
- ✓ Stylesheet loading
- ✓ Ontological classes applied
6. Content Presence (3 tests)
- ✓ Meaningful page title
- ✓ Visible text content
- ✓ Images with alt attributes
7. JavaScript and Interactivity (2 tests)
- ✓ Console error detection
- ✓ JavaScript-enabled features
8. Performance and Loading (2 tests)
- ✓ Load time under 10 seconds
- ✓ Critical resources loaded
Running Tests
Prerequisites
# Install dependencies (already done)
npm install
# Install Playwright browsers (already done in sandbox)
npx playwright install chromium
Test Commands
# Run all tests against live site
npm run test:e2e
# Run tests against local Jekyll server (requires server running)
npm run test:e2e:local
# Run with visible browser
npm run test:e2e:headed
# Run with interactive UI
npm run test:e2e:ui
# View HTML report
npm run test:e2e:report
Testing Against Local Server
# Terminal 1: Start Jekyll server
bundle exec jekyll serve
# Terminal 2: Run tests
npm run test:e2e:local
CI/CD Integration
The GitHub Actions workflow will:
- Run automatically on push/PR to main branch
- Run weekly on Sundays at midnight UTC
- Can be manually triggered via workflow_dispatch
- Upload test reports as artifacts (30-day retention)
- Upload screenshots on failure (7-day retention)
- Comment on PR if tests fail
Expected Test Execution
When tests run successfully against the live site:
- Total tests: 72 (24 tests × 3 viewports)
- Execution time: ~2-5 minutes
- Report location:
playwright-report/index.html - Screenshots:
test-results/(only on failure)
Verification Steps
1. Verify Configuration
cat playwright.config.js
✅ Config exists with correct base URL and viewports
2. Verify Test Suite
cat tests/e2e/structural-regression.spec.js | grep "test(" | wc -l
✅ 24 test cases defined
3. Verify npm Scripts
npm run | grep test:e2e
✅ All 5 e2e scripts available
4. Verify Workflow
cat .github/workflows/playwright.yml
✅ Workflow configured for automated testing
Next Steps
For Users with Internet Access
To run tests against the live site:
npm run test:e2e
For Local Testing
- Start Jekyll server:
bundle exec jekyll serve - Run tests:
npm run test:e2e:local - View report:
npm run test:e2e:report
Troubleshooting
Network Access Required
The tests target the live GitHub Pages site at: https://asisaga.github.io/theme.asisaga.com/
In sandboxed environments without internet access, tests will fail to connect. This is expected and will work correctly when:
- Running in CI/CD with network access
- Running locally with internet access
- Running against local Jekyll server with
TEST_LOCAL=1
Common Solutions
Problem: Tests timeout or fail to connect Solution: Ensure network access or use local testing mode
Problem: Jekyll server not running for local tests
Solution: Start server with bundle exec jekyll serve
Problem: Browser not installed
Solution: Run npx playwright install chromium
Documentation
Complete documentation available at:
/docs/PLAYWRIGHT-TESTING.md- Full testing guide/tests/e2e/README.md- Test suite details- Playwright Documentation
Success Criteria
✅ Playwright installed and configured ✅ Test suite created with 24 test cases ✅ npm scripts added for easy execution ✅ CI/CD workflow configured ✅ Documentation complete ✅ gitignore updated ✅ Jekyll config updated
Summary
Playwright structural regression testing is now fully configured and ready to use. The tests will run automatically on CI/CD and can be run locally against either the live site or a local Jekyll server. All tests verify the semantic HTML structure, accessibility standards, responsive behavior, and component presence of the Genesis Theme demo page.