Files
novalon-manage-system/novalon-manage-web/e2e/auth.setup.ts
T
张翔 2971258fa0 chore(frontend): 更新前端配置和依赖
- 更新Dockerfile配置
- 更新测试环境配置
- 更新依赖锁定文件
2026-04-15 23:35:19 +08:00

17 lines
550 B
TypeScript

import { test as setup } from '@playwright/test';
const authFile = 'playwright/.auth/user.json';
setup('authenticate', async ({ page }) => {
await page.goto('/login');
await page.waitForLoadState('networkidle');
await page.locator('input[placeholder*="用户名"]').fill('admin');
await page.locator('input[placeholder*="密码"]').fill('admin123');
await page.locator('button:has-text("登录")').click();
await page.waitForURL('**/dashboard', { timeout: 30000 });
await page.context().storageState({ path: authFile });
});