fix(e2e): make the CI Playwright run coherent (serve every spec's demo)#153
Merged
Conversation
The CI `playwright-e2e` job ran the default config, which has no testMatch and so runs ALL specs — but starts only 4 servers (counter/router/sw/edgecases). It never served SwiflowUIDemo (datatable/dropdown), RegionDemo (region), or the TodoCRUD backend, so those 16 specs failed "element not found." This was masked for ages by the MiniRouter config-load abort (fixed in #152); once that cleared, the gap surfaced. - Default config `testIgnore`s the 4 orphan spec groups — they collide on port :3004 (RegionDemo vs SwiflowUIDemo) so can't share the default config's parallel servers, and todocrud needs the real Bun+SQLite backend. - CI e2e step now runs three configs: `npm test` (default) then `test:regions` and `test:swiflowui`, sequentially, accumulating status so one red doesn't hide the rest. TodoCRUD stays in the separate run-e2e-backend job. - Added the missing `test:swiflowui` npm script (the swiflowui config existed but was never scripted, so datatable/dropdown had NEVER run against their server). - Fixed the latent bug that surfaced: `datatable.spec.ts` pager test used an unscoped getByRole("button", {name:"Next"}) that also matched the demo's wizard "Next" button — scoped it to `.sw-table__pager`. Verified locally: test:swiflowui 10/10, test:regions 1/1. The default config's served specs are the 40 that already passed in CI; todocrud unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📦 Bundle size
✅ Within budget (≤5% growth allowed). Baseline: Swift 6.3, WASM SDK 6.3-RELEASE, measured 2026-06-18. |
…t clash CI run: default 40 passed, regions 1 passed, then swiflowui failed to start with "port 3004 already in use". regions.config (RegionDemo) and swiflowui.config (SwiflowUIDemo) both bound :3004; run back-to-back in the same CI step, the regions `swiflow dev` server hadn't released :3004 before swiflowui tried to bind it (local teardown is fast enough to hide this; CI's isn't). Give SwiflowUIDemo its own port :3005 (datatable/dropdown use the config baseURL, so no spec change). Verified: test:swiflowui 10/10 on :3005. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
The CI
playwright-e2ejob ran the default config, which has notestMatch— so it runs all 11 specs — but starts only 4 servers (counter :3000, router :3001, sw :3002, edgecases :3003). It never served SwiflowUIDemo (datatable/dropdown), RegionDemo (region), or the TodoCRUD backend, so those 16 specs failed "element not found." The gap was masked for ages by the MiniRouter config-load abort (fixed in #152); once that cleared, the whole run finally reached these specs and they went red.Fix (scope the default config + run the dedicated configs)
The dedicated per-demo configs collide on port :3004 (RegionDemo vs SwiflowUIDemo) by design — they're meant to run separately. So:
testIgnores the 4 orphan spec groups (region,datatable,dropdown,todocrud) — it keeps its fast 4-server parallel run for the specs those serve.npm test(default) →npm run test:regions→npm run test:swiflowui, sequentially, accumulating exit status so one red spec doesn't hide the others. TodoCRUD stays in the existing separaterun-e2e-backendjob (it needs the real Bun+SQLite backend).test:swiflowuinpm script — theplaywright.swiflowui.config.tsexisted but was never scripted, so datatable/dropdown had never actually run against their server.A latent bug this surfaced
Because datatable/dropdown had never run against SwiflowUIDemo, a real bug was hiding:
datatable.spec.ts's pager test used an unscopedgetByRole("button", { name: "Next" }), which also matches the demo's wizardButton("Next"). Scoped it to the paged table's own.sw-table__pager.Test plan
test:swiflowui10/10 locally (datatable + dropdown, including the fixed pager test).test:regions1/1 locally (region against RegionDemo).testIgnoreonly removes the 4 it couldn't serve. TodoCRUD unaffected (separate job).run-e2eon this PR to confirm the full pipeline goes green.🤖 Generated with Claude Code