Skip to content

Commit b7938e2

Browse files
committed
A couple more modifications
1 parent fee7aff commit b7938e2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/playwright.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ jobs:
130130
working-directory: test-automation
131131
run: npm run e2e:regression:test
132132
env:
133-
BASE_URL: ${{ needs.build-app.result == 'success' && 'http://localhost:3000' || '' }}
133+
ENV_NAME: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && 'local' || 'test' }}
134+
BASE_URL_LOCAL: 'http://localhost:3000'
134135
- name: Generate Allure Report
135136
if: ${{ !cancelled() }}
136137
working-directory: test-automation

test-automation/globalSetup.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ function loadEnvironmentConfig() {
3434

3535
console.log(`Global setup: Loading environment '${envName}'`)
3636

37+
// Local CI build: use BASE_URL_LOCAL directly
38+
if (envName === 'local' && process.env.BASE_URL_LOCAL) {
39+
process.env.BASE_URL = process.env.BASE_URL_LOCAL
40+
console.log(`Global setup: Using BASE_URL_LOCAL: ${process.env.BASE_URL}`)
41+
return { envName, envFilePath }
42+
}
43+
3744
// In CI, pick BASE_URL based on ENV_NAME
3845
if (process.env.BASE_URL_TEST || process.env.BASE_URL_DEV) {
3946
process.env.BASE_URL = envName === 'test'

0 commit comments

Comments
 (0)