mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
12 lines
513 B
JavaScript
12 lines
513 B
JavaScript
(async() => {
|
|
const [, , playwrightIndex, browserType, options, exitOnClose] = process.argv;
|
|
const browserServer = await require(playwrightIndex)[browserType].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`);
|
|
})();
|