Skip to content

Commit 26e47d1

Browse files
committed
[javascript] Adding browsers when they are present on the host
Fixes #12456
1 parent a4beba5 commit 26e47d1

File tree

1 file changed

+8
-7
lines changed
  • javascript/node/selenium-webdriver/testing

1 file changed

+8
-7
lines changed

javascript/node/selenium-webdriver/testing/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,20 @@ function getAvailableBrowsers() {
118118
info(`Searching for WebDriver executables installed on the current system...`)
119119

120120
let targets = [
121-
[getPath(new chrome.Options()).driverPath, Browser.CHROME],
122-
[getPath(new edge.Options()).driverPath, Browser.EDGE],
123-
[getPath(new firefox.Options()).driverPath, Browser.FIREFOX],
124-
[getPath(new ie.Options()).driverPath, Browser.INTERNET_EXPLORER],
125-
[getPath(new safari.Options()).driverPath, Browser.SAFARI],
121+
[getPath(new chrome.Options()), Browser.CHROME],
122+
[getPath(new edge.Options()), Browser.EDGE],
123+
[getPath(new firefox.Options()), Browser.FIREFOX],
124+
[getPath(new ie.Options()), Browser.INTERNET_EXPLORER],
125+
[getPath(new safari.Options()), Browser.SAFARI],
126126
]
127127

128128
let availableBrowsers = []
129129
for (let pair of targets) {
130-
const driverPath = pair[0]
130+
const driverPath = pair[0].driverPath
131+
const browserPath = pair[0].browserPath
131132
const name = pair[1]
132133
const capabilities = pair[2]
133-
if (driverPath.length > 0) {
134+
if (driverPath.length > 0 && browserPath && browserPath.length > 0) {
134135
info(`... located ${name}`)
135136
availableBrowsers.push({ name, capabilities })
136137
}

0 commit comments

Comments
 (0)