mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
48440f7ed7
Drive-by: ensure we call onkill before manually exiting the process.
17 lines
645 B
JavaScript
17 lines
645 B
JavaScript
(async() => {
|
|
const { playwrightFile, browserTypeName, launchOptions, stallOnClose } = JSON.parse(process.argv[2]);
|
|
if (stallOnClose) {
|
|
launchOptions.__testHookGracefullyClose = () => {
|
|
console.log(`(stalled=>true)`);
|
|
return new Promise(() => {});
|
|
};
|
|
}
|
|
const browserServer = await require(playwrightFile)[browserTypeName].launchServer(launchOptions);
|
|
browserServer.on('close', (exitCode, signal) => {
|
|
console.log(`(exitCode=>${exitCode})`);
|
|
console.log(`(signal=>${signal})`);
|
|
});
|
|
console.log(`(pid=>${browserServer.process().pid})`);
|
|
console.log(`(wsEndpoint=>${browserServer.wsEndpoint()})`);
|
|
})();
|