mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Check browser logs in withFixtures
e2e test helper (#8947)
e2e test that use the `withFixtures` helper now check for console errors after each successful test. If any errors are found, the test fails. It's currently enabled for Chrome only, because the Firefox driver throws an error when you attempt to get the browser logs. Not sure why exactly, but it's a long-standing problem.
This commit is contained in:
parent
0e51fb233c
commit
85f884c641
@ -23,6 +23,15 @@ async function withFixtures (options, callback) {
|
||||
await callback({
|
||||
driver,
|
||||
})
|
||||
|
||||
if (process.env.SELENIUM_BROWSER === 'chrome') {
|
||||
const errors = await driver.checkBrowserForConsoleErrors(driver)
|
||||
if (errors.length) {
|
||||
const errorReports = errors.map((err) => err.message)
|
||||
const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}`
|
||||
throw new Error(errorMessage)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
await fixtureServer.stop()
|
||||
await ganacheServer.quit()
|
||||
|
Loading…
Reference in New Issue
Block a user