2019-11-18 18:18:28 -08:00
|
|
|
(async() => {
|
2019-12-20 15:10:13 -07:00
|
|
|
process.on('unhandledRejection', error => {
|
|
|
|
|
// Catch various errors as we launch non-browser binary.
|
|
|
|
|
console.log('unhandledRejection', error.message);
|
|
|
|
|
});
|
|
|
|
|
|
2020-01-23 17:45:31 -08:00
|
|
|
const [, , playwrightRoot, product, useWebSocket] = process.argv;
|
2019-12-20 15:10:13 -07:00
|
|
|
const options = {
|
2020-01-23 17:45:31 -08:00
|
|
|
webSocket: useWebSocket === 'usewebsocket',
|
2019-12-20 15:10:13 -07:00
|
|
|
ignoreDefaultArgs: true,
|
|
|
|
|
dumpio: true,
|
|
|
|
|
timeout: 1,
|
|
|
|
|
executablePath: 'node',
|
|
|
|
|
args: ['-e', 'console.error("message from dumpio")', '--']
|
|
|
|
|
}
|
2020-01-23 17:45:31 -08:00
|
|
|
console.error('using web socket: ' + options.webSocket);
|
2020-01-13 17:36:46 -08:00
|
|
|
if (product.toLowerCase() === 'firefox')
|
2019-12-20 15:10:13 -07:00
|
|
|
options.args.push('-juggler', '-profile');
|
|
|
|
|
try {
|
2020-01-23 14:40:37 -08:00
|
|
|
await require(playwrightRoot)[product.toLowerCase()].launchBrowserApp(options);
|
2019-12-20 15:10:13 -07:00
|
|
|
console.error('Browser launch unexpectedly succeeded.');
|
|
|
|
|
} catch (e) {
|
|
|
|
|
}
|
2019-11-18 18:18:28 -08:00
|
|
|
})();
|