test: E2E 测试用例更新与新增

- 更新 Page Object 模型适配新字段名
- 新增 UAT 测试套件与 journey 测试用例
- 优化测试辅助工具与数据工厂
- 更新 playwright 认证状态
This commit is contained in:
张翔
2026-05-06 14:17:51 +08:00
committed by zhangxiang
parent 9e635b1483
commit e8f51309e5
47 changed files with 1764 additions and 1226 deletions
@@ -20,19 +20,19 @@ test.describe('数据字典管理完整工作流', () => {
await test.step('点击新增字典按钮', async () => {
await page.locator('button:has-text("新增字典")').click();
await page.waitForSelector('.el-dialog', { state: 'visible', timeout: 5000 });
await page.waitForSelector('.ant-modal', { state: 'visible', timeout: 5000 });
});
await test.step('填写字典信息', async () => {
const dialog = page.locator('.el-dialog');
const dialog = page.locator('.ant-modal');
await dialog.locator('input').first().fill(dictName);
await dialog.locator('input').nth(1).fill(dictType);
});
await test.step('提交字典表单', async () => {
await page.locator('.el-dialog button:has-text("确定")').click();
await page.waitForSelector('.el-dialog', { state: 'hidden', timeout: 10000 });
await expect(page.locator('.el-message--success')).toBeVisible({ timeout: 5000 });
await page.locator('.ant-modal button:has-text("确定")').click();
await page.waitForSelector('.ant-modal', { state: 'hidden', timeout: 10000 });
await expect(page.locator('.ant-message-success')).toBeVisible({ timeout: 5000 });
});
await test.step('验证字典已创建', async () => {
@@ -57,18 +57,18 @@ test.describe('数据字典管理完整工作流', () => {
await test.step('编辑字典', async () => {
const dictRow = page.locator(`tr:has-text("${dictName}")`);
await dictRow.locator('button:has-text("编辑")').click();
await page.waitForSelector('.el-dialog', { state: 'visible', timeout: 5000 });
await page.waitForSelector('.ant-modal', { state: 'visible', timeout: 5000 });
});
await test.step('修改字典信息', async () => {
const dialog = page.locator('.el-dialog');
const dialog = page.locator('.ant-modal');
await dialog.locator('input').first().fill(updatedName);
});
await test.step('提交更新', async () => {
await page.locator('.el-dialog button:has-text("确定")').click();
await page.waitForSelector('.el-dialog', { state: 'hidden', timeout: 10000 });
await expect(page.locator('.el-message--success')).toBeVisible({ timeout: 5000 });
await page.locator('.ant-modal button:has-text("确定")').click();
await page.waitForSelector('.ant-modal', { state: 'hidden', timeout: 10000 });
await expect(page.locator('.ant-message-success')).toBeVisible({ timeout: 5000 });
});
await test.step('验证字典已更新', async () => {
@@ -91,13 +91,13 @@ test.describe('数据字典管理完整工作流', () => {
await test.step('删除字典', async () => {
const dictRow = page.locator(`tr:has-text("更新字典_${timestamp}")`);
await dictRow.locator('button:has-text("删除")').click();
await page.waitForSelector('.el-message-box', { state: 'visible', timeout: 5000 });
await page.waitForSelector('.ant-message-box', { state: 'visible', timeout: 5000 });
});
await test.step('确认删除', async () => {
await page.locator('.el-message-box button:has-text("确定")').click();
await page.waitForSelector('.el-message-box', { state: 'hidden', timeout: 10000 });
await expect(page.locator('.el-message--success')).toBeVisible({ timeout: 5000 });
await page.locator('.ant-message-box button:has-text("确定")').click();
await page.waitForSelector('.ant-message-box', { state: 'hidden', timeout: 10000 });
await expect(page.locator('.ant-message-success')).toBeVisible({ timeout: 5000 });
});
});