Skip to content

test(e2e): assert the configured-scope row after the theme-refresh re-render - #2180

Merged
efiten merged 1 commit into
Kpa-clawbot:masterfrom
efiten:fix/e2e-1648-scope-row-race
Oct 11, 2026
Merged

efiten merged 1 commit into
Kpa-clawbot:masterfrom
efiten:fix/e2e-1648-scope-row-race

Conversation

@efiten

@efiten efiten commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

What

test-issue-1648-m2-icons-e2e.js now asserts the configured-scope row only after the page's theme-refresh re-render has fired and the detail has rendered again.

Why

On 2026-10-10 this assertion failed CI on four PRs (#2169, #2171, #2154, #2164), each time at the first live-map case: confirmed scope row must be visible, including an empty scope. A re-run of the failed jobs passed every time.

The code path:

  • customize-v2.js:814 dispatches theme-changed once /api/config/theme resolves, on every page load.
  • app.js:1309-1315 turns that into theme-refresh 300 ms later.
  • live.js:4713 re-runs showNodeDetail(activeNodeDetailKey) on theme-refresh, and showNodeDetail first sets #nodeDetailContent to "Loading…" (live.js:2598). This is the only caller besides the marker click (live.js:3090).
  • The test waited for #nodeDetailContent table and then called row.isVisible(), which does not wait. A refresh landing between the two fails the check.

The same race could let the null-scope case pass on the "Loading…" panel, because row.count() === 0 holds there too.

The fix uses the same addInitScript flag pattern as test-e2e-playwright.js:83.

Testing

  • Locally against a server on the E2E fixture: 5 of 5 runs pass, 27 of 27 checks each.
  • Not reproduced locally. The unchanged test also passed every local run: 5 plain, 3 with /api/config/theme delayed by 1 s, 5 with 8x CPU throttling. So the reasoning above comes from the code path and the four CI failures, not from a local red-then-green.
  • Test-only change, no product code touched.

…-render

Every page load fires one theme-refresh about 300 ms after the theme
loads, and live.js re-runs showNodeDetail on it, which swaps
#nodeDetailContent to "Loading…" before it renders again. The test
waited for the detail table and then called the non-waiting
row.isVisible(), so a refresh landing in between failed the live
#fixture case. The null-scope case could pass on the "Loading…" panel
for the same reason.

Wait for the refresh to have fired, then for the detail again, before
asserting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@efiten
efiten merged commit 55dd281 into Kpa-clawbot:master Oct 11, 2026
12 checks passed
@efiten
efiten deleted the fix/e2e-1648-scope-row-race branch October 11, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant