Skip to content
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

Introduce WebkitHeadless browser testing #8491

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Introduce WebkitHeadless browser testing #8491

merged 3 commits into from
Oct 2, 2024

Conversation

dlarocque
Copy link
Contributor

Introduce WebKitHeadless browser testing, using the karma-webkit-launcher plugin. The plugin uses playwright to launch it's WebkitHeadless browser, and uses that browser to run karma tests on.

This is significantly better than the proposed solution in #8396, where we forked the old karma-safari-launcher plugin, because it uses a headless browser. This means that

  • We don't need to manually enable Full Disk Access on Safari to the host process
  • The headless browser process will exit after tests are complete
  • There are no browser popups when running the tests, since there's no head to pop up

How to run locally:

yarn install # make sure the new packages are installed
npx playwright install webkit # install playwright's webkit browser
BROWSERS='WebkitHeadless' yarn test:browser # or any other command that launches a browser for karma tests

Testing:

I ran all of the browser tests against WebkitHeadless locally, and did not encounter any unexpected failures (the flakes in firestore still occur). Everything works as expected.

When running the same tests in CI, I noticed that several packages are now flaky (seemingly only in CI?): installations, storage-compat, database, database-compat, app-check. It's not clear why these are suddenly only failing in the headless webkit browser in CI, so let's skip them for now, and add a TODO to fix this later.

@dlarocque dlarocque requested a review from a team as a code owner September 9, 2024 17:42
Copy link

changeset-bot bot commented Sep 9, 2024

⚠️ No Changeset found

Latest commit: 1f4e73d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 9, 2024

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 9, 2024

Replace Safari with WebkitHeadless in list of supported karma browsers

Install playwright browsers in CI

Set WEBKIT_HEADLESS_BIN

Update launcher version

Run firestore test changed on push

Fix

Don't use  in test-changed-firestore

Ignore failing tests
.github/workflows/test-changed-firestore.yml Outdated Show resolved Hide resolved
.github/workflows/test-all.yml Outdated Show resolved Hide resolved
@dlarocque dlarocque merged commit 1ca18c4 into main Oct 2, 2024
50 checks passed
@dlarocque dlarocque deleted the dl/webkit-testing branch October 2, 2024 16:12
@firebase firebase locked and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants