feat: 重构测试框架并优化代码结构

refactor(tests): 将e2e_tests迁移到tests_suite和api_integration_tests
style: 为Java类添加文档注释
docs: 更新.gitignore和配置文件
test: 添加性能测试和Playwright测试脚本
chore: 清理旧测试文件和配置
This commit is contained in:
张翔
2026-03-14 13:49:39 +08:00
parent 9e187f42e5
commit c50ccd258f
178 changed files with 8655 additions and 2519 deletions
@@ -0,0 +1,42 @@
import { test, expect } from '@playwright/test';
test.describe('系统配置 E2E 测试', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login');
await page.fill('input[placeholder*="用户名"]', 'admin');
await page.fill('input[type="password"]', 'admin123');
await page.click('button:has-text("登录")');
await page.waitForURL('**/dashboard');
});
test('查看系统配置', async ({ page }) => {
await page.click('text=系统配置');
await page.waitForURL('**/config');
await expect(page.locator('table')).toBeVisible();
await expect(page.locator('table tbody tr')).toHaveCount(10);
});
test('编辑系统配置', async ({ page }) => {
await page.click('text=系统配置');
await page.waitForURL('**/config');
await page.click('table tbody tr:first-child .edit-button');
await page.fill('input[name="configValue"]', 'test_value_123');
await page.click('button[type="submit"]');
await expect(page.locator('.success-message')).toBeVisible();
});
test('搜索配置项', async ({ page }) => {
await page.click('text=系统配置');
await page.waitForURL('**/config');
await page.fill('input[name="keyword"]', 'system');
await page.click('button[type="search"]');
await expect(page.locator('table')).toContainText('system');
});
});