test: guest onboarding, logged-in isolation, optional real_name
Add guest-onboarding and logged-in-and-isolation specs; remove moicen-unionid-chain; MOICEN_E2E_EXPECTED_REAL_NAME for 欢迎回来+姓名; CI secret; workers=1; longer goto timeouts. Made-with: Cursor
This commit is contained in:
@@ -3,16 +3,16 @@ import { test, expect } from '@playwright/test';
|
||||
// 对已部署 H5:匿名、伪造 unionid、page_path 净化(与 huike-front main.ts 一致)
|
||||
test.describe('music-room shell', () => {
|
||||
test('根路径挂载 Vue 根节点', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page.locator('#app')).toBeVisible();
|
||||
await page.goto('/', { waitUntil: 'domcontentloaded', timeout: 60_000 });
|
||||
await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 });
|
||||
});
|
||||
|
||||
test('带伪造 unionid/status 的入口不应导致白屏', async ({ page }) => {
|
||||
await page.goto('/?unionid=fake-wx-unionid-e2e&status=2', {
|
||||
waitUntil: 'domcontentloaded',
|
||||
timeout: 30_000,
|
||||
timeout: 60_000,
|
||||
});
|
||||
await expect(page.locator('#app')).toBeVisible({ timeout: 30_000 });
|
||||
await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 });
|
||||
});
|
||||
|
||||
test('page_path 内嵌他人 unionid 时应被剥离(最终 URL 不含该串)', async ({ page }) => {
|
||||
@@ -20,9 +20,9 @@ test.describe('music-room shell', () => {
|
||||
const pagePath = encodeURIComponent(`/?unionid=${poison}&status=2`);
|
||||
await page.goto(`/?page_path=${pagePath}`, {
|
||||
waitUntil: 'domcontentloaded',
|
||||
timeout: 30_000,
|
||||
timeout: 60_000,
|
||||
});
|
||||
await page.waitForURL((u) => !u.toString().includes(poison), { timeout: 30_000 });
|
||||
await page.waitForURL((u) => !u.toString().includes(poison), { timeout: 60_000 });
|
||||
await expect(page.locator('#app')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user