Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Allow user to provide location when starting Firefox. (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garbee authored and jasonLaster committed Nov 15, 2016
1 parent 074fd03 commit 66a809e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bin/firefox-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ const By = webdriver.By;
const until = webdriver.until;
const Key = webdriver.Key;
const minimist = require("minimist");
const url = require('url');


const args = minimist(process.argv.slice(2),
{ boolean: ["start", "tests", "websocket"] });
{
boolean: ["start", "tests", "websocket"],
string: ["location"],
});

const isWindows = /^win/.test(process.platform);
const shouldStart = args.start;
Expand Down Expand Up @@ -58,7 +63,14 @@ function start() {

if (shouldStart) {
const driver = start();
driver.get("http://localhost:7999/todomvc");
let location = url.parse('about:blank');
if (args.location) {
location = url.parse(args.location);
}
if (location.protocol === null) {
location.protocol = 'http:';
}
driver.get(url.format(location));
setInterval(() => {}, 100);
}

Expand Down

0 comments on commit 66a809e

Please sign in to comment.