This repository has been archived on 2025-06-18. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
casino/frontend/playwright.config.ts
jank e828efdfa7
All checks were successful
Pull Request Labeler / labeler (pull_request_target) Successful in 5s
CI / Get Changed Files (pull_request) Successful in 11s
Label PRs based on size / Check PR size (pull_request) Successful in 11s
Claude PR Review / claude-code (pull_request) Successful in 33s
CI / eslint (pull_request) Successful in 40s
CI / oxlint (pull_request) Successful in 46s
CI / prettier (pull_request) Successful in 50s
CI / Docker backend validation (pull_request) Successful in 34s
CI / Docker frontend validation (pull_request) Successful in 1m27s
CI / test-build (pull_request) Successful in 1m32s
CI / Checkstyle Main (pull_request) Successful in 1m43s
CI / Backend Tests (pull_request) Successful in 2m31s
CI / Playwright (pull_request) Successful in 2m18s
chore: Add some tests
2025-06-05 13:16:53 +02:00

49 lines
1.6 KiB
TypeScript

// playwright.config.ts (or .js)
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
// This baseURL is for your frontend tests.
// Tests hitting the backend directly will use absolute URLs.
baseURL: 'http://localhost:4200',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
],
webServer: {
command:
'cd .. && conc -n "frontend,backend" "cd frontend && bun run start" "cd backend/ && watchexec -r -e java ./gradlew :bootRun"',
// **IMPORTANT CHANGE HERE:**
// Point to your backend's health check endpoint.
// 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,
// **INCREASE TIMEOUT SIGNIFICANTLY**
// Gradle + Spring Boot can take a while, especially on first run or in CI.
// Adjust as needed, e.g., 3-5 minutes.
timeout: 300 * 1000, // 300 seconds = 5 minutes
stdout: 'pipe', // Good for capturing logs in CI reports
stderr: 'pipe',
// Optional: If your server needs specific environment variables
// env: {
// SPRING_PROFILES_ACTIVE: 'test', // Example for Spring Boot
// },
},
});