Skip to content

fix(e2e): repair smoke drift from #1109 + neutralize ensure-default modal race (#1134) - #1135

Merged
dolho merged 1 commit into
devfrom
feature/1134-e2e-smoke-drift
Jul 1, 2026
Merged

dolho merged 1 commit into
devfrom
feature/1134-e2e-smoke-drift

Conversation

@vybe

@vybe vybe commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

frontend-e2e has been silently red on dev since 2026-06-10 — first failure on the #1114 run, before #1133 existed — because the workflow only runs on ui-labelled PRs and recent UI PRs merged without the label. Two pre-existing test issues, both test-only fixes:

1. smoke.spec.js — operating room (assertion drift from #1109)

/operating-room redirects to /operations since #1109; the page's visible text (heading Operations, tabs, "All clear…") matches none of the old /operating|queue|priority|all types|no items/ patterns. The redirect itself works fine — verified via run artifacts. New assertions: redirect URL + Operations heading + Needs Response tab, so the test now also covers the legacy redirect.

2. api-keys-copy.spec.js — ensure-default modal race

McpKeysTab.vue onMounted fires POST /api/mcp/keys/ensure-default; with no user-scoped key present it auto-creates Default MCP Key and opens the "Your MCP API Key is Ready!" modal at an arbitrary point mid-test. Both that modal and the test's Create modal are fixed z-10 inset-0, so the later DOM node (auto-modal) intercepts the Create click for the full 30s budget — run-artifact screenshot shows the auto-modal covering the form. beforeEach now calls ensure-default via page.request and reloads, making the remounted page's own call a guaranteed no-op. Bonus: test 1's clipboard assertions previously could pass against the auto modal (same buttons, format-only checks); they now always exercise the test's own key modal.

Verification

Unblocks #1133 (which re-runs e2e on top of this fix).

Fixes #1134

🤖 Generated with Claude Code

@vybe vybe added type-bug Bug fix ui PR touches the frontend UI — triggers Playwright e2e tests labels Jun 10, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@vybe

vybe commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Needs a rebase onto dev. This branch is ~17 days behind dev (last touched 2026-06-11). Since it specifically repairs e2e smoke drift from #1109, it has to validate against the current tree to mean anything — dev has since moved (e.g. #1112 unified the Chat/Session tab, more Operations IA churn).

I've re-triggered the failed CodeQL run, but it's analyzing the stale base. Please rebase onto dev and let CI re-run before this is merge-ready.

…odal race (#1134)

frontend-e2e has been red on dev since 2026-06-10 (first on the #1114
run), unnoticed because the workflow is ui-label-gated.

- smoke.spec.js: /operating-room now redirects to /operations (#1109);
  the old text assertions match nothing on the new page. Assert the
  redirect URL + Operations heading + tab strip instead — the test now
  also covers the legacy redirect.
- api-keys-copy.spec.js: McpKeysTab onMounted fires ensure-default,
  which auto-creates 'Default MCP Key' and opens the key-ready modal at
  an arbitrary point mid-test, intercepting the Create click (both
  modals are fixed z-10 inset-0; later DOM node wins). beforeEach now
  calls ensure-default via API and reloads, making the page's own call
  a guaranteed no-op — the auto-modal can never appear mid-test, and
  the clipboard assertions always run against the test's own key modal
  rather than green-washing on the auto-modal.

Fixes #1134

Co-Authored-By: Claude Fable 5 <[email protected]>
@vybe
vybe force-pushed the feature/1134-e2e-smoke-drift branch from 44e79ce to 4172ab6 Compare June 27, 2026 18:21
@vybe

vybe commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

✅ Rebased onto dev (force-pushed). Clean replay of the single commit onto the current tip — only the 2 e2e specs (smoke.spec.js, api-keys-copy.spec.js) changed. CI re-triggered against today's dev.

@dolho

dolho commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review — LGTM ✅

Test-only fix (26/5), all CI green including the frontend-e2e e2e job — the actual proof, since this PR carries the ui label so the suite really ran here.

Verified every claim:

  • localStorage key 'token' is correct (stores/auth.js:284).
  • POST /api/mcp/keys/ensure-default exists (components/settings/McpKeysTab.vue:405).
  • Auth is present in beforeEach: storageState from auth.setup.js (admin.json) loads before page.goto, so the token is readable.
  • Endpoint is idempotent → pre-creating the default key + reload makes the remounted page's own ensure-default a guaranteed no-op → the auto-modal can't pop mid-test.
  • Base = dev.

smoke.spec.js — old /operating|queue|priority/ text is gone after the #1109 redirect to /operations. New assertions (redirect URL + Operations heading + Needs Response tab) are strictly stronger than the old any-text check and also cover the legacy redirect.

api-keys-copy.spec.js — race root cause is accurate: two fixed z-10 inset-0 modals, the later DOM node (auto-modal) intercepts the Create click. .catch(() => {}) on the pre-call is safe — a failure degrades to the original flake, never a new failure.

Minor nit (non-blocking): the initial page.goto also fires a client-side ensure-default on mount before the reload — harmless (idempotent + reload discards that modal), just a slightly redundant double-fetch. goto is required to read localStorage, so the current form is fine.

No changes needed. Ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug Bug fix ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants