|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
// playwright.config.ts (or .js)
|
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
export default defineConfig({
|
|
|
@ -5,7 +6,7 @@ export default defineConfig({
|
|
|
|
fullyParallel: true,
|
|
|
|
fullyParallel: true,
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
retries: process.env.CI ? 2 : 0,
|
|
|
|
retries: process.env.CI ? 2 : 0,
|
|
|
|
workers: process.env.CI ? 1 : undefined,
|
|
|
|
workers: process.env.CI ? 1 : undefined, // Good for CI to often limit workers
|
|
|
|
reporter: 'html',
|
|
|
|
reporter: 'html',
|
|
|
|
use: {
|
|
|
|
use: {
|
|
|
|
baseURL: 'http://localhost:4200',
|
|
|
|
baseURL: 'http://localhost:4200',
|
|
|
@ -17,12 +18,10 @@ export default defineConfig({
|
|
|
|
name: 'chromium',
|
|
|
|
name: 'chromium',
|
|
|
|
use: { ...devices['Desktop Chrome'] },
|
|
|
|
use: { ...devices['Desktop Chrome'] },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: 'firefox',
|
|
|
|
name: 'firefox',
|
|
|
|
use: { ...devices['Desktop Firefox'] },
|
|
|
|
use: { ...devices['Desktop Firefox'] },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: 'webkit',
|
|
|
|
name: 'webkit',
|
|
|
|
use: { ...devices['Desktop Safari'] },
|
|
|
|
use: { ...devices['Desktop Safari'] },
|
|
|
@ -30,9 +29,30 @@ export default defineConfig({
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
webServer: {
|
|
|
|
webServer: {
|
|
|
|
|
|
|
|
// Your command to start the server
|
|
|
|
command: 'cd .. && just start',
|
|
|
|
command: 'cd .. && just start',
|
|
|
|
|
|
|
|
// URL to poll to check if the server is ready
|
|
|
|
url: 'http://localhost:4200',
|
|
|
|
url: 'http://localhost:4200',
|
|
|
|
|
|
|
|
// In CI, always start a new server. Locally, you might reuse an existing one.
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
|
|
|
|
// **ADJUSTMENT 1: Increase timeout**
|
|
|
|
|
|
|
|
// How long to wait for the server to start (in milliseconds).
|
|
|
|
|
|
|
|
// Default is 60000 (1 minute). Adjust this based on your server's needs.
|
|
|
|
|
|
|
|
// Example: 180 seconds (3 minutes)
|
|
|
|
|
|
|
|
timeout: 180 * 1000,
|
|
|
|
|
|
|
|
// **ADJUSTMENT 2: Handle server output for debugging in CI**
|
|
|
|
|
|
|
|
// 'pipe': Captures stdout and stderr. Playwright can include this in reports
|
|
|
|
|
|
|
|
// or when an error occurs during server startup.
|
|
|
|
|
|
|
|
// 'inherit': Streams stdout/stderr directly to the terminal. Useful for live debugging.
|
|
|
|
|
|
|
|
// 'ignore': Ignores server output.
|
|
|
|
|
|
|
|
stdout: 'pipe', // or 'inherit' if you want to see logs live in CI
|
|
|
|
|
|
|
|
stderr: 'pipe', // or 'inherit'
|
|
|
|
|
|
|
|
// Optional: If your server needs specific environment variables
|
|
|
|
|
|
|
|
// env: {
|
|
|
|
|
|
|
|
// NODE_ENV: 'development', // Or whatever your server needs
|
|
|
|
|
|
|
|
// PORT: '4200', // Though your command likely handles this
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// Optional: If your server takes time to shut down gracefully
|
|
|
|
|
|
|
|
// killTimeout: 30000, // Time to wait for server to gracefully exit (default 5000ms)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|