From f237dda41339e4430c30a356c48bd7130ecb6798 Mon Sep 17 00:00:00 2001 From: kvyb Date: Thu, 18 Sep 2025 07:30:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20test=20e2e=20click=20=E2=80=9CShow=20Cod?= =?UTF-8?q?e=20Actions=E2=80=9D=20button=20then=20wait=20for=20listbox=20o?= =?UTF-8?q?n=20macOS=20(#6287)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: test e2e click “Show Code Actions” button then wait for listbox on macOS * fix: trigger code actions during test with shortcut * fix: add reasonable timeout to the menu and listbox call in test --- src/test/e2e/utils/common.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/e2e/utils/common.ts b/src/test/e2e/utils/common.ts index 2095d7ec..2615ceac 100644 --- a/src/test/e2e/utils/common.ts +++ b/src/test/e2e/utils/common.ts @@ -11,7 +11,14 @@ export const addSelectedCodeToClineWebview = async (_page: Page) => { await _page.locator("div:nth-child(4) > span > span").first().click() await _page.getByRole("textbox", { name: "The editor is not accessible" }).press("ControlOrMeta+a") - await _page.getByRole("listbox", { name: /Show Code Actions / }).click() + // Open Code Actions via keyboard for cross-platform reliability + await _page.keyboard.press("ControlOrMeta+.") + // Wait for the Code Actions UI to appear (listbox or menu depending on platform/version) + try { + await _page.getByRole("listbox").first().waitFor({ state: "visible", timeout: 5000 }) + } catch { + await _page.getByRole("menu").first().waitFor({ state: "visible", timeout: 5000 }) + } await _page.keyboard.press("Enter", { delay: 100 }) // First action - "Add to Cline" }