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

Allow user to provide location when starting Firefox. #1201

Merged
merged 1 commit into from
Nov 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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