bug: flaky e2e "montre un message d'erreur" — ambiguous main p selector races the BigbDashboard widget #60

Closed
opened 2026-11-02 07:07:12 +00:00 by Gilles · 0 comments
Owner

Intermittent failure in e2e/accueil.spec.ts, seen on run #193:

StrictSelectorError: strict mode violation: `$("main p")` resolved to 2 elements, expected 1.

Root cause: ProjectListView.vue's homepage now embeds <BigbDashboard> (argus/backend#17) inside <main>. That component has its own independent loading/error state and renders its own <p> (in BigbDashboard.vue: <p v-if="loading">/<p v-else-if="error" class="bigb-error">), nested under <section class="overview">. The test's $("main p") selector predates this widget and assumed exactly one <p> under <main>; depending on which of the two independent fetches (/api/projects/ and /bigb/dashboards/argus-overview/) has settled by the time the assertion samples the DOM, it now matches 1 or 2 paragraphs — flaky, not a real regression in ProjectListView's own behavior.

Fix: scope the selector to the error paragraph that is actually a direct child of <main> (ProjectListView's own), excluding BigbDashboard's nested one — no timing dependency, no frontend change needed.

Not linked to a Thierryade spec: this is a test-infrastructure fix, not a product-behavior change, and no existing spec covers e2e selector mechanics.

🤖 Found and analyzed with Claude Code

Intermittent failure in `e2e/accueil.spec.ts`, seen on run [#193](https://git.stationmyr.net/argus/backend/actions/runs/193/jobs/1/attempt/1): ``` StrictSelectorError: strict mode violation: `$("main p")` resolved to 2 elements, expected 1. ``` **Root cause**: `ProjectListView.vue`'s homepage now embeds `<BigbDashboard>` (argus/backend#17) inside `<main>`. That component has its own independent `loading`/`error` state and renders its own `<p>` (in `BigbDashboard.vue`: `<p v-if="loading">`/`<p v-else-if="error" class="bigb-error">`), nested under `<section class="overview">`. The test's `$("main p")` selector predates this widget and assumed exactly one `<p>` under `<main>`; depending on which of the two independent fetches (`/api/projects/` and `/bigb/dashboards/argus-overview/`) has settled by the time the assertion samples the DOM, it now matches 1 or 2 paragraphs — flaky, not a real regression in `ProjectListView`'s own behavior. **Fix**: scope the selector to the error paragraph that is actually a direct child of `<main>` (`ProjectListView`'s own), excluding `BigbDashboard`'s nested one — no timing dependency, no frontend change needed. Not linked to a Thierryade spec: this is a test-infrastructure fix, not a product-behavior change, and no existing spec covers e2e selector mechanics. 🤖 Found and analyzed with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.