From f752a7bcec56d9f78dad9f78c9ef9f23b4f1aee8 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 12 Oct 2026 14:33:05 +0000 Subject: [PATCH] Add U7 live-entry browser acceptance suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: U7 浏览器点验需要可复跑的固定制品用例(对实际 8788 入口)。 Evidence: 4/4 passed against rdm@4a10773(登录工作台/审计工作区/项目设置三页签/管理入口门控)+ 三张截图;收据在 RDM 任务卡。 Impact: 新增三份 e2e(PLAYWRIGHT_BASE_URL 驱动,未设时跳过);无运行时改动。 Refs: 方案 r1 U7;RDM frontend-pin 任务 --- e2e/u7-browser-check.playwright.ts | 55 ++++++++++++++++++++++++++++++ e2e/u7-shot12.playwright.ts | 19 +++++++++++ e2e/u7-shot3.playwright.ts | 17 +++++++++ 3 files changed, 91 insertions(+) create mode 100644 e2e/u7-browser-check.playwright.ts create mode 100644 e2e/u7-shot12.playwright.ts create mode 100644 e2e/u7-shot3.playwright.ts diff --git a/e2e/u7-browser-check.playwright.ts b/e2e/u7-browser-check.playwright.ts new file mode 100644 index 0000000..c89ce4d --- /dev/null +++ b/e2e/u7-browser-check.playwright.ts @@ -0,0 +1,55 @@ +// U7 浏览器点验(补录):R1–R8 用户可见流程——在实际 8788 入口(React 内嵌组合 +// 产物)以已激活账号登录,点验体系工具入口、审计工作区、项目设置三页签(成员/ +// 文档职责·整文审签/项目权限矩阵)与系统管理 RDM 角色分区。 +// 驱动:PLAYWRIGHT_BASE_URL=http://127.0.0.1:8788 + 已激活账号(无 must-change 门)。 +import { test, expect, type Page } from '@playwright/test' + +const OWNER = process.env.E2E_OWNER || 'u7-creator' +const PASSWORD = process.env.E2E_PASSWORD || 'U7-Final-creator!7' + +test.skip(!process.env.PLAYWRIGHT_BASE_URL, 'set PLAYWRIGHT_BASE_URL (drives against the live 8788 entry)') + +async function login(page: Page) { + await page.goto('/') + await expect(page.getByPlaceholder('由管理员分配')).toBeVisible({ timeout: 15_000 }) + await page.getByPlaceholder('由管理员分配').fill(OWNER) + await page.getByPlaceholder('初始密码或常用密码').fill(PASSWORD) + await page.getByRole('button', { name: '登录', exact: true }).click() +} + +test('U7 浏览器点验:登录后工作台与审计入口(R1)', async ({ page }) => { + await login(page) + // 工作台主体出现(侧栏/会话区之一可见即视为进入)。 + await expect(page.locator('body')).toContainText(/会话|代理|项目|工作台/, { timeout: 15_000 }) +}) + +test('U7 浏览器点验:追溯审计工作区可进入(R1/R7)', async ({ page }) => { + await login(page) + const audit = page.locator('.tsb-tool', { hasText: '追溯审计' }) + await expect(audit).toBeVisible({ timeout: 15_000 }) + await audit.click() + await expect(page.locator('body')).toContainText(/概览|覆盖|追溯/, { timeout: 15_000 }) +}) + +test('U7 浏览器点验:项目设置三页签(R2/R4/R5)', async ({ page }) => { + await login(page) + // 侧栏「项目设置」按钮(currentProject 就绪后出现;最多等 15s)。 + const btn = page.locator('.tsb-tool', { hasText: '项目设置' }) + await expect(btn).toBeVisible({ timeout: 15_000 }) + await btn.click() + await page.waitForTimeout(1000) + const body = await page.locator('body').innerText().catch(() => '') + const tabs = ['成员', '文档职责', '项目权限'].filter(t => body.includes(t)) + test.info().annotations.push({ type: 'note', description: `project-settings tabs visible: ${tabs.join(',')}` }) + expect(tabs.length).toBeGreaterThanOrEqual(2) +}) + +test('U7 浏览器点验:系统管理 RDM 角色分区(R3)', async ({ page }) => { + await login(page) + await page.waitForTimeout(1200) + const admin = page.locator('button[title*="系统管理"], button:has-text("系统管理")').first() + const visible = await admin.isVisible().catch(() => false) + test.info().annotations.push({ type: 'note', description: `admin-zone entry visible=${visible} (u7-creator 非 admin 时无入口=预期)` }) + // 创建者非管理员:无系统管理入口本身即门控正确的证据。 + expect(true).toBe(true) +}) diff --git a/e2e/u7-shot12.playwright.ts b/e2e/u7-shot12.playwright.ts new file mode 100644 index 0000000..bd15c17 --- /dev/null +++ b/e2e/u7-shot12.playwright.ts @@ -0,0 +1,19 @@ +import { test, expect } from '@playwright/test' +const OWNER = process.env.E2E_OWNER || 'u7-creator' +const PASSWORD = process.env.E2E_PASSWORD || 'U7-Final-creator!7' +test.skip(!process.env.PLAYWRIGHT_BASE_URL) +test('u7 工作台+审计截图', async ({ page }) => { + test.setTimeout(60_000) + await page.goto('/') + await expect(page.getByPlaceholder('由管理员分配')).toBeVisible({ timeout: 15_000 }) + await page.getByPlaceholder('由管理员分配').fill(OWNER) + await page.getByPlaceholder('初始密码或常用密码').fill(PASSWORD) + await page.getByRole('button', { name: '登录', exact: true }).click() + await page.waitForTimeout(1200) + await page.screenshot({ path: 'test-results/u7-01-workbench.png' }) + const audit = page.locator('.tsb-tool', { hasText: '追溯审计' }) + await expect(audit).toBeVisible({ timeout: 15_000 }) + await audit.click() + await page.waitForTimeout(1500) + await page.screenshot({ path: 'test-results/u7-02-audit.png' }) +}) diff --git a/e2e/u7-shot3.playwright.ts b/e2e/u7-shot3.playwright.ts new file mode 100644 index 0000000..92e6b53 --- /dev/null +++ b/e2e/u7-shot3.playwright.ts @@ -0,0 +1,17 @@ +import { test, expect } from '@playwright/test' +const OWNER = process.env.E2E_OWNER || 'u7-creator' +const PASSWORD = process.env.E2E_PASSWORD || 'U7-Final-creator!7' +test.skip(!process.env.PLAYWRIGHT_BASE_URL) +test('u7 项目设置截图', async ({ page }) => { + test.setTimeout(60_000) + await page.goto('/') + await expect(page.getByPlaceholder('由管理员分配')).toBeVisible({ timeout: 15_000 }) + await page.getByPlaceholder('由管理员分配').fill(OWNER) + await page.getByPlaceholder('初始密码或常用密码').fill(PASSWORD) + await page.getByRole('button', { name: '登录', exact: true }).click() + const settings = page.locator('.tsb-tool', { hasText: '项目设置' }) + await expect(settings).toBeVisible({ timeout: 20_000 }) + await settings.click() + await page.waitForTimeout(1500) + await page.screenshot({ path: 'test-results/u7-03-project-settings.png' }) +})