test: E2E 测试用例更新与新增
- 更新 Page Object 模型适配新字段名 - 新增 UAT 测试套件与 journey 测试用例 - 优化测试辅助工具与数据工厂 - 更新 playwright 认证状态
This commit is contained in:
@@ -6,21 +6,21 @@ test.describe('用户权限边界验证', () => {
|
||||
await page.goto('/users');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await expect(page).toHaveURL(/.*users/);
|
||||
await expect(page.locator('.el-table')).toBeVisible({ timeout: 10000 });
|
||||
await expect(page.locator('.ant-table')).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
|
||||
await test.step('验证可以访问角色管理', async () => {
|
||||
await page.goto('/roles');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await expect(page).toHaveURL(/.*roles/);
|
||||
await expect(page.locator('.el-table')).toBeVisible({ timeout: 10000 });
|
||||
await expect(page.locator('.ant-table')).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
|
||||
await test.step('验证可以访问菜单管理', async () => {
|
||||
await page.goto('/menus');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await expect(page).toHaveURL(/.*menus/);
|
||||
await expect(page.locator('.el-table')).toBeVisible({ timeout: 10000 });
|
||||
await expect(page.locator('.ant-table')).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ test.describe('用户权限边界验证', () => {
|
||||
await page.goto('/dashboard');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const avatarButton = page.locator('.el-avatar').first();
|
||||
const avatarButton = page.locator('.ant-avatar').first();
|
||||
await avatarButton.click({ timeout: 10000 });
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -68,9 +68,9 @@ test.describe('用户权限边界验证', () => {
|
||||
if (await createButton.isVisible()) {
|
||||
await createButton.click();
|
||||
await page.waitForTimeout(2000);
|
||||
const errorMessage = page.locator('.el-message--error');
|
||||
const errorMessage = page.locator('.ant-message-error');
|
||||
const hasError = await errorMessage.isVisible().catch(() => false);
|
||||
expect(hasError || await page.locator('.el-dialog').isVisible()).toBeTruthy();
|
||||
expect(hasError || await page.locator('.ant-modal').isVisible()).toBeTruthy();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -80,7 +80,7 @@ test.describe('用户权限边界验证', () => {
|
||||
await page.goto('/dashboard');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const avatarButton = page.locator('.el-avatar').first();
|
||||
const avatarButton = page.locator('.ant-avatar').first();
|
||||
await avatarButton.click({ timeout: 10000 });
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user