Skip to content

Commit 42c431d

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 42c431d

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

frontend/e2e/accessibility.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ 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 first interactive element to render so Tab has something
65+
// to focus. Without this, the test races the initial render and Tab can
66+
// land on (and then lose) a transient element.
67+
await expect(page.getByTitle("Home")).toBeVisible();
68+
69+
// Tab to the first interactive element. Sending the keystroke through
70+
// `body` ensures the document has focus before the Tab is dispatched.
71+
await page.locator("body").press("Tab");
6672
const focused = page.locator(":focus");
6773
await expect(focused).toBeVisible();
6874

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)