diff --git a/backend/.env.test b/backend/.env.test index 4444ec29..fb94aa09 100644 --- a/backend/.env.test +++ b/backend/.env.test @@ -13,8 +13,10 @@ DWENGO_DB_NAME=":memory:" DWENGO_DB_UPDATE=true DWENGO_AUTH_STUDENT_URL=http://localhost:7080/realms/student +DWENGO_AUTH_STUDENT_CLIENT_ID=dwengo DWENGO_AUTH_STUDENT_JWKS_ENDPOINT=http://localhost:7080/realms/student/protocol/openid-connect/certs DWENGO_AUTH_TEACHER_URL=http://localhost:7080/realms/teacher +DWENGO_AUTH_TEACHER_CLIENT_ID=dwengo DWENGO_AUTH_TEACHER_JWKS_ENDPOINT=http://localhost:7080/realms/teacher/protocol/openid-connect/certs -DWENGO_CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000 +DWENGO_CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000,http://localhost:9876,* diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index edf774cf..a4e940f5 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -98,27 +98,24 @@ export default defineConfig({ /* Run your local dev server before starting the tests */ webServer: [ + // Assuming the idp is already running (because it is slow) { - command: process.env.CI ? "npm run preview" : "npm run dev", + /* Frontend */ + command: `VITE_API_BASE_URL='http://localhost:9876/api' ${process.env.CI ? "npm run preview" : "npm run dev"}`, port: process.env.CI ? 4173 : 5173, + timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, { - command: "cd ../ && docker compose up", - reuseExistingServer: false, - gracefulShutdown: { - signal: "SIGTERM", - timeout: 5000, - }, - }, - { - command: process.env.CI ? "cd ../ && npm run dev -w backend" : "cd ../ && npm run start -w backend", - port: 3000, + /* Backend */ + command: ` + cd .. \ + && npx tsc --build common/tsconfig.json \ + && cd backend \ + && npx tsx --env-file=./.env.test ./tool/startTestApp.ts + `, + port: 9876, reuseExistingServer: !process.env.CI, - }, - { - command: "wait-on http://localhost:7080", - timeout: 120000, - }, + } ], });