diff options
test - e2e - more factoring of test setup
Diffstat (limited to 'test/e2e/metamask.spec.js')
-rw-r--r-- | test/e2e/metamask.spec.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js index 0d6ab9b35..5153c0ee5 100644 --- a/test/e2e/metamask.spec.js +++ b/test/e2e/metamask.spec.js @@ -4,7 +4,7 @@ const path = require('path') const assert = require('assert') const pify = require('pify') const { By, Key } = require('selenium-webdriver') -const { delay, createModifiedTestBuild, setupBrowserAndExtension } = require('./func') +const { delay, createModifiedTestBuild, setupBrowserAndExtension, verboseReportOnFailure } = require('./func') describe('Metamask popup page', function () { const browser = process.env.SELENIUM_BROWSER @@ -36,7 +36,7 @@ describe('Metamask popup page', function () { } // gather extra data if test failed if (this.currentTest.state === 'failed') { - await verboseReportOnFailure(this.currentTest) + await verboseReportOnFailure({ browser, driver, title: this.currentTest.title }) } }) @@ -319,16 +319,4 @@ describe('Metamask popup page', function () { return matchedErrorObjects } - async function verboseReportOnFailure (test) { - const artifactDir = `./test-artifacts/${browser}/${test.title}` - const filepathBase = `${artifactDir}/test-failure` - await pify(mkdirp)(artifactDir) - // capture screenshot - const screenshot = await driver.takeScreenshot() - await pify(fs.writeFile)(`${filepathBase}-screenshot.png`, screenshot, { encoding: 'base64' }) - // capture dom source - const htmlSource = await driver.getPageSource() - await pify(fs.writeFile)(`${filepathBase}-dom.html`, htmlSource) - } - }) |