fix(clazz-e2e): increase role dialog wait in clazz-ui.spec.ts to 15s

Same fix as e43b059: the 3-second waitForTimeout before checking the
role selection dialog is insufficient in CI. Replaced with
waitFor({ state: 'visible', timeout: 15_000 }).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 03:39:50 +08:00
parent e43b0597a1
commit e70777160f
+5 -3
View File
@@ -32,11 +32,11 @@ test.describe('排课页面 UI', () => {
const q = new URLSearchParams({ unionid: moicenUnionid, status: '2' }); const q = new URLSearchParams({ unionid: moicenUnionid, status: '2' });
await page.goto(`/?${q.toString()}`, { waitUntil: 'domcontentloaded', timeout: 60_000 }); await page.goto(`/?${q.toString()}`, { waitUntil: 'domcontentloaded', timeout: 60_000 });
await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 }); await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 });
await page.waitForTimeout(3000);
// 选择身份(如果弹出 // 等待身份选择弹窗(最多 15 秒
const rs = page.getByText('请选择您的登录身份'); const rs = page.getByText('请选择您的登录身份');
if (await rs.isVisible().catch(() => false)) { try {
await rs.waitFor({ state: 'visible', timeout: 15_000 });
const items = page.locator('.van-grid-item'); const items = page.locator('.van-grid-item');
const count = await items.count(); const count = await items.count();
// items[0]=测试员, items[1]=学生, items[2]=教师 // items[0]=测试员, items[1]=学生, items[2]=教师
@@ -46,6 +46,8 @@ test.describe('排课页面 UI', () => {
await items.first().click(); await items.first().click();
} }
await page.waitForTimeout(3000); await page.waitForTimeout(3000);
} catch {
// 无弹窗 — 已有身份
} }
// 导航到排课页面 // 导航到排课页面