mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 17:36:15 -08:00
fix(e2e): let web-e2e:e2e run outside CI
Without CI, every web-e2e webServer has reuseExistingServer, so @nx/playwright infers a continuous web:serve dependency for the `pnpm nx run web:serve` entry. The mocks and the web backend launch as plain node processes with env, which no Nx task covers, so the plugin also marks the target non-parallel. Nx refuses a non-parallel task with continuous dependencies, and `nx run web-e2e:e2e` failed before running anything; CI passed only because CI=1 disables reuse and with it the inferred dependency. Give web-e2e:e2e an empty dependsOn so Playwright starts every server, as it already does in CI. The Angular dev-server runs inside the Nx process, so Playwright's process-group kill still stops it. Turn off the plugin's readiness gate, which no target consumes any more. Add `pnpm run e2e:task-graphs:validate`: it builds every Playwright target's task graph with Nx's own validation, with CI unset and set, and runs in the unit-and-typecheck job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
525ca7bc44
commit
3f3e9ffefb
9 files changed
+260
-16
No files matched your search
@@ -87,8 +87,10 @@ launches the backend through Nx or its `env` drifts from the `serve` target.
|
||||
`self-hosted.e2e.ts` URLs, like `MOCK_PORT` does for the mocks. Use it when
|
||||
another worktree holds 3333. The `web:serve` entry can stay on Nx:
|
||||
`@angular/build:dev-server` runs inside the Nx process, so the group kill
|
||||
stops it. The mock servers follow the same
|
||||
rule; see [Xtream mock Playwright integration](xtream-mock-server.md#playwright-integration).
|
||||
stops it. Playwright launches that command itself even outside CI: the
|
||||
web-e2e targets carry no Nx `serve` dependency, because Nx refuses a
|
||||
non-parallel task with a continuous dependency. The mock servers follow the
|
||||
same rule; see [Xtream mock Playwright integration](xtream-mock-server.md#playwright-integration).
|
||||
|
||||
The PWA continues to use `PwaService`; only the backend base URL is resolved at
|
||||
runtime. Electron routes remain owned by the Electron backend and preload
|
||||
|
||||
@@ -197,6 +197,13 @@ and JSON summary output. CI uploads the merged Tier A report to Codecov with the
|
||||
Use atomized E2E targets when available, for example
|
||||
`pnpm nx run web-e2e:e2e-ci--src/xtream.e2e.ts`.
|
||||
|
||||
After changing a Playwright config's `webServer` list, `nx.json` target
|
||||
defaults or an E2E project's `dependsOn`, run
|
||||
`pnpm run e2e:task-graphs:validate`. It builds every Playwright target's task
|
||||
graph with and without `CI` and fails on the graphs Nx refuses to run; CI runs
|
||||
it in the `unit-and-typecheck` job. See
|
||||
[Xtream mock Playwright integration](xtream-mock-server.md#playwright-integration).
|
||||
|
||||
Inside `expect.poll`, read a changing list in one DOM snapshot
|
||||
(`allTextContents()` or `evaluateAll()`, as in
|
||||
`apps/electron-backend-e2e/src/sidebar-categories.e2e-support.ts`), not by
|
||||
|
||||
@@ -582,6 +582,28 @@ without being listed there. The `serve` targets remain the entry point
|
||||
for starting a mock by hand. The web-e2e `web-backend` entry uses the same
|
||||
launch form; see [PWA web backend](pwa-self-hosted.md#web-backend).
|
||||
|
||||
Playwright, not Nx, starts every E2E server, including the web dev server.
|
||||
`@nx/playwright/plugin` infers a continuous `serve` dependency from a
|
||||
`pnpm nx run <project>:serve` webServer only while `reuseExistingServer` is
|
||||
true, which the configs set only when `CI` is unset. It also sets
|
||||
`parallelism: false` on a target when a webServer has an `env` or a plain
|
||||
`node` command, because no Nx task covers that server. Nx refuses to run a
|
||||
non-parallel task that depends on a continuous task, so the inferred
|
||||
`web-e2e:e2e` failed locally with "do not support parallelism but depend on
|
||||
continuous tasks" and passed only in CI. Therefore:
|
||||
|
||||
- `apps/web-e2e/project.json` sets `e2e.dependsOn` to `[]`, and the filtered
|
||||
`e2e-ci--src/*.e2e.ts` target default in `nx.json` does the same for the
|
||||
per-file web targets. The per-file Electron targets depend only on
|
||||
`electron-backend:build-e2e`. Do not add the mocks' Nx `serve` targets as
|
||||
dependencies: Playwright already starts the mocks.
|
||||
- The plugin runs with `waitForWebServer: false`, because no target consumes
|
||||
its `e2e--wait-for-webserver` readiness task. Playwright's own URL probe
|
||||
covers readiness.
|
||||
- `pnpm run e2e:task-graphs:validate` (`tools/nx/check-e2e-task-graphs.mjs`)
|
||||
builds each Playwright target's task graph with Nx's own validation, once
|
||||
with `CI` unset and once with it set.
|
||||
|
||||
### Request Interception
|
||||
|
||||
The Angular PWA calls `localhost:3000/xtream?...`. Playwright intercepts these:
|
||||
|
||||
Reference in new issue
Block a user