be5d5ede90
refactor: 重构后端查询逻辑和API响应处理 fix: 修复用户角色更新和文件上传问题 test: 添加前端性能测试脚本和E2E测试用例 chore: 更新依赖版本和配置文件 docs: 添加环境检查脚本和测试文档 style: 统一表格标签样式和路由命名 perf: 优化前端页面加载速度和响应时间
28 lines
914 B
TypeScript
28 lines
914 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('基础功能测试', () => {
|
|
test('后端健康检查', async ({ request }) => {
|
|
const response = await request.get('http://localhost:8084/actuator/health');
|
|
expect(response.ok()).toBeTruthy();
|
|
|
|
const health = await response.json();
|
|
expect(health.status).toBe('UP');
|
|
});
|
|
|
|
test('前端首页加载', async ({ page }) => {
|
|
await page.goto('/');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
await expect(page).toHaveURL(/.*login.*/);
|
|
});
|
|
|
|
test('登录页面可访问', async ({ page }) => {
|
|
await page.goto('/login');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
await expect(page.locator('h2')).toContainText('登录');
|
|
await expect(page.locator('input[placeholder*="用户名"]')).toBeVisible();
|
|
await expect(page.locator('input[placeholder*="密码"]')).toBeVisible();
|
|
});
|
|
});
|