Skip to content

Commit

Permalink
[javascript] Adding SELENIUM_MANAGER_BASE_PATH env var to use Seleniu…
Browse files Browse the repository at this point in the history
…m Manager for tests
  • Loading branch information
diemol committed Apr 20, 2023
1 parent e73a62b commit f02e19d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ build --test_env=LOCALAPPDATA
build --test_env=MOZ_HEADLESS
build --test_env=PATH # Remove once browser pinning works
build --test_env=SELENIUM_BROWSER
build --test_env=SELENIUM_MANAGER_BASE_PATH
build --test_env=TRAVIS
build --test_env=PYTHON_VERSION

Expand Down
10 changes: 9 additions & 1 deletion javascript/node/selenium-webdriver/common/seleniumManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ function getBinary() {
const file =
directory === 'windows' ? 'selenium-manager.exe' : 'selenium-manager'

const filePath = path.join(__dirname, '..', '/bin', directory, file)
let seleniumManagerBasePath
if (process.env.SELENIUM_MANAGER_BASE_PATH) {
seleniumManagerBasePath = process.env.SELENIUM_MANAGER_BASE_PATH
} else {
seleniumManagerBasePath = path.join(__dirname, '..', '/bin')
}
console.log(seleniumManagerBasePath)

const filePath = path.join(seleniumManagerBasePath, directory, file)

if (!fs.existsSync(filePath)) {
throw new Error(`Unable to obtain Selenium Manager`)
Expand Down

0 comments on commit f02e19d

Please sign in to comment.