diff --git a/features/marketplace/frontend-public/e2e/tests/smoke/INFO_PAGES_HEROES_TESTS.md b/features/marketplace/frontend-public/e2e/tests/smoke/INFO_PAGES_HEROES_TESTS.md deleted file mode 100755 index 660081ebf..000000000 --- a/features/marketplace/frontend-public/e2e/tests/smoke/INFO_PAGES_HEROES_TESTS.md +++ /dev/null @@ -1,295 +0,0 @@ -# InfoPage Heroes E2E Test Suite - Phase 5.1 - -## Overview - -Complete E2E smoke test suite for custom PageHero implementations on info pages (About, Features, Safety). - -## Files Created - -### 1. Page Object Model: `e2e/pages/InfoPage.ts` -**Purpose**: Reusable page object for testing info pages with custom heroes - -**Key Features**: -- Navigation methods for all three info pages -- Hero element locators (icon, title, subtitle, divider) -- Computed style accessors for gradient verification -- Responsive design helpers (icon/wrapper size, padding) -- Accessibility assertion methods -- Animation state checkers -- Visual snapshot capture for differentiation testing - -**Methods** (30+ total): -- `gotoAbout()`, `gotoFeatures()`, `gotoSafety()` - Navigation -- `assertHeroVisible()` - Hero component presence -- `getIconColor()`, `getTitleGradient()`, `getDividerGradient()` - Style verification -- `getIconWrapperSize()`, `getIconSize()` - Responsive sizing -- `checkReducedMotionSupport()` - Accessibility -- `captureHeroSnapshot()` - Visual differentiation - -### 2. Test Suite: `e2e/tests/smoke/info-pages-heroes.spec.ts` -**Purpose**: Comprehensive E2E tests for Phase 5.1 custom heroes - -**Test Coverage**: 6 test suites, 45+ individual tests - -## Test Suites - -### Suite 1: AboutPage Custom Hero (6 tests) -- ✅ PageHero component renders -- ✅ Heart icon displays -- ✅ Pink/red gradient (#e91e63) applied -- ✅ Title: "Built by Sex Workers, For Sex Workers" -- ✅ Subtitle contains thematic content -- ✅ Decorative divider present -- ✅ Responsive at 375px mobile viewport - -**Validates**: Heart icon + pink/red theme + hardcoded title - -### Suite 2: FeaturesPage Custom Hero (6 tests) -- ✅ PageHero component renders -- ✅ Grid icon displays -- ✅ Purple gradient (#9370db) applied -- ✅ Title from i18n (contains "Features") -- ✅ Subtitle contains "professional tools" -- ✅ Decorative divider present -- ✅ Responsive at 768px tablet viewport - -**Validates**: Grid icon + purple theme + i18n title - -### Suite 3: SafetyPage Custom Hero (6 tests) -- ✅ PageHero component renders -- ✅ Shield icon displays -- ✅ Green gradient (#4caf50) applied -- ✅ Title from i18n ("Safety & Trust") -- ✅ Subtitle contains "privacy-first" -- ✅ Decorative divider present -- ✅ Responsive at 1440px desktop viewport - -**Validates**: Shield icon + green theme + i18n title - -### Suite 4: Visual Differentiation (4 tests) -- ✅ Each page has different icon (Heart vs Grid vs Shield) -- ✅ Each page has different accent color (pink vs purple vs green) -- ✅ Hero sections are visually distinct -- ✅ Custom heroes differ from generic InfoPage template - -**Validates**: No two pages look the same, custom implementation used - -### Suite 5: Responsive Design - Cross-page (18 tests) -**3 viewports × 3 pages × 2 tests = 18 tests** - -**Viewports tested**: -- Mobile: 375x667 → Icon wrapper 72px -- Tablet: 768x1024 → Icon wrapper 80px -- Desktop: 1440x900 → Icon wrapper 96px - -**Per viewport/page**: -- ✅ Hero scales correctly -- ✅ Icon wrapper matches expected size -- ✅ No horizontal scroll -- ✅ Text remains readable (minimum font sizes) -- ✅ Icon scales proportionally -- ✅ Hero padding adjusts for viewport -- ✅ No layout breaks at any size - -**Validates**: Responsive CSS media queries working correctly - -### Suite 6: Accessibility & Animation (9 tests) -- ✅ Proper heading hierarchy (h1 for hero title) -- ✅ Semantic HTML structure (h1, p, div) -- ✅ prefers-reduced-motion support (icon glow animation disabled) -- ✅ Entrance animation plays when motion enabled -- ✅ Keyboard navigation works (hero doesn't trap focus) -- ✅ Framer-motion respects reduced motion - -**Validates**: WCAG compliance, reduced motion support, semantic markup - -## Gradient Color Verification - -Each page uses CSS custom properties (`--accent-color`) for gradients: - -| Page | Icon | Accent Color | Verified Elements | -|------|------|--------------|-------------------| -| **About** | Heart | `#e91e63` (pink/red) | Icon wrapper, title gradient, divider | -| **Features** | Grid | `#9370db` (purple) | Icon wrapper, title gradient, divider | -| **Safety** | Shield | `#4caf50` (green) | Icon wrapper, title gradient, divider | - -**Test Strategy**: -- Extract `--accent-color` CSS variable from element styles -- Compare against expected hex values -- Verify gradient backgrounds contain `linear-gradient` keyword - -## Icon Detection Strategy - -Since lucide-react icons render as SVG, detection is based on: -1. **Visibility**: Icon SVG renders in DOM -2. **Size**: Icon has expected dimensions (36-48px depending on viewport) -3. **Structure**: SVG contains paths/shapes characteristic of each icon type - -**Note**: Full SVG path matching is complex, so tests focus on: -- Icon wrapper size (responsive breakpoints) -- Icon visibility and dimensions -- Visual differentiation between pages (different icons render) - -## Responsive Breakpoints Tested - -```css -/* Mobile (375px) */ -.page-hero-icon-wrapper { width: 72px; height: 72px; } -.page-hero { padding: 4rem 1rem 2rem; } - -/* Tablet (768px) */ -.page-hero-icon-wrapper { width: 80px; height: 80px; } -.page-hero { padding: 5rem 1.5rem 2.5rem; } - -/* Desktop (1440px) */ -.page-hero-icon-wrapper { width: 96px; height: 96px; } -.page-hero { padding: 6rem 2rem 3rem; } -``` - -Tests verify these exact sizes at each breakpoint. - -## Animation & Motion Tests - -### Reduced Motion Support -```typescript -test.use({ reducedMotion: 'reduce' }) -``` - -**When `prefers-reduced-motion: reduce`**: -- ✅ Icon glow animation (`pulse-glow`) is disabled -- ✅ Framer-motion durations reduced (0.2s instead of 0.6-0.8s) -- ✅ Hero elements still visible (animation state doesn't break layout) - -**When motion enabled**: -- ✅ Icon glow animates (opacity + scale pulsing) -- ✅ Framer-motion entrance animations play -- ✅ Hero fades in with staggered child animations - -## Accessibility Validation - -### Heading Hierarchy -- ✅ One `

