Skip to content

Commit

Permalink
Adding possibility to use external chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
axelssonHakan committed Nov 7, 2018
1 parent 57ad575 commit 1a11803
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands/puppeteer/src/index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ class PuppetRunner extends Runner {
this.argv.mocha.enableTimeouts = false;
}

this.browser = await this.puppeteer.launch(this.argv.chrome);
if (this.argv.browserWSEndpoint){
this.browser = await this.puppeteer.connect({ browserWSEndpoint: this.argv.browserWSEndpoint });
} else {
this.browser = await this.puppeteer.launch(this.argv.chrome);
}

global.browser = this.browser;
const pages = await this.browser.pages();
if (pages.length) {
Expand Down
5 changes: 5 additions & 0 deletions commands/puppeteer/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ module.exports = {
default: ['test/**/*.spec.js'],
type: 'array',
},
browserWSEndpoint: {
description: 'Connect to external chrome WS endpoint (`ws://localhost:3000`)',
type: 'string',
default: null,
},
'mocha.enableTimeouts': {
description: 'Enable timeouts',
default: false,
Expand Down

0 comments on commit 1a11803

Please sign in to comment.