mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
23 lines
830 B
JavaScript
23 lines
830 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 path = require('path');
|
|
const { setUnderTest } = require(path.join(playwrightPath, 'lib', 'helper'));
|
|
setUnderTest();
|
|
const playwright = 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()})`);
|
|
})();
|