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:
parent
85f884c641
commit
478ed72a21
@ -8,7 +8,7 @@ const regularDelayMs = tinyDelayMs * 2
|
|||||||
const largeDelayMs = regularDelayMs * 2
|
const largeDelayMs = regularDelayMs * 2
|
||||||
|
|
||||||
async function withFixtures (options, callback) {
|
async function withFixtures (options, callback) {
|
||||||
const { fixtures, ganacheOptions, driverOptions } = options
|
const { fixtures, ganacheOptions, driverOptions, title } = options
|
||||||
const fixtureServer = new FixtureServer()
|
const fixtureServer = new FixtureServer()
|
||||||
const ganacheServer = new Ganache()
|
const ganacheServer = new Ganache()
|
||||||
|
|
||||||
@ -32,6 +32,9 @@ async function withFixtures (options, callback) {
|
|||||||
throw new Error(errorMessage)
|
throw new Error(errorMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
await webDriver.verboseReportOnFailure(title)
|
||||||
|
throw error
|
||||||
} finally {
|
} finally {
|
||||||
await fixtureServer.stop()
|
await fixtureServer.stop()
|
||||||
await ganacheServer.quit()
|
await ganacheServer.quit()
|
||||||
|
@ -11,19 +11,22 @@ describe('MetaMask Browser Extension', function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
await withFixtures({ fixtures: 'imported-account', ganacheOptions }, async ({ driver }) => {
|
await withFixtures(
|
||||||
const passwordField = await driver.findElement(By.css('#password'))
|
{ fixtures: 'imported-account', ganacheOptions, title: this.test.title },
|
||||||
await passwordField.sendKeys('correct horse battery staple')
|
async ({ driver }) => {
|
||||||
await passwordField.sendKeys(Key.ENTER)
|
const passwordField = await driver.findElement(By.css('#password'))
|
||||||
await driver.clickElement(By.css('[data-testid="eth-overview-send"]'))
|
await passwordField.sendKeys('correct horse battery staple')
|
||||||
const recipientAddressField = await driver.findElement(By.css('[data-testid="ens-input"]'))
|
await passwordField.sendKeys(Key.ENTER)
|
||||||
await recipientAddressField.sendKeys('0x985c30949c92df7a0bd42e0f3e3d539ece98db24')
|
await driver.clickElement(By.css('[data-testid="eth-overview-send"]'))
|
||||||
const amountField = await driver.findElement(By.css('.unit-input__input'))
|
const recipientAddressField = await driver.findElement(By.css('[data-testid="ens-input"]'))
|
||||||
await amountField.sendKeys('1')
|
await recipientAddressField.sendKeys('0x985c30949c92df7a0bd42e0f3e3d539ece98db24')
|
||||||
await driver.clickElement(By.css('[data-testid="page-container-footer-next"]'))
|
const amountField = await driver.findElement(By.css('.unit-input__input'))
|
||||||
await driver.clickElement(By.css('[data-testid="page-container-footer-next"]'))
|
await amountField.sendKeys('1')
|
||||||
await driver.clickElement(By.css('[data-testid="home__activity-tab"]'))
|
await driver.clickElement(By.css('[data-testid="page-container-footer-next"]'))
|
||||||
await driver.findElement(By.css('.transaction-list-item'))
|
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'))
|
||||||
|
}
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user