Skip to content

Commit c8534a6

Browse files
JohanLorenzojleyba
authored andcommitted
[js] Prepare for renaming of 'wires' into 'geckodriver' (#2149)
1 parent cc6b935 commit c8534a6

File tree

1 file changed

+11
-9
lines changed
  • javascript/node/selenium-webdriver/firefox

1 file changed

+11
-9
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,21 @@ class Options {
247247
}
248248
}
249249

250-
251-
const WIRES_EXE = process.platform === 'win32' ? 'wires.exe' : 'wires';
250+
// TODO: Wires is the old name of GeckoDriver. Rename to geckodriver, once the
251+
// first renamed version is out at
252+
// https://github.com/mozilla/geckodriver/releases
253+
const GECKO_DRIVER_EXE = process.platform === 'win32' ? 'wires.exe' : 'wires';
252254

253255

254256
/**
255257
* @return {string} .
256258
* @throws {Error}
257259
*/
258-
function findWires() {
259-
let exe = io.findInPath(WIRES_EXE, true);
260+
function findGeckoDriver() {
261+
let exe = io.findInPath(GECKO_DRIVER_EXE, true);
260262
if (!exe) {
261263
throw Error(
262-
'The ' + WIRES_EXE + ' executable could not be found on the current ' +
264+
'The ' + GECKO_DRIVER_EXE + ' executable could not be found on the current ' +
263265
'PATH. Please download the latest version from ' +
264266
'https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/' +
265267
'WebDriver and ensure it can be found on your PATH.');
@@ -272,7 +274,7 @@ function findWires() {
272274
* @param {(string|!Binary)} binary .
273275
* @return {!remote.DriverService} .
274276
*/
275-
function createWiresService(binary) {
277+
function createGeckoDriverService(binary) {
276278
// Firefox's Developer Edition is currently required for Marionette.
277279
let exe;
278280
if (typeof binary === 'string') {
@@ -282,9 +284,9 @@ function createWiresService(binary) {
282284
exe = binary.locate();
283285
}
284286

285-
let wires = findWires();
287+
let geckoDriver = findGeckoDriver();
286288
let port = portprober.findFreePort();
287-
return new remote.DriverService(wires, {
289+
return new remote.DriverService(geckoDriver, {
288290
loopback: true,
289291
port: port,
290292
args: promise.all([exe, port]).then(args => {
@@ -352,7 +354,7 @@ class Driver extends webdriver.WebDriver {
352354

353355
if (caps.get(Capability.MARIONETTE)
354356
|| /^1|true$/i.test(process.env['SELENIUM_MARIONETTE'])) {
355-
let service = createWiresService(binary);
357+
let service = createGeckoDriverService(binary);
356358
serverUrl = service.start();
357359
onQuit = () => service.kill();
358360

0 commit comments

Comments
 (0)