test: E2E 测试用例更新与新增
- 更新 Page Object 模型适配新字段名 - 新增 UAT 测试套件与 journey 测试用例 - 优化测试辅助工具与数据工厂 - 更新 playwright 认证状态
This commit is contained in:
@@ -57,12 +57,12 @@ export class TestStabilityHelper {
|
||||
|
||||
async handleModal(): Promise<void> {
|
||||
try {
|
||||
const modal = this.page.locator('.el-dialog, .el-message-box');
|
||||
const modal = this.page.locator('.ant-modal, .ant-message-box');
|
||||
const isVisible = await modal.isVisible({ timeout: 2000 });
|
||||
|
||||
if (isVisible) {
|
||||
const confirmButton = modal.locator('.el-button--primary').first();
|
||||
const cancelButton = modal.locator('.el-button--default').first();
|
||||
const confirmButton = modal.locator('.ant-btn--primary').first();
|
||||
const cancelButton = modal.locator('.ant-btn--default').first();
|
||||
|
||||
if (await confirmButton.isVisible({ timeout: 1000 })) {
|
||||
await confirmButton.click();
|
||||
@@ -77,7 +77,7 @@ export class TestStabilityHelper {
|
||||
|
||||
async waitForLoadingComplete(): Promise<void> {
|
||||
try {
|
||||
const loading = this.page.locator('.el-loading-mask, .loading');
|
||||
const loading = this.page.locator('.ant-spin-container, .loading');
|
||||
await loading.waitFor({ state: 'hidden', timeout: 10000 });
|
||||
} catch (error) {
|
||||
console.log('Loading element not found or timeout');
|
||||
@@ -95,7 +95,7 @@ export class TestStabilityHelper {
|
||||
const table = this.page.locator(tableSelector);
|
||||
await expect(table).toBeVisible({ timeout: 10000 });
|
||||
|
||||
const rows = table.locator('.el-table__row');
|
||||
const rows = table.locator('.ant-table__row');
|
||||
const rowCount = await rows.count();
|
||||
expect(rowCount).toBeGreaterThanOrEqual(minRows);
|
||||
});
|
||||
@@ -125,7 +125,7 @@ export class TestStabilityHelper {
|
||||
|
||||
async getErrorMessage(): Promise<string | null> {
|
||||
try {
|
||||
const errorElement = this.page.locator('.el-message--error, .error-message');
|
||||
const errorElement = this.page.locator('.ant-message-error, .error-message');
|
||||
const isVisible = await errorElement.isVisible({ timeout: 2000 });
|
||||
|
||||
if (isVisible) {
|
||||
|
||||
Reference in New Issue
Block a user