Testing Framework 2 #18

Merged
an.di merged 9 commits from adilallo/enhancement/TestingFramework3 into main 2025-09-04 15:13:12 +00:00
Owner

🔧 Fix Visual Regression Tests & Reorganize Accessibility Testing

What Changed

Fixed Visual Regression Test Failures

  • Fixed Playwright configuration issue where visual regression tests couldn't find snapshot files
  • Updated snapshotPathTemplate to use hardcoded tests/e2e/ path after changing testDir to tests/
  • All 92 visual regression tests now passing across Chromium, Firefox, WebKit, and Mobile

Reorganized Accessibility Testing Structure

  • Moved accessibility tests to dedicated tests/accessibility/ folder structure:
    • tests/accessibility/unit/components.test.jsx (from tests/unit/accessibility.test.jsx)
    • tests/accessibility/e2e/wcag-compliance.spec.ts (from tests/e2e/accessibility.spec.ts)
  • Updated vitest.config.mjs to include new accessibility unit test path
  • Updated playwright.config.ts to discover tests in both tests/e2e/ and tests/accessibility/ directories
  • Fixed relative import paths in moved test files

Enhanced Unit Testing Coverage

  • Added comprehensive unit tests for multiple components:
    • Button.test.jsx - 12 tests covering rendering, interactions, and accessibility
    • Logo.test.jsx - 12 tests covering logo variants and responsive behavior
    • RuleCard.test.jsx - 18 tests covering card states and interactions
    • SectionHeader.test.jsx - 17 tests covering header variations
    • NumberedCard.test.jsx - 18 tests covering card functionality
    • LogoWall.test.jsx - 6 tests covering logo wall display
    • Page.test.jsx - 6 tests covering page structure
    • QuoteBlock.test.jsx - 6 tests covering quote display
    • RuleCard.test.jsx - 8 tests covering rule card behavior
    • RuleStack.test.jsx - 7 tests covering rule stack functionality
    • SectionHeader.test.jsx - 8 tests covering section header variants
  • Unit test coverage increased to 94.88% (exceeds 85% target)

Updated Documentation

  • Updated docs/testing-framework.md and docs/testing-quick-reference.md to reflect new accessibility folder structure
  • Added accessibility testing commands and folder organization details

Why This Was Needed

  1. Visual Regression Tests: Were failing due to snapshot path mismatch after Playwright config changes
  2. Accessibility Tests: Needed better organization and discoverability in dedicated folder structure
  3. Test Discovery: Playwright needed to find tests in both E2E and accessibility subdirectories
  4. Unit Test Coverage: Needed to meet CR-26 ticket requirements for comprehensive component testing
