2019-11-19 03:18:28 +01:00
|
|
|
(async() => {
|
2020-04-07 17:10:31 +02:00
|
|
|
const [, , playwrightRoot, browserType, options, exitOnClose] = process.argv;
|
|
|
|
|
const browserServer = await require(playwrightRoot)[browserType].launchServer(JSON.parse(options));
|
2020-02-05 21:41:55 +01:00
|
|
|
browserServer.on('close', (exitCode, signal) => {
|
2020-01-28 22:07:53 +01:00
|
|
|
console.log(`browserClose:${exitCode}:${signal}:browserClose`);
|
2020-03-28 04:29:24 +01:00
|
|
|
if (exitOnClose)
|
|
|
|
|
process.exit(0);
|
2020-01-28 22:07:53 +01:00
|
|
|
});
|
2020-02-05 21:41:55 +01:00
|
|
|
console.log(`browserPid:${browserServer.process().pid}:browserPid`);
|
|
|
|
|
console.log(`browserWS:${browserServer.wsEndpoint()}:browserWS`);
|
2019-11-19 03:18:28 +01:00
|
|
|
})();
|