test(e2e): refresh admin directory before new-project member pick
Create-project candidates come from the in-session user directory, so a fresh admin page never saw B/C unless the console refresh ran first. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user