From c183fec4028ef646596c8a2f659aeb6dce22ee9d Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Thu, 20 Aug 2026 18:36:36 +0200 Subject: [PATCH] test(e2e): wait for upload processing to clear before returning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In web-app-ai-multi-doc-synthesizer's acceptance.spec.ts, two webkit-only tests were flaky: - "Synthesize is hidden when fewer than 2 files are selected" failed with "Clicking the checkbox did not change its state" — the row checkbox was still `disabled` because oCIS keeps a freshly uploaded resource in a `processing` state for a short while, and web-pkg's ResourceTable disables the selection checkbox while `resource.processing === true`. `check({ force: true })` bypasses Playwright's normal wait-for-enabled retry, so it failed outright instead of waiting it out. - "synthesis modal displays shared themes section" failed with "Target page, context or browser has been closed" after a 30s timeout. Its non-force `selectAllCheckbox.check()` silently retried against the same disabled checkbox, burning most of the test timeout before the following `.click()` on the Synthesize button ran out of budget. FilesAppBar.uploadFile() only waited for the upload's HTTP response, not for the uploaded resource to leave its server-side "processing" state. Wait for the just-uploaded resource's row checkbox to become enabled before returning, so every caller of this shared helper (all AI extensions' e2e suites) can safely select a resource right after upload instead of racing against it. Signed-off-by: Lukas Hirt --- support/pages/filesAppBarActions.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/support/pages/filesAppBarActions.ts b/support/pages/filesAppBarActions.ts index 6ec09c9c0..367cd9774 100644 --- a/support/pages/filesAppBarActions.ts +++ b/support/pages/filesAppBarActions.ts @@ -40,5 +40,14 @@ export class FilesAppBar { } await expect(this.newResourceContextMenu).not.toBeVisible() await expect(this.uploadResourceContextMenu).not.toBeVisible() + + // The server keeps a freshly uploaded resource in a "processing" state for a + // short while (e.g. content indexing), during which its selection checkbox is + // disabled. Wait for that to clear so callers can safely select the resource + // right after upload instead of racing against it. + const row = this.page + .locator('.has-item-context-menu tr') + .filter({ has: this.page.locator(`[data-test-resource-name="${file}"]`) }) + await expect(row.getByRole('checkbox')).toBeEnabled({ timeout: 20_000 }) } }