skillhub/web/playwright.config.ts
dongmucat 50a6c4b7fe test(e2e,ci): migrate web e2e to real API and add PR e2e workflow (#198)
* chore(workflow): align local hooks and e2e guidance

* test(e2e): expand reusable api mock helpers

* test(skill): stabilize share button e2e assertions

* chore(test): add e2e make target and tune playwright workers

* test(web): expand e2e coverage and smoke suite

* test(e2e): migrate to real API flows and add request-based data builder

* ci(e2e): add PR workflow for real-service frontend e2e

* ci(e2e): install playwright chromium in PR workflow

* test(e2e): relax timeout and force single worker in CI

* test(e2e): stabilize not-found assertions and harden CI session bootstrap

* chore(agents): align tester role with web/e2e workflow
2026-04-01 14:41:23 +08:00

28 lines
685 B
TypeScript

import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './e2e',
fullyParallel: false,
timeout: process.env.CI ? 90_000 : 45_000,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : 2,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'on',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'pnpm exec vite --host 127.0.0.1 --port 3000 --strictPort',
url: 'http://localhost:3000',
reuseExistingServer: true,
timeout: 120000,
},
})