mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
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.
This commit is contained in:
parent
f1bfb84b4b
commit
0e51fb233c
@ -43,7 +43,7 @@ describe('MetaMask', function () {
|
||||
}
|
||||
}
|
||||
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') {
|
||||
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') {
|
||||
await driver.verboseReportOnFailure(this.currentTest)
|
||||
await driver.verboseReportOnFailure(this.currentTest.title)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -47,7 +47,7 @@ describe('MetaMask', function () {
|
||||
}
|
||||
}
|
||||
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') {
|
||||
await driver.verboseReportOnFailure(this.currentTest)
|
||||
await driver.verboseReportOnFailure(this.currentTest.title)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -38,7 +38,7 @@ describe('MetaMask', function () {
|
||||
}
|
||||
}
|
||||
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') {
|
||||
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') {
|
||||
await driver.verboseReportOnFailure(this.currentTest)
|
||||
await driver.verboseReportOnFailure(this.currentTest.title)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -41,7 +41,7 @@ describe('MetaMask', function () {
|
||||
}
|
||||
}
|
||||
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') {
|
||||
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') {
|
||||
await driver.verboseReportOnFailure(this.currentTest)
|
||||
await driver.verboseReportOnFailure(this.currentTest.title)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -172,8 +172,8 @@ class Driver {
|
||||
|
||||
// Error handling
|
||||
|
||||
async verboseReportOnFailure (test) {
|
||||
const artifactDir = `./test-artifacts/${this.browser}/${test.title}`
|
||||
async verboseReportOnFailure (title) {
|
||||
const artifactDir = `./test-artifacts/${this.browser}/${title}`
|
||||
const filepathBase = `${artifactDir}/test-failure`
|
||||
await fs.mkdir(artifactDir, { recursive: true })
|
||||
const screenshot = await this.driver.takeScreenshot()
|
||||
|
Loading…
Reference in New Issue
Block a user