Compare commits
1 commit
9a1cf21b7c
...
7f1faa39be
Author | SHA1 | Date | |
---|---|---|---|
7f1faa39be |
1 changed files with 15 additions and 21 deletions
|
@ -6,9 +6,11 @@ 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, // Good for CI to often limit workers
|
workers: process.env.CI ? 1 : undefined,
|
||||||
reporter: 'html',
|
reporter: 'html',
|
||||||
use: {
|
use: {
|
||||||
|
// This baseURL is for your frontend tests.
|
||||||
|
// Tests hitting the backend directly will use absolute URLs.
|
||||||
baseURL: 'http://localhost:4200',
|
baseURL: 'http://localhost:4200',
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
},
|
},
|
||||||
|
@ -29,30 +31,22 @@ 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
|
// **IMPORTANT CHANGE HERE:**
|
||||||
url: 'http://localhost:4200',
|
// Point to your backend's health check endpoint.
|
||||||
// In CI, always start a new server. Locally, you might reuse an existing one.
|
// If your Spring Boot app uses Actuator, it might be /actuator/health
|
||||||
|
// Verify the correct health endpoint for your backend.
|
||||||
|
url: 'http://localhost:8080/health', // Or "http://localhost:8080/actuator/health"
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
// **ADJUSTMENT 1: Increase timeout**
|
// **INCREASE TIMEOUT SIGNIFICANTLY**
|
||||||
// How long to wait for the server to start (in milliseconds).
|
// Gradle + Spring Boot can take a while, especially on first run or in CI.
|
||||||
// Default is 60000 (1 minute). Adjust this based on your server's needs.
|
// Adjust as needed, e.g., 3-5 minutes.
|
||||||
// Example: 180 seconds (3 minutes)
|
timeout: 300 * 1000, // 300 seconds = 5 minutes
|
||||||
timeout: 180 * 1000,
|
stdout: 'pipe', // Good for capturing logs in CI reports
|
||||||
// **ADJUSTMENT 2: Handle server output for debugging in CI**
|
stderr: 'pipe',
|
||||||
// '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
|
// Optional: If your server needs specific environment variables
|
||||||
// env: {
|
// env: {
|
||||||
// NODE_ENV: 'development', // Or whatever your server needs
|
// SPRING_PROFILES_ACTIVE: 'test', // Example for Spring Boot
|
||||||
// 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)
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue