playwright/test/fixtures/closeme.js
2020-03-27 20:29:24 -07:00

12 lines
517 B
JavaScript

(async() => {
const [, , playwrightRoot, product, options, exitOnClose] = process.argv;
const browserServer = await require(playwrightRoot)[product.toLowerCase()].launchServer(JSON.parse(options));
browserServer.on('close', (exitCode, signal) => {
console.log(`browserClose:${exitCode}:${signal}:browserClose`);
if (exitOnClose)
process.exit(0);
});
console.log(`browserPid:${browserServer.process().pid}:browserPid`);
console.log(`browserWS:${browserServer.wsEndpoint()}:browserWS`);
})();