Refactor webdriver method `verboseReportOnFailure` (#8948)

The webdriver method `verboseReportOnFailure` had previously taken a
single parameter, `test`, which was an object representing the current
Mocha test. However, only one property was used (`title`).

Instead the `title` is now passed through directly. This was done to
make this function easier to use outside of a Mocha context.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent f1bfb84b4b
commit 0e51fb233c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/e2e/address-book.spec.js
  2. 2
      test/e2e/ethereum-on.spec.js
  3. 2
      test/e2e/from-import-ui.spec.js
  4. 2
      test/e2e/incremental-security.spec.js
  5. 2
      test/e2e/metamask-responsive-ui.spec.js
  6. 2
      test/e2e/metamask-ui.spec.js
  7. 2
      test/e2e/permissions.spec.js
  8. 2
      test/e2e/send-edit.spec.js
  9. 2
      test/e2e/signature-request.spec.js
  10. 2
      test/e2e/threebox.spec.js
  11. 2
      test/e2e/web3.spec.js
  12. 4
      test/e2e/webdriver/driver.js

@ -43,7 +43,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -42,7 +42,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -46,7 +46,7 @@ describe('Using MetaMask with an existing account', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -47,7 +47,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -37,7 +37,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -38,7 +38,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -42,7 +42,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -44,7 +44,7 @@ describe('Using MetaMask with an existing account', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -41,7 +41,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -45,7 +45,7 @@ describe('MetaMask', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -44,7 +44,7 @@ describe('Using MetaMask with an existing account', function () {
} }
} }
if (this.currentTest.state === 'failed') { if (this.currentTest.state === 'failed') {
await driver.verboseReportOnFailure(this.currentTest) await driver.verboseReportOnFailure(this.currentTest.title)
} }
}) })

@ -172,8 +172,8 @@ class Driver {
// Error handling // Error handling
async verboseReportOnFailure (test) { async verboseReportOnFailure (title) {
const artifactDir = `./test-artifacts/${this.browser}/${test.title}` const artifactDir = `./test-artifacts/${this.browser}/${title}`
const filepathBase = `${artifactDir}/test-failure` const filepathBase = `${artifactDir}/test-failure`
await fs.mkdir(artifactDir, { recursive: true }) await fs.mkdir(artifactDir, { recursive: true })
const screenshot = await this.driver.takeScreenshot() const screenshot = await this.driver.takeScreenshot()

Loading…
Cancel
Save