1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix intermittent reject transaction test failure ()

This test would occasionally fail due to a fluke of timing, where a
pending transaction would take slightly longer than expected to
be rendered in the "confirmed transactions" list. This `wait` block
ensures the test will try again until it has confirmed.
This commit is contained in:
Mark Stacey 2020-04-30 11:39:42 -03:00 committed by GitHub
parent bae8ef8b70
commit b9860034f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -599,8 +599,10 @@ describe('MetaMask', function () {
await driver.clickElement(By.xpath(`//button[contains(text(), 'Reject All')]`))
await driver.delay(largeDelayMs * 2)
const confirmedTxes = await driver.findElements(By.css('.transaction-list__completed-transactions .transaction-list-item'))
assert.equal(confirmedTxes.length, 5, '5 transactions present')
await driver.wait(async () => {
const confirmedTxes = await driver.findElements(By.css('.transaction-list__completed-transactions .transaction-list-item'))
return confirmedTxes.length === 5
}, 10000)
})
})