From 8215d3fdb9ef99e413f0710d32db8f7f227ea451 Mon Sep 17 00:00:00 2001 From: Bee <68532117+abeatrix@users.noreply.github.com> Date: Wed, 5 Nov 2025 04:43:29 +0800 Subject: [PATCH] fix: flaky e2e test for slash commands (#7206) * fix: flaky e2e test for slash commands * use click * @problems * newtask click * exact: false * exact: false * revert unrelated change --- src/test/e2e/chat.test.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/test/e2e/chat.test.ts b/src/test/e2e/chat.test.ts index 39029671..dc934ae8 100644 --- a/src/test/e2e/chat.test.ts +++ b/src/test/e2e/chat.test.ts @@ -34,13 +34,11 @@ e2e("Chat - can send messages and switch between modes", async ({ helper, sideba // === slash commands preserve following text === await expect(inputbox).toHaveValue("") // Type partial slash command to trigger menu - await inputbox.pressSequentially("/new", { delay: 100 }) + await inputbox.fill("/newt") - // Wait for the slash commands menu to be visible - await sidebar.getByTestId("slash-commands-menu").waitFor({ state: "visible" }) - - // Wait for menu to be visible and select first option with Tab - await inputbox.press("Tab") + // Wait for menu to be visible and click on menu item + await inputbox.focus() + await sidebar.getByText("newtask", { exact: false }).click() await expect(inputbox).toHaveValue("/newtask ") // Add following text to verify it works correctly @@ -52,10 +50,10 @@ e2e("Chat - can send messages and switch between modes", async ({ helper, sideba await expect(inputbox).toHaveValue("") // Type partial @ mention to trigger menu - await inputbox.pressSequentially("@prob") + await inputbox.fill("@prob") - // Wait for menu to be visible and select first option with Tab - await inputbox.press("Tab") + // Wait for menu to be visible and click on menu item + await sidebar.getByText("Problems", { exact: false }).first().click() await expect(inputbox).toHaveValue("@problems ") // Add following text to verify it works correctly