mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
5c0f93301d
Root index.js is only used for local development, so assuming dev mode there is fine. This way we do not have to worry about calling setUnderTest early enough.
20 lines
711 B
JavaScript
20 lines
711 B
JavaScript
(async() => {
|
|
const { playwrightPath, browserTypeName, launchOptions, stallOnClose } = JSON.parse(process.argv[2]);
|
|
if (stallOnClose) {
|
|
launchOptions.__testHookGracefullyClose = () => {
|
|
console.log(`(stalled=>true)`);
|
|
return new Promise(() => {});
|
|
};
|
|
}
|
|
|
|
const playwright = require(require('path').join(playwrightPath, 'index'));
|
|
|
|
const browserServer = await playwright[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()})`);
|
|
})();
|