feat(admin): 添加用户管理相关文件
添加用户管理视图、API和状态管理文件
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
import { test, expect } from '../test-fixtures';
|
||||
|
||||
test.describe('Spring Boot Actuator监控集成测试', () => {
|
||||
test('@smoke 健康检查', async ({ actuatorMonitor }) => {
|
||||
const isHealthy = await actuatorMonitor.checkHealth();
|
||||
expect(isHealthy).toBeTruthy();
|
||||
});
|
||||
|
||||
test('@smoke 获取性能指标', async ({ actuatorMonitor, testLogger }) => {
|
||||
try {
|
||||
const metrics = await actuatorMonitor.getMetrics();
|
||||
testLogger.info(`JVM Memory: ${metrics.jvmMemoryUsed}MB / ${metrics.jvmMemoryMax}MB`);
|
||||
testLogger.info(`GC Pause: ${metrics.jvmGcPause}ms`);
|
||||
|
||||
expect(metrics.jvmMemoryUsed).toBeGreaterThanOrEqual(0);
|
||||
expect(metrics.jvmMemoryMax).toBeGreaterThanOrEqual(0);
|
||||
} catch (error) {
|
||||
testLogger.warn('性能指标端点未启用,跳过测试');
|
||||
test.skip();
|
||||
}
|
||||
});
|
||||
|
||||
test('@smoke 获取JVM信息', async ({ actuatorMonitor, testLogger }) => {
|
||||
try {
|
||||
const jvmInfo = await actuatorMonitor.getJvmInfo();
|
||||
testLogger.info(`Heap Memory: ${jvmInfo.memory.heap.used}MB / ${jvmInfo.memory.heap.max}MB`);
|
||||
testLogger.info(`Threads: ${jvmInfo.threads.live} (Peak: ${jvmInfo.threads.peak})`);
|
||||
|
||||
expect(jvmInfo.memory.heap.used).toBeGreaterThanOrEqual(0);
|
||||
expect(jvmInfo.threads.live).toBeGreaterThanOrEqual(0);
|
||||
} catch (error) {
|
||||
testLogger.warn('JVM信息端点未启用,跳过测试');
|
||||
test.skip();
|
||||
}
|
||||
});
|
||||
|
||||
test('@smoke 获取应用信息', async ({ actuatorMonitor, testLogger }) => {
|
||||
try {
|
||||
const appInfo = await actuatorMonitor.getAppInfo();
|
||||
testLogger.info(`Application: ${appInfo.name} v${appInfo.version}`);
|
||||
|
||||
expect(appInfo.name).toBeTruthy();
|
||||
} catch (error) {
|
||||
testLogger.warn('应用信息端点未返回有效数据');
|
||||
// info 端点可能返回空对象
|
||||
expect(true).toBeTruthy();
|
||||
}
|
||||
});
|
||||
|
||||
test('@smoke 获取环境信息', async ({ actuatorMonitor, testLogger }) => {
|
||||
try {
|
||||
const envInfo = await actuatorMonitor.getEnvInfo();
|
||||
testLogger.info(`Active Profiles: ${envInfo.activeProfiles.join(', ')}`);
|
||||
|
||||
expect(envInfo.activeProfiles.length).toBeGreaterThanOrEqual(0);
|
||||
} catch (error) {
|
||||
testLogger.warn('环境信息端点未启用,跳过测试');
|
||||
test.skip();
|
||||
}
|
||||
});
|
||||
|
||||
test('@regression 等待应用健康状态', async ({ actuatorMonitor }) => {
|
||||
const isHealthy = await actuatorMonitor.waitForHealth(5, 2000);
|
||||
expect(isHealthy).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user