test(e2e): update e2e tests and auth tokens

- Update E2E test files with latest authentication tokens
- Improve test stability and error handling
- Update pytest configuration
- Enhance gateway direct test with settings integration
This commit is contained in:
张翔
2026-04-23 16:35:57 +08:00
parent f590c40c21
commit 0d0b4decc3
14 changed files with 1327 additions and 151 deletions
+9 -7
View File
@@ -12,15 +12,17 @@ test.describe('基础UI功能测试', () => {
expect(title).toContain('Novalon');
});
// 测试2: 登录页面渲染
await test.step('验证登录页面元素', async () => {
await page.goto('/login');
// 测试2: 验证已登录状态
await test.step('验证登录状态', async () => {
await page.goto('/dashboard');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(3000);
// 验证登录表单元素
await expect(page.locator('input[type="text"]')).toBeVisible();
await expect(page.locator('input[type="password"]')).toBeVisible();
await expect(page.locator('button:has-text("登录")')).toBeVisible();
// 验证Dashboard页面元素
await expect(page.locator('.el-menu').first()).toBeVisible({ timeout: 15000 });
const userButton = page.getByRole('button', { name: 'admin' });
await expect(userButton).toBeVisible({ timeout: 15000 });
});
// 测试3: 页面导航