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:
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@@ -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()
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user