From a271c72931c5ba956b8cce8ad025668d6d574612 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 4 May 2026 08:58:25 +0000 Subject: [PATCH] fix(react-ui/e2e): scope backendTrigger to
so it skips LanguageSwitcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The LanguageSwitcher added in the i18n PR (#9642) lives in the sidebar and also uses aria-haspopup="listbox" — same attribute the import-form SearchableSelect uses. The Batch D / E tests' helper resolved the trigger with `page.locator('button[aria-haspopup="listbox"]').first()`, which now returns the language switcher (rendered first in DOM order, in the sidebar) instead of the backend dropdown. After clicking the wrong button, getByRole('option', { name: 'llama-cpp' }) naturally never resolves — language options aren't backend names — and the test times out at 30s. Scope the locator to the
wrapper so only buttons inside the route's main content area match. The page layout has the Sidebar outside
, so this cleanly excludes it. Assisted-by: Claude:claude-opus-4-7[1m] [Claude Code] Signed-off-by: Ettore Di Giacinto --- core/http/react-ui/e2e/import-form-ux-batch-d.spec.js | 6 +++--- core/http/react-ui/e2e/import-form-ux-batch-e.spec.js | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/http/react-ui/e2e/import-form-ux-batch-d.spec.js b/core/http/react-ui/e2e/import-form-ux-batch-d.spec.js index 26fe2f0cc..30a74de89 100644 --- a/core/http/react-ui/e2e/import-form-ux-batch-d.spec.js +++ b/core/http/react-ui/e2e/import-form-ux-batch-d.spec.js @@ -52,10 +52,10 @@ async function enterPowerPreferences(page) { } // Backend dropdown trigger — the SearchableSelect button has -// `aria-haspopup="listbox"`. There's exactly one on the Power/Preferences -// page so the first match is stable. +// `aria-haspopup="listbox"`. The LanguageSwitcher in the sidebar uses the +// same attribute, so scope to the
content area to skip it. function backendTrigger(page) { - return page.locator('button[aria-haspopup="listbox"]').first() + return page.locator('main button[aria-haspopup="listbox"]').first() } async function selectBackend(page, name) { diff --git a/core/http/react-ui/e2e/import-form-ux-batch-e.spec.js b/core/http/react-ui/e2e/import-form-ux-batch-e.spec.js index ace9bb43a..8a20abc90 100644 --- a/core/http/react-ui/e2e/import-form-ux-batch-e.spec.js +++ b/core/http/react-ui/e2e/import-form-ux-batch-e.spec.js @@ -59,7 +59,10 @@ function chip(page, key) { } function backendTrigger(page) { - return page.locator('button[aria-haspopup="listbox"]').first() + // Scope to
: the LanguageSwitcher in the sidebar also uses + // aria-haspopup="listbox", so an unscoped .first() selector picks it + // instead of the backend dropdown. + return page.locator('main button[aria-haspopup="listbox"]').first() } test.describe('Import form UX — Batch E (modality chip row)', () => {