Skip to content

Commit

Permalink
feat: add browser configuration for test environment (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
aytekin-smartcar authored May 1, 2024
1 parent f622ce2 commit 2f15da5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Note: In order to run tests locally the following environment variables would ha
- `E2E_SMARTCAR_CLIENT_SECRET` - Client secret to be used.
- `E2E_SMARTCAR_AMT` - AMT from dashboard for webhooks tests.
- `E2E_SMARTCAR_WEBHOOK_ID` - Webhook ID use in the webhook tests success case.
- `BROWSER` - Web browser for tests (`chrome` or `firefox`, default: `firefox`).


Your application needs to have https://example.com/auth set as a valid redirect URI

Expand Down
4 changes: 3 additions & 1 deletion test/end-to-end/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const helpers = {};
const HEADLESS = isCI || process.env.HEADLESS;
const CLIENT_ID = process.env.E2E_SMARTCAR_CLIENT_ID;
const CLIENT_SECRET = process.env.E2E_SMARTCAR_CLIENT_SECRET;
const BROWSER = process.env.BROWSER || 'firefox';

/* eslint-enable */

if (!CLIENT_ID || !CLIENT_SECRET) {
Expand Down Expand Up @@ -74,7 +76,7 @@ helpers.runAuthFlow = async function(
const driver = new Builder()
.setChromeOptions(chromeOptions)
.setFirefoxOptions(firefoxOptions)
.forBrowser('firefox')
.forBrowser(BROWSER)
.build();

await driver.get(authUrl);
Expand Down

0 comments on commit 2f15da5

Please sign in to comment.