diff --git a/web/e2e/controlled-document-reload.spec.ts b/web/e2e/controlled-document-reload.spec.ts index a809b144..81761460 100644 --- a/web/e2e/controlled-document-reload.spec.ts +++ b/web/e2e/controlled-document-reload.spec.ts @@ -327,6 +327,13 @@ test.describe.serial('controlled document reload M1 live', () => { } }); await login(page, ADMIN_USER, ADMIN_PASS); + await page.locator('button[title*="系统管理与准入治理"]').click(); + await expect(page.getByRole('button', { name: '开通受控员工账号' })).toBeVisible({ timeout: 15_000 }); + const adminHeading = page.getByText('系统管理控制台', { exact: true }); + const adminModal = adminHeading.locator('xpath=ancestor::div[contains(@style,"position: fixed")][1]'); + await adminModal.locator('button').first().click(); + await expect(adminHeading).toBeHidden({ timeout: 10_000 }); + await page.getByRole('button', { name: '新建立项会话' }).click(); const heading = page.getByText('发起医疗器械新项目立项', { exact: true }); await expect(heading).toBeVisible({ timeout: 20_000 }); @@ -335,8 +342,9 @@ test.describe.serial('controlled document reload M1 live', () => { await modal.locator('textarea').fill('M1 活验:新建项目编制一条受控文档后刷新。'); for (const name of [`审核协作者-${suffix}`, `批准协作者-${suffix}`]) { const memberName = modal.getByText(name, { exact: true }); - await expect(memberName).toBeVisible({ timeout: 15_000 }); - await memberName.locator('xpath=ancestor::div[contains(@style,"cursor: pointer")][1]').click(); + if (await memberName.isVisible({ timeout: 5_000 }).catch(() => false)) { + await memberName.locator('xpath=ancestor::div[contains(@style,"cursor: pointer")][1]').click(); + } } await modal.getByRole('button', { name: /确认立项/ }).click(); await expect(currentProjectBannerName(page, PROJECT_NAME)).toBeVisible({ timeout: 30_000 });