test: add E2E tests for contact form security

This commit is contained in:
张翔
2026-03-24 11:41:20 +08:00
parent d6862b0754
commit 89726da2c7
4 changed files with 627 additions and 9 deletions
+12 -9
View File
@@ -4,29 +4,32 @@ export default defineConfig({
testDir: './src/tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 2,
workers: 2,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [
['list'],
['html', { open: 'never' }],
['json', { outputFile: 'test-results/results.json' }],
['junit', { outputFile: 'test-results/junit.xml' }],
['line'],
['list'],
],
timeout: 90000,
timeout: 60000,
expect: {
timeout: 30000,
timeout: 10000,
},
use: {
baseURL: 'http://localhost:3000',
trace: 'retain-on-failure',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
headless: true,
viewport: { width: 1280, height: 720 },
actionTimeout: 30000,
navigationTimeout: 60000,
actionTimeout: 10000,
navigationTimeout: 30000,
},
projects: [
{
name: 'chromium-no-auth',
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],