fix: use waitForSelector for error message in login failure tests
This commit is contained in:
@@ -44,7 +44,8 @@ test.describe('系统全面集成测试', () => {
|
|||||||
await loginPage.passwordInput.fill('wrongpassword');
|
await loginPage.passwordInput.fill('wrongpassword');
|
||||||
await loginPage.loginButton.click();
|
await loginPage.loginButton.click();
|
||||||
|
|
||||||
await expect(page.locator('.el-message .el-message__content')).toBeVisible({ timeout: 5000 });
|
await page.waitForSelector('.el-message', { timeout: 5000 });
|
||||||
|
await expect(page.locator('.el-message')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('1.3 不存在的用户登录失败', async ({ page }) => {
|
test('1.3 不存在的用户登录失败', async ({ page }) => {
|
||||||
@@ -53,7 +54,8 @@ test.describe('系统全面集成测试', () => {
|
|||||||
await loginPage.passwordInput.fill('Test@123');
|
await loginPage.passwordInput.fill('Test@123');
|
||||||
await loginPage.loginButton.click();
|
await loginPage.loginButton.click();
|
||||||
|
|
||||||
await expect(page.locator('.el-message .el-message__content')).toBeVisible({ timeout: 5000 });
|
await page.waitForSelector('.el-message', { timeout: 5000 });
|
||||||
|
await expect(page.locator('.el-message')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('1.4 空用户名或密码登录失败', async ({ page }) => {
|
test('1.4 空用户名或密码登录失败', async ({ page }) => {
|
||||||
@@ -71,7 +73,8 @@ test.describe('系统全面集成测试', () => {
|
|||||||
await loginPage.passwordInput.fill('Test@123');
|
await loginPage.passwordInput.fill('Test@123');
|
||||||
await loginPage.loginButton.click();
|
await loginPage.loginButton.click();
|
||||||
|
|
||||||
await expect(page.locator('.el-message .el-message__content')).toBeVisible({ timeout: 5000 });
|
await page.waitForSelector('.el-message', { timeout: 5000 });
|
||||||
|
await expect(page.locator('.el-message')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('1.6 登出功能正常', async ({ page }) => {
|
test('1.6 登出功能正常', async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user