Deploy to Production / Build & Verify (push) Failing after 5m56s
Ping Search Engines / Notify Search Engines (push) Successful in 2s
Deploy to Production / Pre-Deploy Tests (push) Has been skipped
Deploy to Production / Deploy to Railway (push) Has been skipped
Deploy to Production / Deploy to Render (push) Has been skipped
Deploy to Production / Deploy to VPS (PM2) (push) Has been skipped
Deploy to Production / Deploy to Fly.io (push) Has been skipped
Deploy to Production / Post-Deploy Verification (push) Has been skipped
Deploy to Production / Notify on Failure (push) Successful in 2s
E2E Test Suite / Critical User Journeys (push) Has been skipped
E2E Test Suite / API Integration Tests (push) Has been skipped
E2E Test Suite / Smoke Tests (P0) (push) Failing after 11m26s
E2E Test Suite / Form Interaction Tests (push) Failing after 11m42s
E2E Test Suite / Destructive & Chaos Tests (push) Failing after 12m2s
E2E Test Suite / Cross-Browser Regression (chromium) (push) Failing after 16m14s
E2E Test Suite / Cross-Browser Regression (webkit) (push) Failing after 17m45s
E2E Test Suite / Cross-Browser Regression (firefox) (push) Failing after 25m23s
E2E Test Suite / Security Header Tests (push) Failing after 7m55s
E2E Test Suite / Test Report Summary (push) Failing after 20s
E2E Test Suite / Mobile Device Tests (push) Failing after 2h49m9s
Uptime Monitor / Health & Response Time (push) Failing after 2s
Uptime Monitor / SSL Certificate (push) Successful in 2s
Uptime Monitor / Send Alerts (push) Failing after 3s
Uptime Monitor / Record Uptime Success (push) Has been skipped
402 lines
8.5 KiB
Markdown
402 lines
8.5 KiB
Markdown
# E2E Test Suite Documentation
|
|
|
|
## Overview
|
|
Comprehensive end-to-end test suite for WorkRoot IT Solutions website covering all critical user journeys and interactions.
|
|
|
|
## Test Suites
|
|
|
|
### 1. **Smoke Suite** (`e2e-smoke-suite.spec.ts`)
|
|
**Priority:** P0 - Must pass before any deployment
|
|
**Runtime:** < 2 minutes
|
|
**Purpose:** Rapid verification of critical functionality
|
|
|
|
#### Coverage:
|
|
- All critical pages load (9 pages)
|
|
- Core navigation flows work
|
|
- Contact form basic submission
|
|
- Blog navigation basics
|
|
- Performance checks (< 3s load time)
|
|
- No JavaScript errors
|
|
- Responsive layout (Mobile/Tablet/Desktop)
|
|
- SEO basics (meta tags)
|
|
- Security headers present
|
|
- Accessibility basics
|
|
- Critical assets load
|
|
|
|
**When to run:** Every commit, before deployment, CI/CD pipeline
|
|
|
|
---
|
|
|
|
### 2. **Critical User Journeys** (`e2e-critical-paths.spec.ts`)
|
|
**Priority:** P0
|
|
**Runtime:** 3-5 minutes
|
|
**Purpose:** Test complete user flows from entry to conversion
|
|
|
|
#### User Journeys Tested:
|
|
1. **First Time Visitor → Contact**
|
|
- Homepage → Services → Contact → Form Submission
|
|
|
|
2. **Technical Reader → Blog → Contact**
|
|
- Homepage → Blog → Read Post → Contact
|
|
|
|
3. **Portfolio Exploration**
|
|
- Portfolio → About → Contact
|
|
|
|
4. **Mobile First-Time Visitor**
|
|
- Mobile navigation → Services → Contact form
|
|
|
|
5. **Quick Information Seeker**
|
|
- Footer links → Privacy → Terms → Home
|
|
|
|
6. **Return Visitor - Direct Blog Access**
|
|
- Bookmark/Search → Blog Post → Listing
|
|
|
|
7. **Security & Trust Verification**
|
|
- HTTPS check → Privacy Policy → Terms
|
|
|
|
8. **Multi-page Session**
|
|
- All pages visited in sequence
|
|
- No console errors
|
|
- No layout shifts
|
|
|
|
---
|
|
|
|
### 3. **Form Interactions** (`e2e-form-interactions.spec.ts`)
|
|
**Priority:** P1
|
|
**Runtime:** 4-6 minutes
|
|
**Purpose:** Deep testing of contact form functionality
|
|
|
|
#### Coverage:
|
|
- **Happy Path:**
|
|
- Successful submission with all fields
|
|
- Loading states
|
|
- Success messages
|
|
- Form clearing
|
|
|
|
- **Validation:**
|
|
- Empty submission
|
|
- Invalid email format
|
|
- Name too short
|
|
- Message too short
|
|
- Real-time validation
|
|
- Error message display
|
|
|
|
- **Security:**
|
|
- Honeypot protection (bot detection)
|
|
- Multiple submission prevention
|
|
|
|
- **UX Features:**
|
|
- Phone field formats
|
|
- Subject dropdown
|
|
- Focus states
|
|
- Keyboard navigation (Tab order)
|
|
|
|
- **Accessibility:**
|
|
- Labels associated with inputs
|
|
- Error announcements
|
|
- Submit button states
|
|
|
|
- **Mobile:**
|
|
- Touch interactions
|
|
- Keyboard types (email, tel)
|
|
- Viewport fit
|
|
|
|
---
|
|
|
|
### 4. **Blog Navigation** (`e2e-blog-navigation.spec.ts`)
|
|
**Priority:** P1
|
|
**Runtime:** 5-7 minutes
|
|
**Purpose:** Comprehensive blog functionality testing
|
|
|
|
#### Coverage:
|
|
- **Navigation Flows:**
|
|
- Homepage → Blog → Post → Back
|
|
- Multiple post reading
|
|
- Direct URL access
|
|
|
|
- **Reading Experience:**
|
|
- Deep reading (scrolling)
|
|
- Content structure
|
|
- Typography
|
|
- Image loading
|
|
- Code blocks
|
|
|
|
- **Metadata & SEO:**
|
|
- Dates visible
|
|
- Categories/tags
|
|
- Social sharing
|
|
|
|
- **Mobile Reading:**
|
|
- Responsive layout
|
|
- Font sizes
|
|
- Image adaptation
|
|
- Scroll performance
|
|
|
|
- **Reading Patterns:**
|
|
- Skimming behavior
|
|
- Deep reading scroll
|
|
- Code block interaction
|
|
|
|
- **Performance:**
|
|
- Listing load time < 3s
|
|
- Post load time < 3s
|
|
- Lazy loading
|
|
|
|
- **Edge Cases:**
|
|
- Direct URL access
|
|
- 404 handling
|
|
- Empty state
|
|
|
|
---
|
|
|
|
## Test Execution
|
|
|
|
### Quick Start
|
|
```bash
|
|
# Run all E2E tests
|
|
npm run test
|
|
|
|
# Run only smoke tests (fast)
|
|
npm run test tests/e2e-smoke-suite.spec.ts
|
|
|
|
# Run specific suite
|
|
npm run test tests/e2e-critical-paths.spec.ts
|
|
|
|
# Run on specific browser
|
|
npm run test:chromium
|
|
npm run test:firefox
|
|
npm run test:webkit
|
|
|
|
# Mobile testing
|
|
npm run test:mobile
|
|
```
|
|
|
|
### CI/CD Integration
|
|
```bash
|
|
# Pre-commit: Smoke suite only
|
|
npm run test tests/e2e-smoke-suite.spec.ts -- --project=chromium
|
|
|
|
# Pre-merge: All critical tests
|
|
npm run test tests/e2e-smoke-suite.spec.ts tests/e2e-critical-paths.spec.ts
|
|
|
|
# Nightly: Full regression
|
|
npm run test
|
|
```
|
|
|
|
### Test Reports
|
|
```bash
|
|
# View HTML report
|
|
npm run test:report
|
|
|
|
# Generate JSON report (for CI)
|
|
npm run test -- --reporter=json > test-results/report.json
|
|
```
|
|
|
|
---
|
|
|
|
## Test Environment
|
|
|
|
### Prerequisites
|
|
- Node.js installed
|
|
- Dependencies installed (`npm install`)
|
|
- Server running on `http://localhost:10000`
|
|
|
|
### Starting the server
|
|
```bash
|
|
# Terminal 1: Start server
|
|
npm run dev
|
|
|
|
# Terminal 2: Run tests
|
|
npm run test
|
|
```
|
|
|
|
### Environment Variables
|
|
No environment variables required for E2E tests.
|
|
|
|
---
|
|
|
|
## Test Data
|
|
|
|
### Blog Posts Used
|
|
- `getting-started-with-astro` - Main test post
|
|
|
|
### Form Test Data
|
|
```javascript
|
|
{
|
|
name: "John Doe",
|
|
email: "john.doe@example.com",
|
|
phone: "+1 555-123-4567",
|
|
subject: "web-development",
|
|
message: "I am interested in..."
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Coverage Matrix
|
|
|
|
| Feature | Smoke | Critical Paths | Form | Blog | Total Tests |
|
|
|---------|-------|----------------|------|------|-------------|
|
|
| Page Loads | ✅ 9 | ✅ 6 | ✅ 1 | ✅ 3 | 19 |
|
|
| Navigation | ✅ 2 | ✅ 8 | - | ✅ 7 | 17 |
|
|
| Forms | ✅ 1 | ✅ 3 | ✅ 20 | - | 24 |
|
|
| Mobile | ✅ 3 | ✅ 1 | ✅ 2 | ✅ 2 | 8 |
|
|
| Performance | ✅ 2 | ✅ 1 | - | ✅ 3 | 6 |
|
|
| Accessibility | ✅ 2 | - | ✅ 3 | ✅ 1 | 6 |
|
|
| Security | ✅ 1 | ✅ 1 | ✅ 2 | - | 4 |
|
|
| **Total** | **20** | **20** | **28** | **16** | **84** |
|
|
|
|
---
|
|
|
|
## Browser Support
|
|
|
|
### Tested Browsers
|
|
- ✅ **Chromium** (Chrome, Edge, Brave)
|
|
- ✅ **Firefox**
|
|
- ✅ **WebKit** (Safari)
|
|
- ✅ **Mobile Chrome** (Pixel 5)
|
|
- ✅ **Mobile Safari** (iPhone 12)
|
|
- ✅ **Tablet** (iPad Pro 11)
|
|
|
|
### Test Matrix Strategy
|
|
- **Smoke Suite:** Chromium only (speed)
|
|
- **Critical Paths:** All browsers
|
|
- **Form Tests:** Chromium + Mobile
|
|
- **Blog Tests:** Chromium + Mobile Safari
|
|
|
|
---
|
|
|
|
## Flaky Test Prevention
|
|
|
|
### Strategies Implemented
|
|
1. **Explicit Waits:** `waitForLoadState('networkidle')`
|
|
2. **Element Visibility Checks:** Before interaction
|
|
3. **Retry Logic:** Playwright built-in (2 retries in CI)
|
|
4. **Stable Selectors:** Semantic selectors over CSS classes
|
|
5. **Timeouts:** Generous timeouts for slow environments
|
|
|
|
### Known Issues
|
|
- None currently identified
|
|
|
|
---
|
|
|
|
## Debugging Failed Tests
|
|
|
|
### Screenshot on Failure
|
|
Screenshots automatically saved to `test-results/` on failure.
|
|
|
|
### Video Recording
|
|
```bash
|
|
# Enable video for all tests
|
|
npm run test -- --video=on
|
|
```
|
|
|
|
### Trace Viewer
|
|
```bash
|
|
# Tests run with trace on first retry
|
|
# View trace:
|
|
npx playwright show-trace test-results/.../trace.zip
|
|
```
|
|
|
|
### Debug Mode
|
|
```bash
|
|
# Run in headed mode with slow-mo
|
|
npm run test -- --headed --slow-mo=1000
|
|
```
|
|
|
|
---
|
|
|
|
## Maintenance
|
|
|
|
### Adding New Tests
|
|
1. Identify user journey or feature
|
|
2. Choose appropriate suite file
|
|
3. Write test following existing patterns
|
|
4. Run locally: `npm run test path/to/test.spec.ts`
|
|
5. Update this README with coverage
|
|
|
|
### Updating Selectors
|
|
When UI changes:
|
|
1. Run tests to identify failures
|
|
2. Update selectors in failed tests
|
|
3. Prefer semantic selectors (`getByRole`, `getByLabel`)
|
|
4. Verify across all browsers
|
|
|
|
### Performance Benchmarks
|
|
Current baselines:
|
|
- Homepage load: < 3s
|
|
- Blog listing load: < 3s
|
|
- Blog post load: < 3s
|
|
- Form submission: < 2s
|
|
|
|
Update these if intentional changes occur.
|
|
|
|
---
|
|
|
|
## Best Practices
|
|
|
|
### DO ✅
|
|
- Use semantic selectors
|
|
- Wait for element visibility
|
|
- Test user journeys, not implementation
|
|
- Keep tests independent
|
|
- Clean up test data
|
|
- Use descriptive test names
|
|
|
|
### DON'T ❌
|
|
- Use fixed delays (`waitForTimeout` sparingly)
|
|
- Test implementation details
|
|
- Make tests depend on each other
|
|
- Hardcode credentials
|
|
- Ignore flaky tests
|
|
|
|
---
|
|
|
|
## CI/CD Pipeline Integration
|
|
|
|
### GitHub Actions Example
|
|
```yaml
|
|
name: E2E Tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
- run: npm ci
|
|
- run: npx playwright install --with-deps
|
|
- run: npm run build
|
|
- run: npm run preview &
|
|
- run: npx wait-on http://localhost:10000
|
|
- run: npm run test
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: test-results
|
|
path: test-results/
|
|
```
|
|
|
|
---
|
|
|
|
## Contact & Support
|
|
|
|
For questions about E2E tests:
|
|
- Check test file comments for specific test logic
|
|
- Review Playwright documentation: https://playwright.dev
|
|
- Contact QA team for test strategy questions
|
|
|
|
---
|
|
|
|
## Changelog
|
|
|
|
### 2026-03-21
|
|
- ✅ Initial E2E test suite creation
|
|
- ✅ 84 comprehensive tests across 4 suites
|
|
- ✅ Full coverage of critical user journeys
|
|
- ✅ Mobile and desktop testing
|
|
- ✅ Performance and security checks
|
|
- ✅ Accessibility validation
|