From 1509a4393a241eb18be6702a913f2041818b2972 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 20 Jun 2018 15:47:11 -0230 Subject: Accept whitespace when matching token balances in e2e tests --- test/e2e/beta/from-import-beta-ui.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/e2e/beta/from-import-beta-ui.spec.js') diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js index 823c72a3a..8af654319 100644 --- a/test/e2e/beta/from-import-beta-ui.spec.js +++ b/test/e2e/beta/from-import-beta-ui.spec.js @@ -348,8 +348,9 @@ describe('Using MetaMask with an existing account', function () { it('renders the balance for the new token', async () => { const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount')) + await driver.wait(until.elementTextMatches(balance, /^0\s*BAT\s*$/), 10000) const tokenAmount = await balance.getText() - assert.equal(tokenAmount, '0BAT') + assert.ok(/^0\s*BAT\s*$/.test(tokenAmount)) await delay(regularDelayMs) }) }) @@ -421,9 +422,9 @@ describe('Using MetaMask with an existing account', function () { it('renders the balance for the new token', async () => { const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount')) - await driver.wait(until.elementTextIs(balance, '100TST')) + await driver.wait(until.elementTextMatches(balance, /^100\s*TST\s*$/), 10000) const tokenAmount = await balance.getText() - assert.equal(tokenAmount, '100TST') + assert.ok(/^100\s*TST\s*$/.test(tokenAmount)) await delay(regularDelayMs) }) }) -- cgit