-
Notifications
You must be signed in to change notification settings - Fork 21
chore(tests): visual regression tests for post-header
#6826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces comprehensive visual regression testing for the post-header component using Playwright. The implementation adds test infrastructure, helper utilities, and HTML fixtures for testing 7 header variants (portal, microsite, jobs, and onepager - each with logged-in/out states) across 3 breakpoints (desktop, tablet, mobile) and 3 browsers (Chromium, Firefox, WebKit).
Key changes:
- Adds Playwright test framework with configuration for visual regression testing
- Creates reusable test helpers for interacting with header components (megadropdowns, language menus, user menus, burger menus)
- Implements consolidated test suite that efficiently tests shared features once while testing variant-specific features separately
- Sets up GitHub Actions workflow with snapshot caching and optimization
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
packages/components/playwright.config.ts |
Playwright configuration with test directories, screenshot settings, and multi-browser setup |
packages/components/visual-tests/post-header.consolidated.spec.ts |
Main test suite implementing comprehensive visual regression tests for all header variants |
packages/components/visual-tests/helpers/header-test-helpers.ts |
Reusable helper functions for interacting with header components (hover, focus, open/close actions) |
packages/components/visual-tests/helpers/header-variants.config.ts |
Configuration defining feature sets for each header variant to enable selective testing |
packages/components/visual-tests/components/*.html |
HTML test fixtures for 7 header variants (onepager, microsite logged-in/out, jobs logged-in/out, portal logged-in/out) |
packages/components/package.json |
Adds test:visual scripts and Playwright/http-server dependencies |
packages/components/tsconfig.json |
Includes Playwright types and visual-tests directory in compilation |
packages/components/tsconfig.eslint.json |
Extends ESLint configuration to include visual test files |
packages/components/stencil.config.ts |
Excludes visual-tests from Jest coverage |
packages/components/.gitignore |
Ignores test results and generated screenshot artifacts |
package.json |
Adds convenience scripts at root level for running visual tests |
.github/workflows/visual-tests.yaml |
GitHub Actions workflow for automated visual regression testing with caching |
pnpm-lock.yaml |
Updates lock file with Playwright and http-server dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
packages/components/visual-tests/components/post-header-jobs-loggedout.html
Outdated
Show resolved
Hide resolved
packages/components/visual-tests/components/post-header-portal-loggedin.html
Show resolved
Hide resolved
packages/components/visual-tests/components/post-header-jobs-loggedin.html
Outdated
Show resolved
Hide resolved
packages/components/visual-tests/components/post-header-portal-loggedout.html
Show resolved
Hide resolved
packages/components/visual-tests/helpers/header-test-helpers.ts
Outdated
Show resolved
Hide resolved
…oggedout.html Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…oggedin.html Co-authored-by: Copilot <[email protected]>
…wisspost/design-system into visual-regression-tests-header
|




📄 Description
Please include a summary of the changes made in this PR.
🚀 Demo
If applicable, please add a screenshot or video to illustrate the changes.
🔮 Design review
📝 Checklist