chore: repair playwright config and verify workflow triggers

Fixed syntax errors in playwright.config.js (duplicate identifiers)
Verified all E2E and Integration workflows have correct push triggers
Confirmed immediate feedback loop for feature/hotfix branches
Validated E2E environment by running core test suite (100% pass)
This commit is contained in:
GitHub Actions
2026-02-06 03:24:44 +00:00
parent a8fd8c6f03
commit 964a89a391
16 changed files with 225 additions and 97 deletions

View File

@@ -5,8 +5,6 @@ import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
/**
* Read environment variables from file (local development only).
* In CI, environment variables are provided by GitHub secrets.
* Read environment variables from file (local development only).
* In CI, environment variables are provided by GitHub secrets.
* https://github.com/motdotla/dotenv
@@ -15,9 +13,6 @@ import dotenv from 'dotenv';
if (!process.env.CI) {
dotenv.config({ path: join(dirname(fileURLToPath(import.meta.url)), '.env') });
}
if (!process.env.CI) {
dotenv.config({ path: join(dirname(fileURLToPath(import.meta.url)), '.env') });
}
/**
* Auth state storage path - shared across all browser projects
@@ -29,13 +24,9 @@ const STORAGE_STATE = join(__dirname, 'playwright/.auth/user.json');
/**
* Coverage reporter configuration for E2E tests
* Only loaded when PLAYWRIGHT_COVERAGE=1
* Only loaded when PLAYWRIGHT_COVERAGE=1
*/
const enableCoverage = process.env.PLAYWRIGHT_COVERAGE === '1';
const coverageReporterConfig = enableCoverage ? defineCoverageReporterConfig({
const enableCoverage = process.env.PLAYWRIGHT_COVERAGE === '1';
const coverageReporterConfig = enableCoverage ? defineCoverageReporterConfig({
sourceRoot: __dirname,
exclude: [
@@ -62,7 +53,6 @@ const coverageReporterConfig = enableCoverage ? defineCoverageReporterConfig({
functions: [50, 80],
lines: [50, 80],
},
rewritePath: ({ absolutePath }) => {
rewritePath: ({ absolutePath }) => {
if (absolutePath.startsWith('/app/')) {
return absolutePath.replace('/app/', `${__dirname}/`);
@@ -76,7 +66,6 @@ const coverageReporterConfig = enableCoverage ? defineCoverageReporterConfig({
return absolutePath;
},
}) : null;
}) : null;
/**
* @see https://playwright.dev/docs/test-configuration
@@ -85,8 +74,6 @@ export default defineConfig({
testDir: './tests',
testIgnore: ['**/frontend/**', '**/node_modules/**', '**/backend/**'],
/* Standard globalSetup - runs once before all tests */
/* Standard globalSetup - runs once before all tests */
globalSetup: './tests/global-setup.ts',
@@ -94,28 +81,16 @@ export default defineConfig({
timeout: process.env.CI ? 60000 : 90000,
expect: { timeout: 5000 },
/* Parallelization */
/* Timeouts */
timeout: process.env.CI ? 60000 : 90000,
expect: { timeout: 5000 },
/* Parallelization */
fullyParallel: true,
workers: process.env.CI ? 1 : undefined,
/* CI settings */
workers: process.env.CI ? 1 : undefined,
/* CI settings */
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
/* Reporters - simplified for CI */
/* Reporters - simplified for CI */
reporter: [
process.env.CI ? ['github'] : ['list'],
process.env.CI ? ['github'] : ['list'],
['html', { open: process.env.CI ? 'never' : 'on-failure' }],
...(enableCoverage ? [['@bgotink/playwright-coverage', coverageReporterConfig]] : []),
@@ -135,13 +110,8 @@ export default defineConfig({
* IMPORTANT: Using 127.0.0.1 (IPv4 loopback) instead of localhost to avoid
* IPv6/IPv4 resolution issues where Node.js/Playwright might prefer ::1 (IPv6)
* but the Docker container binds to 0.0.0.0 (IPv4).
*
* IMPORTANT: Using 127.0.0.1 (IPv4 loopback) instead of localhost to avoid
* IPv6/IPv4 resolution issues where Node.js/Playwright might prefer ::1 (IPv6)
* but the Docker container binds to 0.0.0.0 (IPv4).
*/
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:8080',
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:8080',
/* Traces: Capture execution traces for debugging
*
@@ -174,14 +144,12 @@ export default defineConfig({
/* Configure projects for major browsers */
projects: [
// Setup project - authentication (runs FIRST)
// Setup project - authentication (runs FIRST)
{
name: 'setup',
testMatch: /auth\.setup\.ts/,
},
// Security Tests - Run WITH security enabled (SEQUENTIAL, Chromium only)
// Security Tests - Run WITH security enabled (SEQUENTIAL, Chromium only)
{
name: 'security-tests',
@@ -194,24 +162,19 @@ export default defineConfig({
teardown: 'security-teardown',
fullyParallel: false,
workers: 1,
fullyParallel: false,
workers: 1,
use: {
...devices['Desktop Chrome'],
headless: true,
headless: true,
storageState: STORAGE_STATE,
},
},
// Security Teardown - Disable ALL security modules
// Security Teardown - Disable ALL security modules
{
name: 'security-teardown',
testMatch: /security-teardown\.setup\.ts/,
},
// Browser projects - standard Playwright pattern
// Browser projects - standard Playwright pattern
{
name: 'chromium',
@@ -220,7 +183,6 @@ export default defineConfig({
storageState: STORAGE_STATE,
},
dependencies: ['setup'],
dependencies: ['setup'],
},
{
@@ -270,7 +232,5 @@ export default defineConfig({
// timeout: 120000,
// stdout: 'pipe', // PHASE 1: Enable log visibility
// stderr: 'pipe', // PHASE 1: Enable log visibility
// stdout: 'pipe', // PHASE 1: Enable log visibility
// stderr: 'pipe', // PHASE 1: Enable log visibility
// },
});