Goal
Allow Playwright tests to run automatically without requiring a manually started development server.
Current State
- Tests require
npm run dev to be running before execution.
- A developer must start the server manually.
- Tests target a fixed localhost URL.
- Tests cannot be executed reliably from deployment pipelines.
Target State
- Playwright starts the application automatically.
- Playwright waits until the application is ready.
- Tests run against a configurable URL.
- Tests can execute locally and in CI/CD environments without manual intervention.
Acceptance Criteria
npm run test:e2e works from a clean checkout.
- No manual server startup is required.
- Tests pass locally.
- Tests can be executed from deployment scripts.
- Application URL is configurable through environment variables.
- The test process starts and stops the application automatically.
Suggested Approach
Investigate Playwright's webServer configuration:
export default defineConfig({
webServer: {
command: 'npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI
}
});
Goal
Allow Playwright tests to run automatically without requiring a manually started development server.
Current State
npm run devto be running before execution.Target State
Acceptance Criteria
npm run test:e2eworks from a clean checkout.Suggested Approach
Investigate Playwright's
webServerconfiguration: