Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

test(e2e): hit-test the Settings row menu only once it is revealed

vastsa51790f647773
diff --git a/apps/desktop/test/e2e/trusted-extensions/drive.mjs b/apps/desktop/test/e2e/trusted-extensions/drive.mjs
index 632e1c51d..d514c574c 100644
--- a/apps/desktop/test/e2e/trusted-extensions/drive.mjs
+++ b/apps/desktop/test/e2e/trusted-extensions/drive.mjs
@@ -272,7 +272,11 @@ await ui.click(`[data-provider-id="${pluginOAuthId}"] button[aria-haspopup="menu
// a person's pointer has to land on the item itself.
const menuOnTop = await ui.until(() => {
const item = [...document.querySelectorAll('[role="menuitem"]')].find((entry) => entry.textContent?.includes("Sign out"));
- if (!item) return null;
+ // Wait until the menu is measured and revealed (`is-open`); before that it
+ // sits hidden at the viewport origin by design.
+ const menu = item?.closest('[role="menu"]');
+ if (!item || !menu?.classList.contains("is-open")) return null;
+ if (getComputedStyle(menu).visibility !== "visible") return null;
const box = item.getBoundingClientRect();
if (box.width === 0 || box.height === 0) return null;
const hit = document.elementFromPoint(box.left + box.width / 2, box.top + box.height / 2);