test: E2E 测试用例更新与新增
- 更新 Page Object 模型适配新字段名 - 新增 UAT 测试套件与 journey 测试用例 - 优化测试辅助工具与数据工厂 - 更新 playwright 认证状态
This commit is contained in:
@@ -100,7 +100,7 @@ export class TestDataCleanup {
|
||||
await this.page.goto('/users');
|
||||
await this.page.waitForLoadState('networkidle', { timeout: 10000 });
|
||||
|
||||
const searchInput = this.page.locator('input[placeholder*="搜索"], input[name*="keyword"], .el-input__inner').first();
|
||||
const searchInput = this.page.locator('input[placeholder*="搜索"], input[name*="keyword"], .ant-input__inner').first();
|
||||
await searchInput.fill(username);
|
||||
|
||||
const searchButton = this.page.getByRole('button', { name: '搜索' }).or(this.page.locator('button:has-text("搜索")'));
|
||||
@@ -111,11 +111,11 @@ export class TestDataCleanup {
|
||||
const rowCount = await userRow.count();
|
||||
|
||||
if (rowCount > 0) {
|
||||
const deleteButton = userRow.locator('.delete-button, .el-button--danger').first();
|
||||
const deleteButton = userRow.locator('.delete-button, .ant-btn--danger').first();
|
||||
await deleteButton.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.el-button--primary:has-text("确定")'));
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.ant-btn--primary:has-text("确定")'));
|
||||
await confirmButton.click();
|
||||
await this.page.waitForTimeout(1500);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ export class TestDataCleanup {
|
||||
await this.page.goto('/roles');
|
||||
await this.page.waitForLoadState('networkidle', { timeout: 10000 });
|
||||
|
||||
const searchInput = this.page.locator('input[placeholder*="搜索"], input[name*="keyword"], .el-input__inner').first();
|
||||
const searchInput = this.page.locator('input[placeholder*="搜索"], input[name*="keyword"], .ant-input__inner').first();
|
||||
await searchInput.fill(roleName);
|
||||
|
||||
const searchButton = this.page.getByRole('button', { name: '搜索' }).or(this.page.locator('button:has-text("搜索")'));
|
||||
@@ -140,11 +140,11 @@ export class TestDataCleanup {
|
||||
const rowCount = await roleRow.count();
|
||||
|
||||
if (rowCount > 0) {
|
||||
const deleteButton = roleRow.locator('.delete-button, .el-button--danger').first();
|
||||
const deleteButton = roleRow.locator('.delete-button, .ant-btn--danger').first();
|
||||
await deleteButton.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.el-button--primary:has-text("确定")'));
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.ant-btn--primary:has-text("确定")'));
|
||||
await confirmButton.click();
|
||||
await this.page.waitForTimeout(1500);
|
||||
}
|
||||
@@ -162,11 +162,11 @@ export class TestDataCleanup {
|
||||
const rowCount = await menuRow.count();
|
||||
|
||||
if (rowCount > 0) {
|
||||
const deleteButton = menuRow.locator('.delete-button, .el-button--danger').first();
|
||||
const deleteButton = menuRow.locator('.delete-button, .ant-btn--danger').first();
|
||||
await deleteButton.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.el-button--primary:has-text("确定")'));
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.ant-btn--primary:has-text("确定")'));
|
||||
await confirmButton.click();
|
||||
await this.page.waitForTimeout(1500);
|
||||
}
|
||||
@@ -184,11 +184,11 @@ export class TestDataCleanup {
|
||||
const rowCount = await dictRow.count();
|
||||
|
||||
if (rowCount > 0) {
|
||||
const deleteButton = dictRow.locator('.delete-button, .el-button--danger').first();
|
||||
const deleteButton = dictRow.locator('.delete-button, .ant-btn--danger').first();
|
||||
await deleteButton.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.el-button--primary:has-text("确定")'));
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.ant-btn--primary:has-text("确定")'));
|
||||
await confirmButton.click();
|
||||
await this.page.waitForTimeout(1500);
|
||||
}
|
||||
@@ -206,11 +206,11 @@ export class TestDataCleanup {
|
||||
const rowCount = await dictRow.count();
|
||||
|
||||
if (rowCount > 0) {
|
||||
const deleteButton = dictRow.locator('.delete-button, .el-button--danger').first();
|
||||
const deleteButton = dictRow.locator('.delete-button, .ant-btn--danger').first();
|
||||
await deleteButton.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.el-button--primary:has-text("确定")'));
|
||||
const confirmButton = this.page.getByRole('button', { name: '确定' }).or(this.page.locator('.ant-btn--primary:has-text("确定")'));
|
||||
await confirmButton.click();
|
||||
await this.page.waitForTimeout(1500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user