Skip to content

Commit 411eedb

Browse files
committed
configurable base url
1 parent 8a6ce42 commit 411eedb

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/selenium-side-runner/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ program
3636
.option("-c, --capabilities [list]", "Webdriver capabilities")
3737
.option("-s, --server [url]", "Webdriver remote server")
3838
.option("-f, --filter [string]", "Filter test cases by name")
39-
.option("-w, --maxWorkers [number]", "Maximum amount of workers that will run your tests, defaults to number of cores")
39+
.option("-w, --max-workers [number]", "Maximum amount of workers that will run your tests, defaults to number of cores")
40+
.option("--base-url [url]", "Override the base URL that was set in the IDE")
4041
.option("--no-sideyml", "Disabled the use of .side.yml")
4142
.option("--debug", "Print debug logs")
4243
.parse(process.argv);
@@ -73,6 +74,8 @@ if (program.capabilities) {
7374
}
7475
}
7576

77+
configuration.baseUrl = program.baseUrl ? program.baseUrl : configuration.baseUrl;
78+
7679
function runProject(project) {
7780
if (!project.code) {
7881
return Promise.reject(new TypeError(`The project ${project.name} is of older format, open and save it again using the IDE.`));

packages/selianize/__tests__/configuration.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ describe("configuration code emitter", () => {
2222
const project = {
2323
url: "http://www.seleniumhq.org"
2424
};
25-
expect(ConfigurationEmitter.emit(project)).toBe(`const BASE_URL = '${project.url}';`);
25+
expect(ConfigurationEmitter.emit(project)).toBe(`const BASE_URL = Runner.configuration.baseUrl || '${project.url}';`);
2626
});
2727
});

packages/selianize/src/configuration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
export function emit(project) {
19-
return `const BASE_URL = '${project.url}';`;
19+
return `const BASE_URL = Runner.configuration.baseUrl || '${project.url}';`;
2020
}
2121

2222
export default {

0 commit comments

Comments
 (0)