Skip to content

Commit 5f0f4cb

Browse files
romanlutzCopilot
andcommitted
FIX [GUI] Fix e2e tests after Home becomes default view
Three Playwright e2e tests broke when the Home landing page replaced Chat as the initial view: - chat.spec.ts `should disable input when no target is active`: navigate to Chat before asserting the no-target-banner, since Home does not render that element. - config.spec.ts `should enable chat input after a target is set`: same Chat navigation before the no-target-banner assertion. - accessibility.spec.ts `should be navigable with keyboard`: wait for the Home sidebar button to render and dispatch the initial Tab through `body` so the focus advances into the DOM reliably under parallel worker load. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5174d8e commit 5f0f4cb

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

frontend/e2e/accessibility.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ test.describe("Accessibility", () => {
6161
});
6262

6363
test("should be navigable with keyboard", async ({ page }) => {
64-
// Tab to the first interactive element
65-
await page.keyboard.press("Tab");
64+
// Wait for the sidebar to render so there is a focusable element for Tab
65+
// to land on, and dispatch the Tab through `body` (rather than the bare
66+
// keyboard) to guarantee the document has focus when the keystroke fires.
67+
// Without both, Chromium sometimes leaves `:focus` empty under parallel
68+
// worker load.
69+
await expect(page.getByTitle("Home")).toBeVisible();
70+
await page.locator("body").press("Tab");
6671
const focused = page.locator(":focus");
6772
await expect(focused).toBeVisible();
6873

frontend/e2e/chat.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ test.describe("Multiple Messages", () => {
297297
test.describe("Chat without target", () => {
298298
test("should disable input when no target is active", async ({ page }) => {
299299
await page.goto("/");
300+
await page.getByTitle("Chat").click();
300301

301302
// The no-target-banner should be visible because no target is active
302303
await expect(page.getByTestId("no-target-banner")).toBeVisible();

frontend/e2e/config.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ test.describe("Target Config ↔ Chat Navigation", () => {
246246

247247
// Start in chat — no-target-banner should be visible
248248
await page.goto("/");
249+
await page.getByTitle("Chat").click();
249250
await expect(page.getByTestId("no-target-banner")).toBeVisible();
250251

251252
// Go to config, set a target

0 commit comments

Comments
 (0)