test: drop MOICEN_E2E_EXPECTED_REAL_NAME; assert 欢迎回来 without real_name
Made-with: Cursor
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
const moicenUnionid = process.env.MOICEN_E2E_UNIONID?.trim();
|
||||
const expectedRealName = process.env.MOICEN_E2E_EXPECTED_REAL_NAME?.trim();
|
||||
|
||||
test.describe('已登录用户与串号防护', () => {
|
||||
test.skip(!moicenUnionid, '需要 MOICEN_E2E_UNIONID(Secret 或 .env.e2e)');
|
||||
@@ -55,13 +54,9 @@ test.describe('已登录用户与串号防护', () => {
|
||||
).not.toBeVisible();
|
||||
});
|
||||
|
||||
test('可选:工作台「欢迎回来」展示配置的真实姓名(自己的数据)', async ({
|
||||
test('多角色时选身份后应出现欢迎语(不校验 real_name,避免与业务标识耦合)', async ({
|
||||
page,
|
||||
}) => {
|
||||
test.skip(
|
||||
!expectedRealName,
|
||||
'未设置 MOICEN_E2E_EXPECTED_REAL_NAME 时跳过(与库中 real_name 一致,如 阿难)'
|
||||
);
|
||||
const q = new URLSearchParams({
|
||||
unionid: moicenUnionid!,
|
||||
status: '2',
|
||||
@@ -73,9 +68,6 @@ test.describe('已登录用户与串号防护', () => {
|
||||
if (await page.getByText('请选择您的登录身份').isVisible().catch(() => false)) {
|
||||
await page.locator('.van-grid-item').first().click();
|
||||
}
|
||||
await expect(page.getByText('欢迎回来')).toBeVisible({ timeout: 120_000 });
|
||||
await expect(page.getByText(expectedRealName!)).toBeVisible({
|
||||
timeout: 30_000,
|
||||
});
|
||||
await expect(page.getByText(/欢迎回来/)).toBeVisible({ timeout: 120_000 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user