From 4d4ea20e634972bea966d8a2d2b0c4fa9027fae3 Mon Sep 17 00:00:00 2001 From: weichen Date: Sun, 13 Sep 2026 11:37:03 +0000 Subject: [PATCH] chore(e2e): keep Antigravity evidence path and UI harness tweaks Preserve uncommitted Playwright config/spec adjustments for the ongoing document-revision runtime acceptance run. Co-authored-by: Cursor --- web/e2e/document-revision-runtime.spec.ts | 10 ++++++++-- web/playwright.config.ts | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/web/e2e/document-revision-runtime.spec.ts b/web/e2e/document-revision-runtime.spec.ts index a4bec385..20cc4977 100644 --- a/web/e2e/document-revision-runtime.spec.ts +++ b/web/e2e/document-revision-runtime.spec.ts @@ -19,7 +19,7 @@ const uiPhase = (process.env.UI_PHASE || 'main').trim(); // main | post-restart const ASSETS = path.resolve( __dirname, - '../../../.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui', + '../../.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui', ); const SCREENSHOTS = path.join(ASSETS, 'screenshots'); const TRACES = path.join(ASSETS, 'traces'); @@ -186,7 +186,13 @@ async function logoutViaUI(page: Page) { } async function openAdminConsole(page: Page) { - await page.locator('button[title*="系统管理与准入治理"]').click(); + await shot(page, 'UI-00-admin-logged-in.png'); + const btn = page.locator('button[title*="系统管理与准入治理"]'); + if (!(await btn.isVisible({ timeout: 10_000 }).catch(() => false))) { + const leftRailText = await page.locator('aside').innerText().catch(() => 'no aside'); + fail(`admin button not visible. Left rail content: ${leftRailText}`); + } + await btn.click(); await expect(page.getByText('开通受控员工账号')).toBeVisible({ timeout: 15_000 }); } diff --git a/web/playwright.config.ts b/web/playwright.config.ts index e6083ee6..47a7b40e 100644 --- a/web/playwright.config.ts +++ b/web/playwright.config.ts @@ -11,7 +11,7 @@ const runAcceptance = process.env.RUN_UI_ACCEPTANCE === '1'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const evidenceRoot = path.resolve( __dirname, - '../../.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui', + '../.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui', ); export default defineConfig({ @@ -29,6 +29,7 @@ export default defineConfig({ use: { baseURL: process.env.BASE_URL || 'http://127.0.0.1:8080', headless: true, + actionTimeout: 30_000, locale: 'zh-CN', trace: runAcceptance ? 'on' : 'off', screenshot: runAcceptance ? 'on' : 'off',