1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Add verbose reporting on failure to withFixtures (#8949)

The e2e test helper function `withFixtures` now includes verbose
reporting on failure. Whenever a test fails, debugging information will
be saved to disk, just as with the other e2e test modules.
This commit is contained in:
Mark Stacey 2020-07-09 12:42:56 -03:00 committed by GitHub
parent 85f884c641
commit 478ed72a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 15 deletions

View File

@ -8,7 +8,7 @@ const regularDelayMs = tinyDelayMs * 2
const largeDelayMs = regularDelayMs * 2
async function withFixtures (options, callback) {
const { fixtures, ganacheOptions, driverOptions } = options
const { fixtures, ganacheOptions, driverOptions, title } = options
const fixtureServer = new FixtureServer()
const ganacheServer = new Ganache()
@ -32,6 +32,9 @@ async function withFixtures (options, callback) {
throw new Error(errorMessage)
}
}
} catch (error) {
await webDriver.verboseReportOnFailure(title)
throw error
} finally {
await fixtureServer.stop()
await ganacheServer.quit()

View File

@ -11,7 +11,9 @@ describe('MetaMask Browser Extension', function () {
},
],
}
await withFixtures({ fixtures: 'imported-account', ganacheOptions }, async ({ driver }) => {
await withFixtures(
{ fixtures: 'imported-account', ganacheOptions, title: this.test.title },
async ({ driver }) => {
const passwordField = await driver.findElement(By.css('#password'))
await passwordField.sendKeys('correct horse battery staple')
await passwordField.sendKeys(Key.ENTER)
@ -24,6 +26,7 @@ describe('MetaMask Browser Extension', function () {
await driver.clickElement(By.css('[data-testid="page-container-footer-next"]'))
await driver.clickElement(By.css('[data-testid="home__activity-tab"]'))
await driver.findElement(By.css('.transaction-list-item'))
})
}
)
})
})