diff --git a/test/fixtures.jest.js b/test/fixtures.jest.js index c0d36f2ace..f6d6ba0b19 100644 --- a/test/fixtures.jest.js +++ b/test/fixtures.jest.js @@ -35,7 +35,7 @@ class Wrapper { logger: undefined, }; const options = { - playwrightFile: path.join(playwrightPath, 'index'), + playwrightPath, browserTypeName: browserType.name(), launchOptions, ...extraOptions, diff --git a/test/fixtures/closeme.js b/test/fixtures/closeme.js index b46c95bdf8..faab47e16b 100644 --- a/test/fixtures/closeme.js +++ b/test/fixtures/closeme.js @@ -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})`);