tests - run browser unit tests in default window

This commit is contained in:
Benjamin Pasero 2020-02-07 09:53:24 +01:00
parent 5393954877
commit 310c969fce

View file

@ -95,10 +95,9 @@ const testModules = (async function () {
async function runTestsInBrowser(testModules, browserType) {
const browser = await playwright[browserType].launch({ headless: !Boolean(argv.debug) });
const context = await browser.newContext();
const page = (await browser.defaultContext().pages())[0]
const target = url.pathToFileURL(path.join(__dirname, 'renderer.html'));
const page = await context.newPage(target.href);
await page.goto(target.href);
const emitter = new events.EventEmitter();
await page.exposeFunction('mocha_report', (type, data1, data2) => {