feat: 更新UAT测试配置和修复数据库连接问题
refactor(测试): 重构用户数据加载逻辑以支持数组格式 fix(数据库): 修正数据库连接配置和凭证 test: 添加新的导航和用户管理测试场景 docs: 生成UAT测试报告和最终报告 ci: 更新Woodpecker CI配置和测试命令 build: 添加application-test.yml配置文件 chore: 清理旧的测试场景文件
This commit is contained in:
@@ -22,13 +22,24 @@ test.describe('UAT - 登录功能验证', () => {
|
||||
});
|
||||
|
||||
test('登录失败显示错误信息', async ({ page }) => {
|
||||
await loginPage.login('wronguser', 'wrongpassword');
|
||||
await loginPage.goto();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
const usernameInput = page.locator('input[placeholder="请输入用户名"]');
|
||||
const passwordInput = page.locator('input[placeholder="请输入密码"]');
|
||||
const loginButton = page.locator('button:has-text("登录")');
|
||||
|
||||
const errorMessage = await loginPage.getErrorMessage();
|
||||
console.log('错误信息:', errorMessage);
|
||||
await usernameInput.fill('wronguser');
|
||||
await passwordInput.fill('wrongpassword');
|
||||
await loginButton.click();
|
||||
|
||||
expect(errorMessage).toBeTruthy();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
const currentUrl = page.url();
|
||||
console.log('当前URL:', currentUrl);
|
||||
|
||||
const loginFailed = currentUrl.includes('/login');
|
||||
console.log('登录失败:', loginFailed);
|
||||
|
||||
expect(loginFailed).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user