Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
TEST_PASSWORD_BCSC: ${{ secrets.TEST_PASSWORD_BCSC }}
TEST_USERNAME_IDIR: ${{ secrets.TEST_USERNAME_IDIR }}
TEST_PASSWORD_IDIR: ${{ secrets.TEST_PASSWORD_IDIR }}
BASE_URL_DEV: ${{ secrets.BASE_URL_DEV }}
BASE_URL_TEST: ${{ secrets.BASE_URL_TEST }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
10 changes: 10 additions & 0 deletions web/pay-ui/test-automation/globalSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@

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

// In CI, pick BASE_URL based on ENV_NAME
if (process.env.BASE_URL_TEST || process.env.BASE_URL_DEV) {
process.env.BASE_URL = envName === 'test'
? process.env.BASE_URL_TEST
: process.env.BASE_URL_DEV;
console.log(`Global setup: Using BASE_URL for '${envName}': ${process.env.BASE_URL}`);
return { envName, envFilePath };
}

// Locally, load from env file
if (!fs.existsSync(envFilePath)) {
throw new Error(`Environment file not found: ${envFilePath}`);
}
Expand Down Expand Up @@ -102,7 +112,7 @@
} catch (e) {
// ignore - not all auth flows land on /unauthorized
}

Check failure on line 115 in web/pay-ui/test-automation/globalSetup.js

View workflow job for this annotation

GitHub Actions / pay-ui-ci / linting-pnpm (24, 10.0.0)

'e' is defined but never used
console.log('Global setup: Login completed, URL:', page.url());

const authFileName = `.auth-${loginType}.json`;
Expand Down
Loading