First Init
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
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
This commit is contained in:
@@ -0,0 +1,225 @@
|
||||
# Comprehensive E2E Test Suite — WorkRoot IT Solutions
|
||||
**QA Automation Engineer Agent** | Created: 2026-03-21
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
This document describes the complete E2E test suite for the WorkRoot IT Solutions website. The suite was built on top of the existing 12 test files, adding 4 new test files and a CI/CD pipeline.
|
||||
|
||||
---
|
||||
|
||||
## Test Architecture
|
||||
|
||||
### Page Object Models (New)
|
||||
Located in `tests/pages/`:
|
||||
- **`ContactPage.ts`** — Encapsulates all contact form selectors and interactions
|
||||
- **`NavigationPage.ts`** — Encapsulates header/footer/mobile nav interactions
|
||||
|
||||
These POMs reduce selector duplication and make tests more maintainable.
|
||||
|
||||
---
|
||||
|
||||
## Test Files
|
||||
|
||||
### Existing Tests (12 files, inherited)
|
||||
| File | Priority | Tests | Coverage |
|
||||
|------|----------|-------|----------|
|
||||
| `e2e-smoke-suite.spec.ts` | P0 | ~20 | Page loads, performance, security basics |
|
||||
| `e2e-critical-paths.spec.ts` | P0 | ~20 | Complete user journeys |
|
||||
| `e2e-form-interactions.spec.ts` | P1 | ~20 | Contact form deep testing |
|
||||
| `contact-form.spec.ts` | P1 | ~12 | Form fields and validation |
|
||||
| `navigation.spec.ts` | P1 | ~10 | Nav links, mobile menu, responsive |
|
||||
| `blog.spec.ts` | P1 | ~12 | Blog listing, posts, mobile |
|
||||
| `portfolio.spec.ts` | P1 | ~8 | Portfolio grid, filters, responsive |
|
||||
| `pages.spec.ts` | P1 | ~6 | Page load and accessibility |
|
||||
| `accessibility.spec.ts` | P1 | ~8 | WCAG compliance |
|
||||
| `cross-browser.spec.ts` | P2 | ~6 | Cross-browser consistency |
|
||||
| `security-headers.test.ts` | P1 | ~8 | Security headers, CORS, CSP |
|
||||
| `static-assets.spec.ts` | P2 | ~4 | Favicon, CSS, images |
|
||||
|
||||
### New Tests (4 files, added)
|
||||
| File | Priority | Tests | Coverage |
|
||||
|------|----------|-------|----------|
|
||||
| `newsletter-subscription.spec.ts` | P1 | ~28 | Newsletter form E2E + API + mobile |
|
||||
| `api-integration.spec.ts` | P1 | ~32 | Direct API tests for all endpoints |
|
||||
| `destructive-chaos.spec.ts` | P1 | ~30 | XSS, injection, network failures, race conditions |
|
||||
|
||||
---
|
||||
|
||||
## Coverage Matrix
|
||||
|
||||
| Feature | Smoke | Critical | Forms | API | Chaos | Newsletter |
|
||||
|---------|-------|----------|-------|-----|-------|------------|
|
||||
| Page loads | ✅ | ✅ | - | - | - | - |
|
||||
| Navigation (desktop) | ✅ | ✅ | - | - | - | - |
|
||||
| Navigation (mobile) | ✅ | ✅ | - | - | - | - |
|
||||
| Contact form (happy path) | ✅ | ✅ | ✅ | ✅ | - | - |
|
||||
| Contact form (validation) | - | - | ✅ | ✅ | ✅ | - |
|
||||
| Contact form (honeypot) | - | - | ✅ | ✅ | - | - |
|
||||
| Contact form (loading state) | - | - | ✅ | - | - | - |
|
||||
| Newsletter form (happy path) | - | - | - | - | - | ✅ |
|
||||
| Newsletter form (validation) | - | - | - | ✅ | ✅ | ✅ |
|
||||
| Newsletter API (direct) | - | - | - | ✅ | - | ✅ |
|
||||
| Blog navigation | ✅ | ✅ | - | - | - | - |
|
||||
| Blog reading experience | - | ✅ | - | - | - | - |
|
||||
| Portfolio filtering | - | ✅ | - | - | - | - |
|
||||
| Security headers | ✅ | ✅ | - | ✅ | - | - |
|
||||
| Rate limiting | - | - | - | ✅ | ✅ | ✅ |
|
||||
| XSS prevention | - | - | - | - | ✅ | - |
|
||||
| Network failure handling | - | - | - | - | ✅ | ✅ |
|
||||
| Race conditions | - | - | ✅ | - | ✅ | ✅ |
|
||||
| Mobile responsiveness | ✅ | ✅ | ✅ | - | - | ✅ |
|
||||
| API validation | - | - | - | ✅ | ✅ | - |
|
||||
| Accessibility | ✅ | - | ✅ | - | - | ✅ |
|
||||
|
||||
**Total estimated tests: ~150**
|
||||
|
||||
---
|
||||
|
||||
## Running Tests
|
||||
|
||||
### Quick Commands
|
||||
```bash
|
||||
# P0: Run before every deployment (~2 min)
|
||||
npm run test:smoke
|
||||
|
||||
# P0: Critical user journeys
|
||||
npm run test:critical
|
||||
|
||||
# P1: API integration tests
|
||||
npm run test:api
|
||||
|
||||
# P1: All form tests
|
||||
npm run test:forms
|
||||
|
||||
# P1: Newsletter-specific
|
||||
npm run test:newsletter
|
||||
|
||||
# Destructive/chaos tests (nightly)
|
||||
npm run test:chaos
|
||||
|
||||
# Full CI suite (smoke + critical + API)
|
||||
npm run test:ci
|
||||
|
||||
# Everything
|
||||
npm run test
|
||||
|
||||
# View HTML report
|
||||
npm run test:report
|
||||
```
|
||||
|
||||
### CI/CD Pipeline Triggers
|
||||
| Event | Jobs Run |
|
||||
|-------|----------|
|
||||
| Every push | Smoke → Critical Paths → API Tests |
|
||||
| Pull Request | + Form Tests, Security Tests |
|
||||
| Nightly (2 AM UTC) | All jobs including Chaos, Cross-Browser, Mobile |
|
||||
| Manual trigger | Selectable suite |
|
||||
|
||||
---
|
||||
|
||||
## Test Data
|
||||
|
||||
### Contact Form Test Data
|
||||
```json
|
||||
{
|
||||
"name": "John Doe",
|
||||
"email": "john.doe@example.com",
|
||||
"phone": "+1 555-123-4567",
|
||||
"subject": "web-development",
|
||||
"message": "I am interested in building a custom web application.",
|
||||
"website": ""
|
||||
}
|
||||
```
|
||||
|
||||
### Newsletter Test Data
|
||||
```json
|
||||
{
|
||||
"email": "subscriber@example.com"
|
||||
}
|
||||
```
|
||||
|
||||
### Valid Subject Values (Contact Form)
|
||||
- `web-development`
|
||||
- `mobile-development`
|
||||
- `cloud-services`
|
||||
- `ai-ml`
|
||||
- `consulting`
|
||||
- `support`
|
||||
- `other`
|
||||
|
||||
---
|
||||
|
||||
## Key Bugs This Suite Would Catch
|
||||
|
||||
| Category | Bug Example |
|
||||
|----------|-------------|
|
||||
| **XSS** | Alert fires in name/message field |
|
||||
| **Form Bypass** | Honeypot filled but email still sent |
|
||||
| **Race Condition** | Double submit sends duplicate emails |
|
||||
| **Validation** | Short name (1 char) passes validation |
|
||||
| **Network** | App crashes on API timeout |
|
||||
| **Rate Limit** | No 429 after 5 rapid submissions |
|
||||
| **Newsletter** | Form field doesn't clear after success |
|
||||
| **Mobile** | Newsletter form clipped off-screen |
|
||||
| **API** | `/api/contact` returns 500 for SQL chars |
|
||||
| **Security** | Missing X-Frame-Options header |
|
||||
| **CORS** | API returns wrong domain in CORS header |
|
||||
|
||||
---
|
||||
|
||||
## Flakiness Prevention
|
||||
|
||||
1. **No fixed delays** — Use `waitForLoadState`, `waitForSelector`, element visibility
|
||||
2. **Stable selectors** — Prefer `name`, `id`, `data-error`, `aria-label` over CSS classes
|
||||
3. **Idempotent tests** — Each test resets state (navigate fresh, not session-dependent)
|
||||
4. **Generous timeouts** — 10s for network ops, 5s for animations
|
||||
5. **CI retries** — 2 retries configured for flaky infrastructure
|
||||
|
||||
---
|
||||
|
||||
## Browser Coverage Strategy
|
||||
|
||||
| Suite | Browsers |
|
||||
|-------|----------|
|
||||
| Smoke | Chromium only (speed) |
|
||||
| Critical Paths | Chromium + Firefox |
|
||||
| Forms | Chromium |
|
||||
| API | Chromium (headless HTTP) |
|
||||
| Chaos | Chromium |
|
||||
| Newsletter | Chromium + Mobile Chrome |
|
||||
| Nightly Regression | All 7 configurations |
|
||||
|
||||
---
|
||||
|
||||
## Files Created
|
||||
|
||||
```
|
||||
tests/
|
||||
├── pages/
|
||||
│ ├── ContactPage.ts (NEW) Page Object Model for contact form
|
||||
│ └── NavigationPage.ts (NEW) Page Object Model for navigation
|
||||
├── newsletter-subscription.spec.ts (NEW) 28 newsletter tests
|
||||
├── api-integration.spec.ts (NEW) 32 API-level tests
|
||||
├── destructive-chaos.spec.ts (NEW) 30 chaos/destructive tests
|
||||
└── ... (12 existing files unchanged)
|
||||
|
||||
.github/workflows/
|
||||
└── e2e-tests.yml (NEW) 9-job CI pipeline
|
||||
|
||||
package.json (UPDATED) New test scripts
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Changelog
|
||||
|
||||
### 2026-03-21
|
||||
- Added Page Object Models (`ContactPage.ts`, `NavigationPage.ts`)
|
||||
- Added `newsletter-subscription.spec.ts` — 28 tests
|
||||
- Added `api-integration.spec.ts` — 32 direct API tests
|
||||
- Added `destructive-chaos.spec.ts` — 30 destructive tests
|
||||
- Added `e2e-tests.yml` — 9-job GitHub Actions pipeline
|
||||
- Updated `package.json` with 8 new test scripts
|
||||
- Total suite: ~150 tests across 15 spec files
|
||||
@@ -0,0 +1,401 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user