@@ -41,6 +41,7 @@ const remote = require('../remote')
4141const safari = require ( '../safari' )
4242const { Browser } = require ( '../lib/capabilities' )
4343const { Builder } = require ( '../index' )
44+ const { getPath } = require ( '../common/driverFinder' )
4445
4546/**
4647 * Describes a browser targeted by a {@linkplain suite test suite}.
@@ -116,20 +117,21 @@ function getBrowsersToTestFromEnv() {
116117function getAvailableBrowsers ( ) {
117118 info ( `Searching for WebDriver executables installed on the current system...` )
118119
120+ getPath ( safari . Options )
119121 let targets = [
120- [ chrome . locateSynchronously , Browser . CHROME ] ,
121- [ edge . locateSynchronously , Browser . EDGE ] ,
122- [ firefox . locateSynchronously , Browser . FIREFOX ] ,
123- [ ie . locateSynchronously , Browser . INTERNET_EXPLORER ] ,
124- [ safari . locateSynchronously , Browser . SAFARI ] ,
122+ [ getPath ( chrome . Options ) , Browser . CHROME ] ,
123+ [ getPath ( edge . Options ) , Browser . EDGE ] ,
124+ [ getPath ( firefox . Options ) , Browser . FIREFOX ] ,
125+ [ getPath ( ie . Options ) , Browser . INTERNET_EXPLORER ] ,
126+ [ getPath ( safari . Options ) , Browser . SAFARI ] ,
125127 ]
126128
127129 let availableBrowsers = [ ]
128130 for ( let pair of targets ) {
129- const fn = pair [ 0 ]
131+ const driverPath = pair [ 0 ]
130132 const name = pair [ 1 ]
131133 const capabilities = pair [ 2 ]
132- if ( fn ( ) ) {
134+ if ( driverPath . length > 0 ) {
133135 info ( `... located ${ name } ` )
134136 availableBrowsers . push ( { name, capabilities } )
135137 }
0 commit comments