From cba1a0938ce062ce6423d07bd404e15ea0e05164 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Tue, 13 May 2025 13:55:24 +0200 Subject: [PATCH] test: update Playwright configuration to utilize RUN_MODE for headless setting in E2E tests --- .github/workflows/wc-e2e-test.yaml | 2 ++ frontend/webcomponent/playwright.config.ts | 3 ++- frontend/webcomponent/tests/config.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wc-e2e-test.yaml b/.github/workflows/wc-e2e-test.yaml index 93e7324..1cd2884 100644 --- a/.github/workflows/wc-e2e-test.yaml +++ b/.github/workflows/wc-e2e-test.yaml @@ -26,6 +26,8 @@ jobs: run: | cd frontend/webcomponent npm run test:e2e + env: + RUN_MODE: CI - name: Clean up if: always() uses: ./.github/actions/cleanup diff --git a/frontend/webcomponent/playwright.config.ts b/frontend/webcomponent/playwright.config.ts index e19b186..6b8ca54 100644 --- a/frontend/webcomponent/playwright.config.ts +++ b/frontend/webcomponent/playwright.config.ts @@ -1,5 +1,6 @@ // playwright.config.ts import { defineConfig } from '@playwright/test'; +import { RUN_MODE } from './tests/config'; export default defineConfig({ testDir: './tests/e2e', @@ -8,7 +9,7 @@ export default defineConfig({ workers: 1, fullyParallel: false, use: { - headless: false, + headless: RUN_MODE === 'CI', viewport: { width: 1280, height: 720 }, ignoreHTTPSErrors: true, permissions: ['camera', 'microphone'], diff --git a/frontend/webcomponent/tests/config.ts b/frontend/webcomponent/tests/config.ts index c1c2cd3..fcd1571 100644 --- a/frontend/webcomponent/tests/config.ts +++ b/frontend/webcomponent/tests/config.ts @@ -1 +1,2 @@ -export const WEBCOMPONENT_ROOM_URL = 'http://localhost:5080/'; \ No newline at end of file +export const WEBCOMPONENT_ROOM_URL = 'http://localhost:5080/'; +export const RUN_MODE = process.env['RUN_MODE'] || 'development'; \ No newline at end of file