feat: extend operation log service and repository with pagination support
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Headless模式测试', () => {
|
||||
|
||||
test('测试1: 使用headless=false访问前端', async ({ page }) => {
|
||||
console.log('测试1: 使用headless=false访问前端');
|
||||
|
||||
try {
|
||||
const response = await page.goto('http://localhost:3001/login', {
|
||||
waitUntil: 'domcontentloaded',
|
||||
timeout: 10000
|
||||
});
|
||||
console.log('响应状态:', response.status());
|
||||
console.log('页面标题:', await page.title());
|
||||
expect(response.status()).toBe(200);
|
||||
} catch (error) {
|
||||
console.error('访问失败:', error);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
test('测试2: 使用更长的超时时间', async ({ page }) => {
|
||||
console.log('测试2: 使用更长的超时时间');
|
||||
|
||||
try {
|
||||
const response = await page.goto('http://localhost:3001/login', {
|
||||
waitUntil: 'networkidle',
|
||||
timeout: 60000
|
||||
});
|
||||
console.log('响应状态:', response.status());
|
||||
console.log('页面标题:', await page.title());
|
||||
expect(response.status()).toBe(200);
|
||||
} catch (error) {
|
||||
console.error('访问失败:', error);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
test('测试3: 使用不同的waitUntil策略', async ({ page }) => {
|
||||
console.log('测试3: 使用waitUntil=commit');
|
||||
|
||||
try {
|
||||
const response = await page.goto('http://localhost:3001/login', {
|
||||
waitUntil: 'commit',
|
||||
timeout: 10000
|
||||
});
|
||||
console.log('响应状态:', response.status());
|
||||
console.log('页面标题:', await page.title());
|
||||
expect(response.status()).toBe(200);
|
||||
} catch (error) {
|
||||
console.error('访问失败:', error);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user