Skip to content

Commit

Permalink
[javascript] Adding browsers when they are present on the host
Browse files Browse the repository at this point in the history
Fixes #12456
  • Loading branch information
diemol committed Aug 11, 2023
1 parent a4beba5 commit 26e47d1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions javascript/node/selenium-webdriver/testing/index.js
Expand Up @@ -118,19 +118,20 @@ function getAvailableBrowsers() {
info(`Searching for WebDriver executables installed on the current system...`)

let targets = [
[getPath(new chrome.Options()).driverPath, Browser.CHROME],
[getPath(new edge.Options()).driverPath, Browser.EDGE],
[getPath(new firefox.Options()).driverPath, Browser.FIREFOX],
[getPath(new ie.Options()).driverPath, Browser.INTERNET_EXPLORER],
[getPath(new safari.Options()).driverPath, Browser.SAFARI],
[getPath(new chrome.Options()), Browser.CHROME],
[getPath(new edge.Options()), Browser.EDGE],
[getPath(new firefox.Options()), Browser.FIREFOX],
[getPath(new ie.Options()), Browser.INTERNET_EXPLORER],
[getPath(new safari.Options()), Browser.SAFARI],
]

let availableBrowsers = []
for (let pair of targets) {
const driverPath = pair[0]
const driverPath = pair[0].driverPath
const browserPath = pair[0].browserPath
const name = pair[1]
const capabilities = pair[2]
if (driverPath.length > 0) {
if (driverPath.length > 0 && browserPath && browserPath.length > 0) {
info(`... located ${name}`)
availableBrowsers.push({ name, capabilities })
}
Expand Down

0 comments on commit 26e47d1

Please sign in to comment.