From c9b42fc966c66a67f0a35d9a4b6dbcaf715a7ab0 Mon Sep 17 00:00:00 2001 From: Peter Yinusa <53189696+PeterYinusa@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:58:34 +0000 Subject: [PATCH] force background exceptions to show (#16860) * force background exceptions to show * fix type --- test/e2e/helpers.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index d950f0c05..38653a9c5 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -9,6 +9,7 @@ const Ganache = require('./ganache'); const FixtureServer = require('./fixture-server'); const PhishingWarningPageServer = require('./phishing-warning-page-server'); const { buildWebDriver } = require('./webdriver'); +const { PAGES } = require('./webdriver/driver'); const { ensureXServerIsRunning } = require('./x-server'); const GanacheSeeder = require('./seeder/ganache-seeder'); @@ -152,7 +153,13 @@ async function withFixtures(options, testSuite) { driver.exceptions.length > 0 && failOnConsoleError ) { - const errorMessage = `Errors found in browser console:\n${driver.exceptions.join( + /** + * Navigate to the background + * forcing background exceptions to be captured + * proving more helpful context + */ + await driver.navigate(PAGES.BACKGROUND); + const errorMessage = `Errors found in browser console including the background:\n${driver.exceptions.join( '\n', )}`; throw Error(errorMessage);