Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(gfs): align runtime E2E guards with UI and IPC contracts

Alfredo Lopez05d857214489
diff --git a/control-ui/e2e/support/gfs-control-ui-session.ts b/control-ui/e2e/support/gfs-control-ui-session.ts
index 772c9d961..6afa1e26c 100644
--- a/control-ui/e2e/support/gfs-control-ui-session.ts
+++ b/control-ui/e2e/support/gfs-control-ui-session.ts
@@ -65,13 +65,10 @@ export async function loginControlUi(page: Page): Promise<void> {
})
// The account reminder is allowed to arrive after the shell becomes ready.
- // Register a user-visible dismissal handler so it cannot intercept a later
- // GFS action, while retaining an immediate dismissal for the already-rendered
- // case. This is test setup only; it does not mutate account state or mock the
- // Control UI request path.
- await page.addLocatorHandler(accountAlert, async () => {
- if (await remindLater.isVisible().catch(() => false)) await remindLater.click()
- })
+ // Dismiss it explicitly when it is present. A locator handler is deliberately
+ // not used here: Playwright invokes handlers before actions on matching
+ // descendants, so a handler that clicks `remindLater` can intercept its own
+ // dismissal and wait forever for the alert to disappear.
if (await accountAlert.isVisible({ timeout: 3_000 }).catch(() => false)) {
await remindLater.click()
await expect(accountAlert).toBeHidden({ timeout: 10_000 })
diff --git a/desktop-app/test/e2e-playwright/gfs-upload-v2.test.ts b/desktop-app/test/e2e-playwright/gfs-upload-v2.test.ts
index 418eabffd..0e82e5f1f 100644
--- a/desktop-app/test/e2e-playwright/gfs-upload-v2.test.ts
+++ b/desktop-app/test/e2e-playwright/gfs-upload-v2.test.ts
@@ -218,21 +218,19 @@ async function openFolder(
page: Page,
folderName: string
): Promise<{ browser: Locator; manageDialog: Locator }> {
+ /*
+ * E2E_GUARDIAN_IPC_FLOW: Desktop GFS discovery is brokered through the
+ * main-process `window.clerum.gfs.listAccessible` bridge, so the renderer
+ * has no HTTP response to await for this transition. The Files heading,
+ * browser region, and seeded folder row are the visible/business signals.
+ */
const filesHeading = page.getByRole('heading', { name: 'Files', exact: true })
const openFilesAttempt = async (timeout: number): Promise<void> => {
- const accessibleResponse = page
- .waitForResponse(
- response =>
- response.request().method() === 'GET' && response.url().includes('/external/gfs'),
- { timeout }
- )
- .then(() => true)
- .catch(() => false)
await openResourcesNavItem(page, 'nav-files')
await expect(filesHeading).toBeVisible({ timeout })
- if (!(await accessibleResponse)) {
- throw new Error('Desktop Files navigation did not produce the GFS accessibility response')
- }
+ await expect(page.getByRole('region', { name: 'Global File System browser' })).toBeVisible({
+ timeout,
+ })
}
try {
diff --git a/tools/e2e_static_audit.py b/tools/e2e_static_audit.py
index 74210a54f..b975e7937 100755
--- a/tools/e2e_static_audit.py
+++ b/tools/e2e_static_audit.py
@@ -31,7 +31,15 @@ def audit_file(path: Path) -> list[str]:
line = text.count("\n", 0, match.start()) + 1
findings.append(f"{path}:{line}: {label}")
- if "waitForResponse" not in text and "waitForRequest" not in text:
+ # Electron GFS browser discovery is brokered through the main process IPC
+ # bridge, so there is no renderer HTTP request to await. Such specs must
+ # opt in with an explicit, explanatory marker rather than adding a fake
+ # network wait that can hide a broken user transition.
+ if (
+ "waitForResponse" not in text
+ and "waitForRequest" not in text
+ and "E2E_GUARDIAN_IPC_FLOW" not in text
+ ):
findings.append(f"{path}: missing critical network-response/request wait")
# Direct navigation is allowed only in an explicitly negative terminal