test - e2e - only inspect console for errors in chrome

feature/default_network_editable
kumavis 7 years ago
parent a3ca64d321
commit 83782421bb
  1. 16
      test/e2e/metamask.spec.js

@ -30,12 +30,16 @@ describe('Metamask popup page', function () {
})
afterEach(async function () {
// check for console errors
const errors = await checkBrowserForConsoleErrors()
if (errors.length) {
const errorReports = errors.map(err => err.message)
const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}`
this.test.error(new Error(errorMessage))
// logs command not supported in firefox
// https://github.com/SeleniumHQ/selenium/issues/2910
if (process.env.SELENIUM_BROWSER === 'chrome') {
// check for console errors
const errors = await checkBrowserForConsoleErrors()
if (errors.length) {
const errorReports = errors.map(err => err.message)
const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}`
this.test.error(new Error(errorMessage))
}
}
// gather extra data if test failed
if (this.currentTest.state === 'failed') {

Loading…
Cancel
Save