Skip to content

Commit

Permalink
added cli argument shortcuts for browser environments
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Feb 12, 2023
1 parent 2498fe8 commit 4cd9a85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/runner/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ class CliRunner {
argv._source = [argv._source];
}

if (argv.firefox) {
argv.e = argv.env = 'firefox';
} else if (argv.chrome) {
argv.e = argv.env = 'chrome';
} else if (argv.safari) {
argv.e = argv.env = 'safari';
} else if (argv.edge) {
argv.e = argv.env = 'edge';
}

this.argv = argv;

this.testRunner = null;
Expand Down
4 changes: 2 additions & 2 deletions lib/testsuite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,14 @@ class TestSuite {

Object.defineProperty(globalExpect, 'cookie', {
value: function(...args) {
return this.expect.cookie(...args);
return global.browser.expect.cookie(...args);
},
writable: false
});

Object.defineProperty(globalExpect, 'url', {
value: function(...args) {
return this.expect.url(...args);
return global.browser.expect.url(...args);
},
writable: false
});
Expand Down

0 comments on commit 4cd9a85

Please sign in to comment.