-
Notifications
You must be signed in to change notification settings - Fork 159
Add Safari E2E tests to CI #3361
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
a76fa23 to
eedbe6c
Compare
eedbe6c to
0340c0f
Compare
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 adds Safari E2E test support to the CI pipeline by implementing a multi-browser test matrix and creating custom Playwright fixtures to handle Safari's limitations.
- Added Safari (webkit) browser support alongside Chrome for both desktop and mobile configurations
- Implemented custom Playwright fixtures with host routing to work around Safari's lack of support for
--host-resolver-rules - Enhanced CSP configuration to support development environments with localhost subdomains
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/canister-tests.yml |
Updated CI matrix to include Safari browser testing and conditional browser installation |
playwright.config.ts |
Added Safari desktop and mobile projects with browser-specific configurations |
src/frontend/tests/e2e-playwright/fixtures.ts |
New custom fixture implementing host routing for Safari compatibility |
src/frontend/tests/e2e-playwright/**/*.spec.ts |
Updated all test files to use custom fixtures instead of direct Playwright imports |
eslint.config.js |
Added ESLint rule to enforce using custom fixtures in E2E tests |
src/internet_identity/src/http.rs |
Enhanced CSP headers to support localhost subdomains in development |
HACKING.md |
Added documentation for writing new E2E tests with custom fixtures |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -1,4 +1,5 @@ | |||
| import { expect, Page, test } from "@playwright/test"; | |||
| import { expect, test } from "../fixtures"; | |||
| import { Page } from "@playwright/test"; | |||
Copilot
AI
Oct 6, 2025
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.
[nitpick] The Page type import from @playwright/test could be consolidated with the other imports or moved to a types-only import to improve organization.
| import { Page } from "@playwright/test"; | |
| import type { Page } from "@playwright/test"; |
Motivation
Improve the reliability of the test coverage by adding Safari as a supported browser.
Changes
.github/workflows/canister-tests.ymlto run tests on both Chrome and Safari, for both desktop and mobile, and adjusted artifact naming to include the browser. Playwright browser installation is now conditional based on the matrix browser. Test execution now uses browser-specific project names.playwright.config.tsto define separate projects forchrome-desktop,chrome-mobile,safari-desktop, andsafari-mobile, and enabledignoreHTTPSErrorsto support self-signed certificates during tests.fixtures.tsthat implements host resolution routing for Safari, ensuring all non-localhost requests are redirected correctly during tests. This fixture is now used in all test files.testandexpectfrom the newfixtures.tsinstead of@playwright/test, ensuring consistent use of the custom fixture across the suite.webkit) in bothauthorize/migration.spec.tsanddashboard/migration.spec.tsbecause virtual authenticators are not supported in that browser.Tests
Only test changes.