diff --git a/core/test/gather/gatherers/accessibility-test.js b/core/test/gather/gatherers/accessibility-test.js index 4a6149fcf756..a8e9f994e0b6 100644 --- a/core/test/gather/gatherers/accessibility-test.js +++ b/core/test/gather/gatherers/accessibility-test.js @@ -43,6 +43,7 @@ describe('a11y audits + aXe', () => { before(async () => { browser = await puppeteer.launch({ + headless: 'new', executablePath: getChromePath(), }); }); diff --git a/core/test/scenarios/pptr-test-utils.js b/core/test/scenarios/pptr-test-utils.js index 1130d281ff1b..6140b68a1e24 100644 --- a/core/test/scenarios/pptr-test-utils.js +++ b/core/test/scenarios/pptr-test-utils.js @@ -44,32 +44,19 @@ function createTestState() { serverBaseUrl: '', secondaryServerBaseUrl: '', - /** - * @param {number=} port - * @param {number=} secondaryPort - */ - installServerHooks(port = 10200, secondaryPort = 10503) { + installSetupAndTeardownHooks() { before(async () => { - this.server = new Server(port); - this.secondaryServer = new Server(secondaryPort); - await this.server.listen(port, '127.0.0.1'); - await this.secondaryServer.listen(secondaryPort, '127.0.0.1'); + this.server = new Server(10200); + this.secondaryServer = new Server(10503); + await this.server.listen(10200, '127.0.0.1'); + await this.secondaryServer.listen(10503, '127.0.0.1'); this.serverBaseUrl = `http://localhost:${this.server.getPort()}`; this.secondaryServerBaseUrl = `http://localhost:${this.secondaryServer.getPort()}`; }); - after(async () => { - await this.server.close(); - await this.secondaryServer.close(); - }); - }, - - installSetupAndTeardownHooks() { - this.installServerHooks(); - before(async () => { this.browser = await puppeteer.launch({ - headless: true, + headless: 'new', executablePath: getChromePath(), ignoreDefaultArgs: ['--enable-automation'], }); @@ -98,6 +85,11 @@ function createTestState() { after(async () => { await this.browser.close(); }); + + after(async () => { + await this.server.close(); + await this.secondaryServer.close(); + }); }, /** diff --git a/flow-report/test/flow-report-pptr-test.ts b/flow-report/test/flow-report-pptr-test.ts index 9ffb126a0587..2690da23d15d 100644 --- a/flow-report/test/flow-report-pptr-test.ts +++ b/flow-report/test/flow-report-pptr-test.ts @@ -20,7 +20,7 @@ describe('Lighthouse Flow Report', () => { before(async () => { browser = await puppeteer.launch({ - headless: true, + headless: 'new', executablePath: getChromePath(), }); page = await browser.newPage(); diff --git a/report/test/renderer/report-renderer-axe-test.js b/report/test/renderer/report-renderer-axe-test.js index e20c8be9f150..3fa1f18ea63f 100644 --- a/report/test/renderer/report-renderer-axe-test.js +++ b/report/test/renderer/report-renderer-axe-test.js @@ -19,6 +19,7 @@ describe('ReportRendererAxe', () => { before(async () => { browser = await puppeteer.launch({ + headless: 'new', executablePath: getChromePath(), }); }); diff --git a/treemap/test/treemap-test-pptr.js b/treemap/test/treemap-test-pptr.js index 4991cba093a4..4307116ae111 100644 --- a/treemap/test/treemap-test-pptr.js +++ b/treemap/test/treemap-test-pptr.js @@ -50,7 +50,7 @@ describe('Lighthouse Treemap', () => { beforeEach(async () => { if (!browser) { browser = await puppeteer.launch({ - headless: true, + headless: 'new', executablePath: getChromePath(), }); } diff --git a/viewer/test/viewer-test-pptr.js b/viewer/test/viewer-test-pptr.js index 953caa9ee3f1..f6236dcf91ab 100644 --- a/viewer/test/viewer-test-pptr.js +++ b/viewer/test/viewer-test-pptr.js @@ -67,7 +67,7 @@ describe('Lighthouse Viewer', () => { // start puppeteer browser = await puppeteer.launch({ - headless: true, + headless: 'new', executablePath: getChromePath(), }); viewerPage = await browser.newPage(); @@ -86,6 +86,7 @@ describe('Lighthouse Viewer', () => { }); async function ensureNoErrors() { + await viewerPage.bringToFront(); await viewerPage.evaluate(() => new Promise(window.requestAnimationFrame)); const theErrors = pageErrors; pageErrors = [];