diff --git a/packages/selenium-side-runner/src/index.js b/packages/selenium-side-runner/src/index.js index 66b5e3f33..ef000dc61 100755 --- a/packages/selenium-side-runner/src/index.js +++ b/packages/selenium-side-runner/src/index.js @@ -36,7 +36,8 @@ program .option("-c, --capabilities [list]", "Webdriver capabilities") .option("-s, --server [url]", "Webdriver remote server") .option("-f, --filter [string]", "Filter test cases by name") - .option("-w, --maxWorkers [number]", "Maximum amount of workers that will run your tests, defaults to number of cores") + .option("-w, --max-workers [number]", "Maximum amount of workers that will run your tests, defaults to number of cores") + .option("--base-url [url]", "Override the base URL that was set in the IDE") .option("--no-sideyml", "Disabled the use of .side.yml") .option("--debug", "Print debug logs") .parse(process.argv); @@ -73,6 +74,8 @@ if (program.capabilities) { } } +configuration.baseUrl = program.baseUrl ? program.baseUrl : configuration.baseUrl; + function runProject(project) { if (!project.code) { return Promise.reject(new TypeError(`The project ${project.name} is of older format, open and save it again using the IDE.`)); diff --git a/packages/selianize/__tests__/configuration.spec.js b/packages/selianize/__tests__/configuration.spec.js index 7e1c73710..3bb9cae25 100644 --- a/packages/selianize/__tests__/configuration.spec.js +++ b/packages/selianize/__tests__/configuration.spec.js @@ -22,6 +22,6 @@ describe("configuration code emitter", () => { const project = { url: "http://www.seleniumhq.org" }; - expect(ConfigurationEmitter.emit(project)).toBe(`const BASE_URL = '${project.url}';`); + expect(ConfigurationEmitter.emit(project)).toBe(`const BASE_URL = Runner.configuration.baseUrl || '${project.url}';`); }); }); diff --git a/packages/selianize/src/configuration.js b/packages/selianize/src/configuration.js index d393e5b81..04ed03625 100644 --- a/packages/selianize/src/configuration.js +++ b/packages/selianize/src/configuration.js @@ -16,7 +16,7 @@ // under the License. export function emit(project) { - return `const BASE_URL = '${project.url}';`; + return `const BASE_URL = Runner.configuration.baseUrl || '${project.url}';`; } export default {