refactor(domain): 将领域模型移动到common模块
重构项目结构,将分散在各模块的领域模型统一移动到manage-common模块 更新相关依赖和引用路径 调整docker-compose配置和测试标记 添加新的Playwright测试配置 优化Dockerfile构建过程
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('系统基础功能 E2E 测试', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
});
|
||||
|
||||
test('首页加载测试', async ({ page }) => {
|
||||
await expect(page).toHaveTitle(/Novalon 管理系统/);
|
||||
await expect(page.locator('#app')).toBeVisible();
|
||||
});
|
||||
|
||||
test('登录页面访问测试', async ({ page }) => {
|
||||
await page.click('text=登录');
|
||||
await expect(page).toHaveURL(/.*login/);
|
||||
await expect(page.locator('input[type="text"]')).toBeVisible();
|
||||
await expect(page.locator('input[type="password"]')).toBeVisible();
|
||||
});
|
||||
|
||||
test('后端健康检查', async ({ request }) => {
|
||||
const response = await request.get('http://localhost:8084/actuator/health');
|
||||
expect(response.status()).toBe(200);
|
||||
const body = await response.json();
|
||||
expect(body.status).toBe('UP');
|
||||
});
|
||||
|
||||
test('数据库连接检查', async ({ request }) => {
|
||||
const response = await request.get('http://localhost:8084/actuator/health');
|
||||
expect(response.status()).toBe(200);
|
||||
const body = await response.json();
|
||||
expect(body.components.r2dbc.status).toBe('UP');
|
||||
expect(body.components.r2dbc.details.database).toBe('PostgreSQL');
|
||||
});
|
||||
|
||||
test('前端页面可访问性', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page.locator('#app')).toBeVisible();
|
||||
const title = await page.title();
|
||||
expect(title).toContain('Novalon 管理系统');
|
||||
});
|
||||
|
||||
test('API代理配置验证', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
const response = await page.request.get('http://localhost:3002/api/actuator/health');
|
||||
expect(response.status()).toBe(401);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
fullyParallel: true,
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
reporter: 'html',
|
||||
use: {
|
||||
baseURL: 'http://localhost:3002',
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'] },
|
||||
},
|
||||
],
|
||||
});
|
||||
Generated
+3528
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@ export default defineConfig({
|
||||
port: 3001,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
target: 'http://localhost:8084',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user