feat(testing): run generated playwright e2e against the dev server locally and a production build in CI - #37121
Open
FrozenPandaz wants to merge 8 commits into
Open
FrozenPandaz wants to merge 8 commits into
FrozenPandaz wants to merge 8 commits into
Conversation
Contributor
|
View your CI Pipeline Execution ↗ for commit 1da22c4
☁️ Nx Cloud last updated this comment at |
FrozenPandaz
added this pull request to stack #37120
September 19, 2026 15:51
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 19, 2026 15:54
5a8400f to
7c9db15
Compare
FrozenPandaz
added a commit
that referenced
this pull request
Sep 19, 2026
newProject moved the built workspace to the backup and copied it back out, then ran a second pnpm install to repair the links that copy had just broken. Copy to the backup and rename the original into place instead: the first project is then the workspace pnpm built, whose links were never broken, so the repair install is only needed for later suites that do copy from the backup. Same number of full copies as before -- the move and the copy swap places. The saving is the reinstall, which was ~12s locally. Idea from Jason via a parallel session investigating newProject overhead (#37121).
FrozenPandaz
added a commit
that referenced
this pull request
Sep 19, 2026
newProject moved the built workspace to the backup and copied it back out, then ran a second pnpm install to repair the links that copy had just broken. Copy to the backup and rename the original into place instead: the first project is then the workspace pnpm built, whose links were never broken, so the repair install is only needed for later suites that do copy from the backup. Same number of full copies as before -- the move and the copy swap places. The saving is the reinstall, which was ~12s locally. Idea from Jason via a parallel session investigating newProject overhead (#37121).
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 19, 2026 17:24
b2a582b to
d803b8c
Compare
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
2 times, most recently
from
September 19, 2026 17:46
81253e8 to
4f483ae
Compare
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 19, 2026 21:24
4f483ae to
c5e2597
Compare
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 20, 2026 04:50
566e8cb to
59bbfc6
Compare
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
2 times, most recently
from
September 20, 2026 05:00
404a048 to
3b81979
Compare
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 21, 2026 05:28
7565530 to
3b81979
Compare
FrozenPandaz
marked this pull request as ready for review
September 21, 2026 05:38
leosvelperez
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 21, 2026 11:45
2aa137a to
d261c79
Compare
leosvelperez
force-pushed
the
feat/playwright-dev-server-locally
branch
2 times, most recently
from
September 21, 2026 14:59
dd80560 to
a2694f5
Compare
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
2 times, most recently
from
September 21, 2026 18:36
2e40cd8 to
59ff712
Compare
Base automatically changed from
fix/skip-nx-console-check-without-tty
to
master
September 21, 2026 21:58
…b server Add ciWebServerCommand and ciWebServerAddress. When they differ from the local web server, the generated playwright.config.mts picks them when `CI` is set, so a project can run e2e against the dev server locally and a production build in CI. Without them the config is generated as before.
…pp generators Application generators passed only one web server to Playwright, so React, Vue, Web, Expo, Nuxt and Remix apps always ran e2e against serve-static, even locally. Pass the dev server as the web server and the production server as the CI web server, matching Cypress.
… in ci When the CI and local addresses match, keep the url as a plain string instead of a ternary with identical branches.
Switching Angular apps to a production build in CI makes their e2e depend on the build passing its budgets, which the rspack module federation host does not. Keep Angular's previous behavior until that is fixed.
FrozenPandaz
force-pushed
the
feat/playwright-dev-server-locally
branch
from
September 21, 2026 21:58
09e5038 to
1da22c4
Compare
Contributor
There was a problem hiding this comment.
Nx Cloud has identified a possible root cause for your failed CI:
We confirmed this failure is pre-existing: the same test fails with the identical expected/received values on master, unrelated to this PR's changes. Since the bug predates this PR, we're not fixing it here — it belongs in its own dedicated PR.
No code changes were suggested for this issue.
Trigger a rerun:
🎓 Learn more about Self-Healing CI on nx.dev
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.
Current Behavior
Generated e2e projects pick their web server differently per runner:
nx e2elocallynx e2ein CInx e2e-ciserve-staticserve-staticserve-staticserve-staticThe Playwright config has a single
webServer.command, so each generator has to choose one server for every context. React, Vue, Web, Expo, Nuxt and Remix pass the production server there, so local e2e never runs against the dev server — you rebuild on every change. Next and Angular pass the dev server, so they never exercise a production build in CI.Expected Behavior
The generated Playwright config decides based on the
CIenvironment variable: the dev server locally, the production build in CI. The plugin already evaluates the config, so the inferred serve dependency follows automatically.nx e2elocallynx e2ein CInx e2e-ciserve-staticserve-staticserve-static@nx/playwright:configurationacceptsciWebServerCommandandciWebServerAddress. When they differ from the local server the config switches onCI; when they match, it is generated exactly as before.serve-staticrun in CI fails the build.CIswitch.Only newly generated projects change; existing configs keep working as they are.
Why Playwright only
Cypress does not have this problem. The Cypress plugin already derives the atomized
e2e-ci--*targets fromciWebServerCommand, so it can express both servers without consulting the environment:nx e2euses the dev server,e2e-ci--*uses the production build, and CI runs the latter. Playwright needed theCIswitch because its singlewebServerblock is the only place to express the difference.An earlier revision of this PR applied the same switch to
webServerCommands.defaultin the generatedcypress.config. That regressed the Angular Module Federation e2e suites: in CI the plaine2etarget startedserve-static, which serves only the host's built files, so the host could never fetch its remote'sremoteEntryand the remote's markup never rendered. Those commits were moved to a separate branch and will be reconsidered on their own.Related Issue(s)
N/A
View Polygraph session ↗