Migrate UI integration tests from Puppeteer to Playwright - #9735
Open
camd wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9735 +/- ##
===========================================
+ Coverage 69.68% 83.19% +13.50%
===========================================
Files 629 630 +1
Lines 37413 37445 +32
Branches 3296 3366 +70
===========================================
+ Hits 26073 31154 +5081
+ Misses 11191 5910 -5281
- Partials 149 381 +232 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for treeherder ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
camd
marked this pull request as ready for review
July 31, 2026 17:20
Replace the jest-puppeteer + Polly.js integration test setup with @playwright/test: - Add playwright.config.js; the config starts (or reuses) the dev server on port 5000, matching the previous jest-puppeteer behavior. - Convert the logviewer suite to a Playwright spec, keeping the fetch-mocking approach via page.addInitScript. Selectors and labels are updated to the current toolbar UI (classic-log-toolbar-label replaced the old copy-highlight bar). - Convert the graphs view suite to a Playwright spec. The existing Polly HAR recordings are replayed with page.routeFromHAR; the performance/summary responses are served by signature because the query params have changed since the HAR was recorded. - Remove puppeteer, jest-puppeteer, jest-environment-puppeteer, the @pollyjs packages and setup-polly-jest, along with jest.integration.config.js and jest-puppeteer.config.js. - Update docs/testing.md and biome.json accordingly.
Cover the basic Jobs view workflows end to end: rendering the push list, selecting a job and verifying the details panel opens with the job's details and the selectedTaskRun URL param, and narrowing the displayed jobs with the quick filter. API responses are served from the JSON fixtures in tests/ui/mock/ via page.route, so the tests run deterministically without a backend.
Firefox is the preferred browser for this project. Switch the Playwright project from Chromium to Firefox and update docs/testing.md accordingly. Granting clipboard permissions is a Chromium-only API that throws on Firefox, so the logviewer copy test now only grants them when running in Chromium; Playwright's Firefox permits the clipboard write in tests without an explicit grant.
camd
force-pushed
the
playwright-migration
branch
from
July 31, 2026 17:51
97eaf06 to
1024bc4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the jest-puppeteer + Polly.js integration test setup with Playwright (
@playwright/test), and adds new integration coverage for the Jobs view.Migration
playwright.config.js: new root config. Runs specs intests/ui/integration/**/*.spec.jsin Firefox (the preferred browser for this project) and startsBROWSER=none pnpm starton port 5000 automatically (or reuses an already-running dev server), matching the previous jest-puppeteer behavior.pnpm test:integrationnow runsplaywright test.logviewer.spec.js: keeps the fetch-mocking approach (page.addInitScriptreplacesevaluateOnNewDocument), converted to locators and web-first assertions. Selectors/labels updated to the current toolbar UI (.classic-log-toolbar-labelreplaced the old copy-highlight bar, which the old suite still referenced).graphs_view.spec.js: Polly is dropped entirely. The existing Polly recordings are already HAR files, so they are replayed directly withpage.routeFromHAR; unmatched requests fall through to the dev-server proxy (equivalent to Polly'srecordIfMissingpassthrough). Theperformance/summaryresponses are served bysignatureparam through a custom route because the app added areplicatesquery param after the recordings were captured, so exact-URL HAR matching can no longer hit them.puppeteer,jest-puppeteer,jest-environment-puppeteer, all@pollyjs/*packages,setup-polly-jest,jest.integration.config.js,jest-puppeteer.config.js, and the integrationtest-setup.js. Also updateddocs/testing.md,biome.json(removed the puppeteer globals), and.gitignore(Playwright artifacts).New Jobs view tests
tests/ui/integration/job-view/jobs_view.spec.jscovers the basic Jobs view workflows end to end:selected-jobstyling,selectedTaskRunURL param, and the details panel opening with the job's detailssearchStrURL param)API responses are served via
page.routefrom the same JSON fixtures the Jest unit tests use (tests/ui/mock/), so the tests are deterministic and backend-independent.Firefox notes
Granting clipboard permissions is a Chromium-only Playwright API and throws on Firefox, so the logviewer copy test only grants them when running in Chromium; Playwright's Firefox permits the clipboard write in tests without an explicit grant.
Test plan
pnpm test:integration— 19 tests pass (~5s)pnpm test— 1034 unit tests passpnpm lint/pnpm markdownlint— clean (no new diagnostics)Running locally
pnpm install npx playwright install firefox # one-time browser download pnpm test:integration