From b9860034f25c9bf7882e384e3a166468627a2dd4 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Apr 2020 11:39:42 -0300 Subject: [PATCH] Fix intermittent reject transaction test failure (#8478) 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. --- test/e2e/metamask-ui.spec.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 9932fc922..a17152eb0 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -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) }) })