Skip to content

Commit

Permalink
Merge pull request #39 from anil-groupon/pass-debug-port
Browse files Browse the repository at this point in the history
Pass remote debugging port for chrome
  • Loading branch information
jkrems authored Jul 3, 2018
2 parents d006155 + 115d0c7 commit decfd60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ function initTestium(config) {
return config.get('proxy.targetUrl') + '/testium-priming-load';
}

function getChromeDevtoolsPort() {
return config.get('chrome.remoteDebuggingPort', null);
}

testium = {
close: close,
config: config,
getChromeDevtoolsPort: getChromeDevtoolsPort,
getInitialUrl: getInitialUrl,
getNewPageUrl: _.partial(getNewPageUrl, config.get('proxy.targetUrl'))
};
Expand Down
7 changes: 7 additions & 0 deletions lib/processes.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ function launchAllProcesses(config) {
args.push('--headless');
}
if (process.getuid() === 0) args.push('--no-sandbox');

findOpenPort().then(function (port) {
args.push('--remote-debugging-port=' + port);
config.set('chrome.remoteDebuggingPort', port);
debug('remoteDebuggingPort', port);
});

config.set('desiredCapabilities.chromeOptions.args', args);
}

Expand Down

0 comments on commit decfd60

Please sign in to comment.