diff options
author | Dan J Miller <danjm.com@gmail.com> | 2019-07-04 04:33:44 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2019-07-04 04:33:44 +0800 |
commit | 632c9b21e297f3255ecbb4a70812aa53c87b2ff4 (patch) | |
tree | 243bef17d80479046e0f6fdcb16d22b0e98162bb /test | |
parent | e768ed9b167c2e9d856e1ff1a4a3e495d39d1083 (diff) | |
download | tangerine-wallet-browser-6.7.2.tar tangerine-wallet-browser-6.7.2.tar.gz tangerine-wallet-browser-6.7.2.tar.bz2 tangerine-wallet-browser-6.7.2.tar.lz tangerine-wallet-browser-6.7.2.tar.xz tangerine-wallet-browser-6.7.2.tar.zst tangerine-wallet-browser-6.7.2.zip |
Version 6.7.2 gas limit fix (#6786)v6.7.2
* Introduce delay for eth_estimateGas calls with in test
* Add test that fails when gas estimates of contract method calls without gas are too high.
* Get transaction gas data from unApprovedTxs instead of confirmTransaction
* Fix selection of gas data in gas-modal-page-container.container
* Lint changes related to Version-6.7.2-gasLimitFix
* Fix e2e tests on Version-6.7.2-gasLimitFix
* Fix unit and integration tests for changes from Version-6.7.2-gasLimitFix
* more e2e fixes
* Add assertions for transaction values on confirm screen
* Fix display of transaction amount on confirm screen.
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 7aa386637..b0ec25cd9 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -340,7 +340,7 @@ describe('MetaMask', function () { it('confirms the transaction', async function () { const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`)) await confirmButton.click() - await delay(largeDelayMs) + await delay(largeDelayMs * 2) }) it('finds the transaction in the transactions list', async function () { @@ -428,6 +428,10 @@ describe('MetaMask', function () { }) it('confirms the transaction', async function () { + const transactionAmounts = await findElements(driver, By.css('.currency-display-component__text')) + const transactionAmount = transactionAmounts[0] + assert.equal(await transactionAmount.getText(), '1') + const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`)) await confirmButton.click() await delay(largeDelayMs) @@ -528,7 +532,7 @@ describe('MetaMask', function () { await delay(50) await gasLimitInput.sendKeys('25000') - await delay(tinyDelayMs) + await delay(largeDelayMs * 2) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`), 10000) await confirmButton.click() @@ -685,11 +689,13 @@ describe('MetaMask', function () { }) it('confirms a transaction', async () => { + await delay(tinyDelayMs) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`), 10000) await confirmButton.click() - await delay(regularDelayMs) + await delay(largeDelayMs * 2) const navigationElement = await findElement(driver, By.css('.confirm-page-container-navigation')) + await delay(tinyDelayMs) const navigationText = await navigationElement.getText() assert.equal(navigationText.includes('4'), true, 'transaction confirmed') }) @@ -792,7 +798,7 @@ describe('MetaMask', function () { await driver.wait(until.elementTextMatches(contractStatus, /Deposit\sinitiated/), 10000) await driver.switchTo().window(extension) - await delay(largeDelayMs) + await delay(largeDelayMs * 2) await findElements(driver, By.css('.transaction-list-item')) const [txListValue] = await findElements(driver, By.css('.transaction-list-item__amount--primary')) @@ -812,6 +818,8 @@ describe('MetaMask', function () { await delay(regularDelayMs) const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.advanced-tab__gas-edit-row__input')) + const gasLimitValue = await gasLimitInput.getAttribute('value') + assert(Number(gasLimitValue) < 100000, 'Gas Limit too high') await gasPriceInput.sendKeys(Key.chord(Key.CONTROL, 'a')) await delay(50) @@ -870,7 +878,7 @@ describe('MetaMask', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) - await delay(regularDelayMs) + await delay(largeDelayMs * 2) const txListItem = await findElement(driver, By.css('.transaction-list-item')) await txListItem.click() @@ -1102,6 +1110,10 @@ describe('MetaMask', function () { await txListValue.click() await delay(regularDelayMs) + const transactionAmounts = await findElements(driver, By.css('.currency-display-component__text')) + const transactionAmount = transactionAmounts[0] + assert(await transactionAmount.getText(), '1.5 TST') + // Set the gas limit const configureGas = await driver.wait(until.elementLocated(By.css('.confirm-detail-row__header-text--edit')), 10000) await configureGas.click() @@ -1340,10 +1352,10 @@ describe('MetaMask', function () { }) it('submits the transaction', async function () { - await delay(regularDelayMs) + await delay(largeDelayMs * 2) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`)) await confirmButton.click() - await delay(regularDelayMs) + await delay(largeDelayMs * 2) }) it('finds the transaction in the transactions list', async function () { |