mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: prepare fixtures test to run with rpc (#3190)
This commit is contained in:
parent
da25a5b501
commit
a59220b06d
@ -35,7 +35,7 @@ class Wrapper {
|
||||
logger: undefined,
|
||||
};
|
||||
const options = {
|
||||
playwrightFile: path.join(playwrightPath, 'index'),
|
||||
playwrightPath,
|
||||
browserTypeName: browserType.name(),
|
||||
launchOptions,
|
||||
...extraOptions,
|
||||
|
||||
8
test/fixtures/closeme.js
vendored
8
test/fixtures/closeme.js
vendored
@ -1,11 +1,17 @@
|
||||
(async() => {
|
||||
const { playwrightFile, browserTypeName, launchOptions, stallOnClose } = JSON.parse(process.argv[2]);
|
||||
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 playwrightFile = path.join(playwrightPath, 'index');
|
||||
|
||||
const browserServer = await require(playwrightFile)[browserTypeName].launchServer(launchOptions);
|
||||
browserServer.on('close', (exitCode, signal) => {
|
||||
console.log(`(exitCode=>${exitCode})`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user