Files
huike-e2e-moicen/tests/org-multi-tenant.spec.ts
weli 8b4d806376
music-room Playwright (Gitea Actions) / playwright (push) Failing after 22m24s
fix(e2e): 3 CI failures — org-multi-tenant timeout, dual-view events, supervisor path
- org-multi-tenant.spec.ts: goto timeout 60s→120s (same fix as previous)
- clazz-dual-view.spec.ts: use toPass to wait for .fc-event re-render after view switch
- supervisor-features.spec.ts: navigate to /teacher/home after role selection

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 20:04:57 +08:00

60 lines
1.8 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { expect, test } from './fixtures';
const moicenUnionid = process.env.MOICEN_E2E_UNIONID?.trim();
test.describe('机构多租户入口链路', () => {
test.skip(!moicenUnionid, '需要 MOICEN_E2E_UNIONIDSecret 或 .env.e2e');
test('登录后可进入机构选择页且不出现未登录占位', async ({ page }) => {
const queryString = new URLSearchParams({
unionid: moicenUnionid!,
status: '2',
});
await page.goto(`/?${queryString.toString()}`, {
waitUntil: 'domcontentloaded',
timeout: 120_000,
});
await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 });
if (
await page
.getByText('请选择您的登录身份')
.isVisible()
.catch(() => false)
) {
await page.locator('.van-grid-item').first().click();
}
await page.goto('/org/select', {
waitUntil: 'domcontentloaded',
timeout: 60_000,
});
await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 });
// 线上会话状态可能被服务端回收;出现访客课包商店时跳过,不让 CI 因账号瞬时态失败。
if (
await page
.locator('.course-package-store')
.isVisible()
.catch(() => false)
) {
test.skip(true, '当前 unionid 会话未处于可用登录态,跳过机构入口断言');
}
const institutionCandidates = [
page.getByRole('heading', { name: /机构|选择机构/ }),
page.getByText(/机构|切换机构|选择机构/),
page.locator('.van-cell'),
page.locator('.van-card'),
];
let foundInstitutionUI = false;
for (const institutionLocator of institutionCandidates) {
if ((await institutionLocator.count()) > 0) {
foundInstitutionUI = true;
break;
}
}
expect(foundInstitutionUI).toBeTruthy();
});
});