From bb14a5a1e385058c1076eda96bd67ae03b8e037c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 15 Jan 2026 03:19:59 +0000 Subject: [PATCH] fix(tests): change console.error to console.log for login failure messages feat(tests): update Playwright configuration to include GitHub reporter and adjust base URL handling --- .github/workflows/docker-build.yml | 2 +- playwright.config.js | 6 ++++-- tests/auth.setup.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 48d73806..28619ed1 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -878,7 +878,7 @@ jobs: - name: Run Playwright E2E tests env: PLAYWRIGHT_BASE_URL: http://localhost:8080 - run: npx playwright test + run: npx playwright test --project=chromium - name: Stop application container if: always() diff --git a/playwright.config.js b/playwright.config.js index 2b718bca..20b08be8 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -38,12 +38,14 @@ export default defineConfig({ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: process.env.CI - ? [['html', { open: 'never' }]] + ? [['github'], ['html', { open: 'never' }]] : [['list'], ['html', { open: 'on-failure' }]], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('')`. */ - baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://100.98.12.109:8080', + // CI sets PLAYWRIGHT_BASE_URL=http://localhost:8080 + // Local development can override via environment variable + baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:8080', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', diff --git a/tests/auth.setup.ts b/tests/auth.setup.ts index c498f604..d509a0ad 100644 --- a/tests/auth.setup.ts +++ b/tests/auth.setup.ts @@ -60,7 +60,7 @@ setup('authenticate', async ({ request, baseURL }) => { if (!loginResponse.ok()) { const errorBody = await loginResponse.text(); - console.error(`Login failed: ${loginResponse.status()} - ${errorBody}`); + console.log(`Login failed: ${loginResponse.status()} - ${errorBody}`); // If login fails and setup wasn't required, the user might already exist with different credentials // This can happen in dev environments