fix(e2e): expand collapsed doc rail before category select
Reviewer/approver contexts open with collapsed rail; UI-11 三权 failed looking up doc-category-trigger.
This commit is contained in:
@@ -409,10 +409,20 @@ async function waitForSquadCompletion(
|
||||
return Date.now() - startedAt;
|
||||
}
|
||||
|
||||
async function ensureDocRailExpanded(page: Page) {
|
||||
const expandDocRail = page.getByRole('button', { name: '展开受控文档栏' });
|
||||
if (await expandDocRail.isVisible().catch(() => false)) {
|
||||
await expandDocRail.click();
|
||||
await expect(expandDocRail).toHaveCount(0, { timeout: 10_000 });
|
||||
}
|
||||
await expect(page.getByTestId('doc-category-trigger')).toBeVisible({ timeout: 15_000 });
|
||||
}
|
||||
|
||||
async function selectDeliverableCategory(
|
||||
page: Page,
|
||||
category: 'workflow' | 'shared' | 'private',
|
||||
) {
|
||||
await ensureDocRailExpanded(page);
|
||||
const trigger = page.getByTestId('doc-category-trigger');
|
||||
await expect(trigger).toBeVisible({ timeout: 15_000 });
|
||||
await trigger.click();
|
||||
|
||||
Reference in New Issue
Block a user