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,
|
logger: undefined,
|
||||||
};
|
};
|
||||||
const options = {
|
const options = {
|
||||||
playwrightFile: path.join(playwrightPath, 'index'),
|
playwrightPath,
|
||||||
browserTypeName: browserType.name(),
|
browserTypeName: browserType.name(),
|
||||||
launchOptions,
|
launchOptions,
|
||||||
...extraOptions,
|
...extraOptions,
|
||||||
|
|||||||
8
test/fixtures/closeme.js
vendored
8
test/fixtures/closeme.js
vendored
@ -1,11 +1,17 @@
|
|||||||
(async() => {
|
(async() => {
|
||||||
const { playwrightFile, browserTypeName, launchOptions, stallOnClose } = JSON.parse(process.argv[2]);
|
const { playwrightPath, browserTypeName, launchOptions, stallOnClose } = JSON.parse(process.argv[2]);
|
||||||
if (stallOnClose) {
|
if (stallOnClose) {
|
||||||
launchOptions.__testHookGracefullyClose = () => {
|
launchOptions.__testHookGracefullyClose = () => {
|
||||||
console.log(`(stalled=>true)`);
|
console.log(`(stalled=>true)`);
|
||||||
return new Promise(() => {});
|
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);
|
const browserServer = await require(playwrightFile)[browserTypeName].launchServer(launchOptions);
|
||||||
browserServer.on('close', (exitCode, signal) => {
|
browserServer.on('close', (exitCode, signal) => {
|
||||||
console.log(`(exitCode=>${exitCode})`);
|
console.log(`(exitCode=>${exitCode})`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user