test: E2E 测试用例更新与新增
- 更新 Page Object 模型适配新字段名 - 新增 UAT 测试套件与 journey 测试用例 - 优化测试辅助工具与数据工厂 - 更新 playwright 认证状态
This commit is contained in:
@@ -21,20 +21,20 @@ 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(configName);
|
||||
await dialog.locator('input').nth(1).fill(configKey);
|
||||
await dialog.locator('input').nth(2).fill(configValue);
|
||||
});
|
||||
|
||||
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 () => {
|
||||
@@ -59,18 +59,18 @@ test.describe('系统配置管理完整工作流', () => {
|
||||
await test.step('编辑配置', async () => {
|
||||
const configRow = page.locator(`tr:has-text("${configName}")`);
|
||||
await configRow.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').nth(2).fill(updatedValue);
|
||||
});
|
||||
|
||||
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 () => {
|
||||
@@ -93,13 +93,13 @@ test.describe('系统配置管理完整工作流', () => {
|
||||
await test.step('删除配置', async () => {
|
||||
const configRow = page.locator(`tr:has-text("${configName}")`);
|
||||
await configRow.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 });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user