From a59220b06d368880520449946f0773123c00d30f Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Mon, 27 Jul 2020 18:40:21 -0700 Subject: [PATCH] test: prepare fixtures test to run with rpc (#3190) --- test/fixtures.jest.js | 2 +- test/fixtures/closeme.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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})`);