diff options
author | Dan Miller <danjm.com@gmail.com> | 2019-01-24 23:58:47 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-01-25 07:01:30 +0800 |
commit | bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1 (patch) | |
tree | 090e7c479dc295ca9b3b9feb8c181500d78fd680 | |
parent | 76f9bdec631ac490e409c8bf9cdb851570e91398 (diff) | |
download | tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.tar tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.tar.gz tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.tar.bz2 tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.tar.lz tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.tar.xz tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.tar.zst tangerine-wallet-browser-bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1.zip |
Fix bugs in e2e tests related to gas customization inputs.
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 489b9b9da..942651fc8 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -635,7 +635,7 @@ describe('MetaMask', function () { await confirmButton.click() await delay(largeDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 4 }, 10000) @@ -695,7 +695,7 @@ describe('MetaMask', function () { await confirmButton.click() await delay(regularDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 5 }, 10000) @@ -727,7 +727,7 @@ describe('MetaMask', function () { await confirmButton.click() await delay(regularDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 6 }, 10000) @@ -911,7 +911,7 @@ describe('MetaMask', function () { await driver.wait(until.elementTextMatches(txValues[0], /-50\s*TST/), 10000) } - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 1 }, 10000) @@ -962,26 +962,29 @@ describe('MetaMask', function () { const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.advanced-tab__gas-edit-row__input')) await gasPriceInput.clear() await delay(tinyDelayMs) + + await gasPriceInput.sendKeys(Key.BACK_SPACE) + await gasPriceInput.sendKeys(Key.BACK_SPACE) await gasPriceInput.sendKeys('10') await delay(tinyDelayMs) await gasLimitInput.clear() await delay(tinyDelayMs) await gasLimitInput.sendKeys(Key.chord(Key.CONTROL, 'a')) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) await gasLimitInput.sendKeys('60000') await gasLimitInput.sendKeys(Key.chord(Key.CONTROL, 'e')) - // Needed for different behaviour of input in different versions of firefox - const gasLimitInputValue = await gasLimitInput.getAttribute('value') - if (gasLimitInputValue === '600001') { - await gasLimitInput.sendKeys(Key.BACK_SPACE) - } - const save = await findElement(driver, By.css('.page-container__footer-button')) await save.click() await driver.wait(until.stalenessOf(gasModal)) const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__primary')) - assert.equal(await gasFeeInputs[0].getText(), '0.0006') + const renderedGasFee = await gasFeeInputs[0].getText() + assert.equal(renderedGasFee, '0.0006') }) it('submits the transaction', async function () { @@ -991,7 +994,7 @@ describe('MetaMask', function () { }) it('finds the transaction in the transactions list', async function () { - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 2 }, 10000) @@ -1036,7 +1039,7 @@ describe('MetaMask', function () { await driver.switchTo().window(extension) await delay(regularDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const pendingTxes = await findElements(driver, By.css('.transaction-list__pending-transactions .transaction-list-item')) return pendingTxes.length === 1 }, 10000) @@ -1116,7 +1119,7 @@ describe('MetaMask', function () { }) it('finds the transaction in the transactions list', async function () { - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 3 }, 10000) |