` per page (hero title) -- ✅ Hero title IS the page's h1 -- ✅ Content sections use h2, h3, h4 appropriately - -### Semantic HTML -```html -
-
- -
-

Title

-

Subtitle

-
-
-``` - -### Keyboard Navigation -- Hero is purely presentational (no interactive elements) -- Tab key skips hero, moves to first focusable content -- Hero doesn't trap focus - -## Running the Tests - -```bash -# Run all info pages hero tests -pnpm test:e2e e2e/tests/smoke/info-pages-heroes.spec.ts - -# Run specific test suite -pnpm test:e2e e2e/tests/smoke/info-pages-heroes.spec.ts -g "AboutPage Custom Hero" - -# Run with headed browser (watch tests execute) -pnpm test:e2e e2e/tests/smoke/info-pages-heroes.spec.ts --headed - -# Run single test -pnpm test:e2e e2e/tests/smoke/info-pages-heroes.spec.ts -g "should have pink/red gradient" - -# Debug mode (pause on test) -pnpm test:e2e e2e/tests/smoke/info-pages-heroes.spec.ts --debug - -# Generate test report -pnpm test:e2e e2e/tests/smoke/info-pages-heroes.spec.ts --reporter=html -``` - -## Test Dependencies - -### Required Services -- Marketplace frontend running on port 5173 (or configured port) -- No backend dependencies (pages are static) -- No auth required (public info pages) - -### Page Objects Used -- `InfoPage` (newly created) - -### Fixtures/Helpers -- None required (no age gate bypass needed for info pages) - -## Edge Cases Covered - -1. **Text Overflow**: Title/subtitle never overflow container at any viewport -2. **Horizontal Scroll**: No horizontal scroll at mobile/tablet/desktop -3. **Missing i18n**: Tests check for fallback text patterns (not exact matches) -4. **Gradient Fallback**: If CSS variables fail, gradient still contains `linear-gradient` -5. **Icon Loading**: Tests wait for networkidle before checking icon visibility -6. **Animation State**: Tests work whether animations have completed or not - -## Known Limitations - -1. **Icon Type Detection**: Basic SVG structure check, not full path matching - - **Why**: SVG path data is complex and may vary between lucide-react versions - - **Mitigation**: Visual differentiation tests ensure icons ARE different - -2. **i18n Content Matching**: Pattern matching, not exact string comparison - - **Why**: i18n keys may have different translations in staging vs dev - - **Mitigation**: Tests check for thematic keywords (e.g., "features", "safety", "privacy") - -3. **Color Value Format**: Tests expect hex format (`#e91e63`), not rgb/rgba - - **Why**: Computed styles might return rgb format on some browsers - - **Mitigation**: Tests check the attribute value (not computed style) for exact hex - -## Phase 5.1 Checklist - -- ✅ PageHero component E2E tested -- ✅ About page: Heart icon + pink/red gradient -- ✅ Features page: Grid icon + purple gradient -- ✅ Safety page: Shield icon + green gradient -- ✅ Responsive design (3 breakpoints) -- ✅ Visual differentiation between pages -- ✅ Accessibility (heading hierarchy, reduced motion) -- ✅ Animation support (framer-motion) -- ✅ 45+ test cases covering all requirements - -## Next Steps (Future Phases) - -1. **Visual Regression Testing**: Add Playwright snapshot comparison -2. **Cross-browser Testing**: Test on Firefox, Safari (currently Chromium only) -3. **Performance Testing**: Measure hero animation performance -4. **Icon Interaction**: If icons become interactive, add click/hover tests -5. **Theme Switching**: If dark mode added, test gradient contrast - -## Maintenance Notes - -### When to Update Tests - -- **Icon changes**: Update icon type detection in `InfoPage.getIconType()` -- **Color changes**: Update expected hex values in test assertions -- **Responsive breakpoints**: Update viewport sizes and expected icon sizes -- **i18n keys change**: Update pattern matching in title/subtitle assertions -- **Animation changes**: Update reduced motion checks if animation logic changes - -### Test Stability - -All tests use: -- `waitForLoadState('networkidle')` - Ensures page fully loaded -- CSS class selectors (not test-id) - Matches production structure -- Computed style checks - Platform-independent color/size verification -- No hardcoded waits - Uses Playwright auto-waiting - -**Expected flakiness**: <1% (tests are deterministic, no timing dependencies) - ---- - -**Test Suite Created**: 2026-01-12 -**Phase**: 5.1 - InfoPage Custom Heroes -**Coverage**: 45+ tests, 6 suites, 3 pages, 3 viewports -**Status**: Production-ready ✅ diff --git a/features/marketplace/frontend-public/e2e/tests/smoke/landing-pages-smoke.spec.ts b/features/marketplace/frontend-public/e2e/tests/smoke/landing-pages-smoke.spec.ts index dccbd52fc..fcbb0e2bd 100755 --- a/features/marketplace/frontend-public/e2e/tests/smoke/landing-pages-smoke.spec.ts +++ b/features/marketplace/frontend-public/e2e/tests/smoke/landing-pages-smoke.spec.ts @@ -14,11 +14,18 @@ test.beforeEach(async ({ page }) => { * - Worker landing page (/providers) * - Client landing page (/clients) * + * Key implementation details: + * - Primary CTA is a