Skip to content

Commit f02e19d

Browse files
committed
[javascript] Adding SELENIUM_MANAGER_BASE_PATH env var to use Selenium Manager for tests
1 parent e73a62b commit f02e19d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ build --test_env=LOCALAPPDATA
5454
build --test_env=MOZ_HEADLESS
5555
build --test_env=PATH # Remove once browser pinning works
5656
build --test_env=SELENIUM_BROWSER
57+
build --test_env=SELENIUM_MANAGER_BASE_PATH
5758
build --test_env=TRAVIS
5859
build --test_env=PYTHON_VERSION
5960

javascript/node/selenium-webdriver/common/seleniumManager.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ function getBinary() {
4747
const file =
4848
directory === 'windows' ? 'selenium-manager.exe' : 'selenium-manager'
4949

50-
const filePath = path.join(__dirname, '..', '/bin', directory, file)
50+
let seleniumManagerBasePath
51+
if (process.env.SELENIUM_MANAGER_BASE_PATH) {
52+
seleniumManagerBasePath = process.env.SELENIUM_MANAGER_BASE_PATH
53+
} else {
54+
seleniumManagerBasePath = path.join(__dirname, '..', '/bin')
55+
}
56+
console.log(seleniumManagerBasePath)
57+
58+
const filePath = path.join(seleniumManagerBasePath, directory, file)
5159

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

0 commit comments

Comments
 (0)