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
This commit is contained in:
GitHub Actions
2026-01-15 03:19:59 +00:00
parent 1426c6f885
commit bb14a5a1e3
3 changed files with 6 additions and 4 deletions

View File

@@ -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()

View File

@@ -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',

View File

@@ -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