Repository navigation
Preinstall @playwright/test in browser images at the pinned engine version - #468
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
sjmiller609
approved these changes
Oct 15, 2026
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.
Problem
Playwright execution code can't use
@playwright/testassertions today:So scripts that use
expect(page.locator(...)).toHaveText(...),toBeVisible(), orexpect.poll(...)have to vendor their own copy ofexpecton every run.There was also no pin on the executor's engine: both Dockerfiles installed the global Playwright packages unversioned (
npm install -g typescript playwright-core patchright esbuild), so the daemon's engine moved whenever npm published and the image happened to rebuild, decoupled fromserver/runtime/package.json. Draft #408 pins that install to the runtime lockfile; this PR supersedes it, because landing it as-is would pin the daemon to the lockfile's 1.62.x while the change below needs 1.64.1.Change
patchrightandplaywright-coreinserver/runtime/package.json(and the lockfile) from 1.62.x to 1.64.1, so the Browser REPL and the daemon run the same engine.chromium-headfulandchromium-headlessDockerfiles, read thepatchright/playwright-coreversions fromserver/runtime/package.jsonat build time and install the global packages at those pins, plus@playwright/testat theplaywright-corepin (@playwright/testreleases in lockstep withplaywright-core). One source of truth, one place to bump, no drift on rebuild.typescriptandesbuildstay unpinned — build tooling, not the browser engine.@playwright/testfrom the daemon file at/usr/local/lib/playwright-daemon.js, which finds the global install in/usr/local/lib/node_modules— no daemon change needed.TestPlaywrightExecuteAPIcovering the three reported use cases:toHaveText,toBeVisible, andexpect.poll.This is intentionally the explicit import, not an ambient
expectglobal added to the execution scope.Caveats
test()fixtures) still don't make sense inside an execute call. Locator assertions andexpect.pollwork.@playwright/testadds about 5 MB unpacked to the image and doesn't download another browser.Testing
docker build --checkclean on both Dockerfiles.server/runtime/package.json: resolvespatchright@1.64.1,playwright-core@1.64.1,@playwright/test@1.64.1.npm ci+tsc --noEmit+node --test runtime/*.test.ts(43/43).go vet ./e2e/passes. The new e2e block runs in CI, which builds both images and runsmake test-e2e; it was not run against a locally built image here.patchright@1.64.1/playwright-core@1.64.1/@playwright/test@1.64.1in the global-install layout, connected Patchright over CDP to Chromium, and rantoHaveText,toBeVisible, andexpect.pollagainst a Patchright page — all pass.