aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/metamask.spec.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-06-12 05:46:45 +0800
committerkumavis <aaron@kumavis.me>2018-06-12 05:46:45 +0800
commit8a0961b4a8bd7eef50b8d8e45d73390f43795a14 (patch)
tree70f8b490cf065d33f3340ed592addfde9ab893b8 /test/e2e/metamask.spec.js
parent907594463dc7fdbf62a350f64d7212be59a0355f (diff)
downloadtangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.tar
tangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.tar.gz
tangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.tar.bz2
tangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.tar.lz
tangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.tar.xz
tangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.tar.zst
tangerine-wallet-browser-8a0961b4a8bd7eef50b8d8e45d73390f43795a14.zip
test - e2e - more factoring of test setup
Diffstat (limited to 'test/e2e/metamask.spec.js')
-rw-r--r--test/e2e/metamask.spec.js16
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)
- }
-
})