Wait for element text match in metamask-beta-ui e2e send token test

feature/default_network_editable
Dan 7 years ago
parent c343a12543
commit a6cb13422d
  1. 6
      test/e2e/beta/metamask-beta-ui.spec.js

@ -661,8 +661,7 @@ describe('MetaMask', function () {
const txValues = await findElements(driver, By.css('.tx-list-value')) const txValues = await findElements(driver, By.css('.tx-list-value'))
assert.equal(txValues.length, 1) assert.equal(txValues.length, 1)
await delay(regularDelayMs) await driver.wait(until.elementTextMatches(txValues[0], /50\sTST/))
assert.equal(await txValues[0].getText(), '50 TST')
const txStatuses = await findElements(driver, By.css('.tx-list-status')) const txStatuses = await findElements(driver, By.css('.tx-list-status'))
const tx = await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed|Failed/)) const tx = await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed|Failed/))
assert.equal(await tx.getText(), 'Confirmed') assert.equal(await tx.getText(), 'Confirmed')
@ -740,8 +739,7 @@ describe('MetaMask', function () {
assert.equal(transactions.length, 8) assert.equal(transactions.length, 8)
const txValues = await findElements(driver, By.css('.tx-list-value')) const txValues = await findElements(driver, By.css('.tx-list-value'))
assert.equal(txValues.length, 8) await driver.wait(until.elementTextMatches(txValues[0], /26\sTST/))
assert.equal(await txValues[0].getText(), '26 TST')
const txStatuses = await findElements(driver, By.css('.tx-list-status')) const txStatuses = await findElements(driver, By.css('.tx-list-status'))
await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/)) await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/))

Loading…
Cancel
Save