# 🔧 Fix Visual Regression Tests & Reorganize Accessibility Testing ## What Changed ### Fixed Visual Regression Test Failures - Fixed Playwright configuration issue where visual regression tests couldn't find snapshot files - Updated `snapshotPathTemplate` to use hardcoded `tests/e2e/` path after changing `testDir` to `tests/` - All 92 visual regression tests now passing across Chromium, Firefox, WebKit, and Mobile ### Reorganized Accessibility Testing Structure - Moved accessibility tests to dedicated `tests/accessibility/` folder structure: - `tests/accessibility/unit/components.test.jsx` (from `tests/unit/accessibility.test.jsx`) - `tests/accessibility/e2e/wcag-compliance.spec.ts` (from `tests/e2e/accessibility.spec.ts`) - Updated `vitest.config.mjs` to include new accessibility unit test path - Updated `playwright.config.ts` to discover tests in both `tests/e2e/` and `tests/accessibility/` directories - Fixed relative import paths in moved test files ### Enhanced Unit Testing Coverage - Added comprehensive unit tests for multiple components: - `Button.test.jsx` - 12 tests covering rendering, interactions, and accessibility - `Logo.test.jsx` - 12 tests covering logo variants and responsive behavior - `RuleCard.test.jsx` - 18 tests covering card states and interactions - `SectionHeader.test.jsx` - 17 tests covering header variations - `NumberedCard.test.jsx` - 18 tests covering card functionality - `LogoWall.test.jsx` - 6 tests covering logo wall display - `Page.test.jsx` - 6 tests covering page structure - `QuoteBlock.test.jsx` - 6 tests covering quote display - `RuleCard.test.jsx` - 8 tests covering rule card behavior - `RuleStack.test.jsx` - 7 tests covering rule stack functionality - `SectionHeader.test.jsx` - 8 tests covering section header variants - **Unit test coverage increased to 94.88%** (exceeds 85% target) ### Updated Documentation - Updated `docs/testing-framework.md` and `docs/testing-quick-reference.md` to reflect new accessibility folder structure - Added accessibility testing commands and folder organization details ## Why This Was Needed 1. **Visual Regression Tests**: Were failing due to snapshot path mismatch after Playwright config changes 2. **Accessibility Tests**: Needed better organization and discoverability in dedicated folder structure 3. **Test Discovery**: Playwright needed to find tests in both E2E and accessibility subdirectories 4. **Unit Test Coverage**: Needed to meet CR-26 ticket requirements for comprehensive component testing
an.di added 1 commit 2025-09-03 19:29:55 +00:00
Fix visual regression tests
CI Pipeline / test (20) (pull_request) Successful in 2m17s
CI Pipeline / e2e (chromium) (pull_request) Successful in 1m53s
CI Pipeline / test (18) (pull_request) Successful in 5m10s
CI Pipeline / e2e (firefox) (pull_request) Successful in 2m22s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m17s
CI Pipeline / visual-regression (pull_request) Failing after 4m18s
CI Pipeline / seed-vr-snapshots (pull_request) Has been skipped
CI Pipeline / performance (pull_request) Successful in 3m13s
CI Pipeline / storybook (pull_request) Successful in 1m33s
CI Pipeline / lint (pull_request) Failing after 1m20s
CI Pipeline / build (pull_request) Successful in 1m23s
d84abf5aa7
an.di added 3 commits 2025-09-03 20:03:26 +00:00
Remove seed vr snapshots
CI Pipeline / test (20) (pull_request) Successful in 7m13s
CI Pipeline / test (18) (pull_request) Successful in 7m19s
CI Pipeline / e2e (chromium) (pull_request) Successful in 2m46s
CI Pipeline / e2e (firefox) (pull_request) Successful in 3m43s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m22s
CI Pipeline / visual-regression (pull_request) Successful in 4m53s
CI Pipeline / performance (pull_request) Successful in 3m47s
CI Pipeline / storybook (pull_request) Successful in 1m33s
CI Pipeline / lint (pull_request) Failing after 1m0s
CI Pipeline / build (pull_request) Successful in 1m23s
3f1327b116
an.di added 3 commits 2025-09-03 20:51:16 +00:00
Run lint and prettier
CI Pipeline / test (20) (pull_request) Successful in 7m32s
CI Pipeline / test (18) (pull_request) Successful in 7m34s
CI Pipeline / e2e (chromium) (pull_request) Successful in 3m13s
CI Pipeline / e2e (firefox) (pull_request) Successful in 3m46s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m57s
CI Pipeline / performance (pull_request) Successful in 3m41s
CI Pipeline / visual-regression (pull_request) Failing after 8m6s
CI Pipeline / storybook (pull_request) Successful in 1m31s
CI Pipeline / lint (pull_request) Successful in 1m6s
CI Pipeline / build (pull_request) Successful in 1m24s
b265aace57
an.di added 1 commit 2025-09-03 21:27:52 +00:00
Update visual regression snapshot path
CI Pipeline / test (20) (pull_request) Successful in 6m3s
CI Pipeline / test (18) (pull_request) Successful in 7m34s
CI Pipeline / e2e (chromium) (pull_request) Successful in 1m56s
CI Pipeline / e2e (firefox) (pull_request) Successful in 2m54s
CI Pipeline / e2e (webkit) (pull_request) Successful in 4m39s
CI Pipeline / visual-regression (pull_request) Successful in 4m10s
CI Pipeline / storybook (pull_request) Successful in 1m28s
CI Pipeline / performance (pull_request) Successful in 3m29s
CI Pipeline / lint (pull_request) Successful in 1m2s
CI Pipeline / build (pull_request) Successful in 1m26s
bf706de68e
an.di changed title from Fix visual regression tests to Testing Framework 2 2025-09-04 13:59:29 +00:00
an.di added 1 commit 2025-09-04 14:02:43 +00:00
Run tests only on PRs
CI Pipeline / test (18) (pull_request) Successful in 4m57s
CI Pipeline / e2e (chromium) (pull_request) Successful in 1m50s
CI Pipeline / test (20) (pull_request) Successful in 7m20s
CI Pipeline / e2e (firefox) (pull_request) Successful in 2m25s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m33s
CI Pipeline / visual-regression (pull_request) Successful in 3m54s
CI Pipeline / performance (pull_request) Successful in 3m3s
CI Pipeline / storybook (pull_request) Successful in 1m20s
CI Pipeline / lint (pull_request) Successful in 1m1s
CI Pipeline / build (pull_request) Successful in 1m17s
3e42fe86a4
an.di merged commit 0ee9725f3f into main 2025-09-04 15:13:12 +00:00
an.di deleted branch adilallo/enhancement/TestingFramework3 2025-09-04 15:16:10 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CommunityRule/community-rule#18