From 07b39deb614c0606c908916bb018828ad5d12771 Mon Sep 17 00:00:00 2001 From: Peter Yinusa <53189696+PeterYinusa@users.noreply.github.com> Date: Wed, 9 Nov 2022 16:00:04 +0000 Subject: [PATCH] E2e remove redundant code (#16432) * remove unused code * remove unused code --- test/e2e/metamask-ui.spec.js | 16 ++++++------ .../tests/custom-token-add-approve.spec.js | 8 +++--- test/e2e/tests/send-eth.spec.js | 25 +++---------------- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 2a2f16dfb658..347609a9fbd3 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -458,10 +458,10 @@ describe('MetaMask', function () { await driver.delay(veryLargeDelayMs); await driver.clickElement({ text: 'Edit', tag: 'button' }); await driver.delay(veryLargeDelayMs); - await driver.clickElement( - { text: 'Edit suggested gas fee', tag: 'button' }, - 10000, - ); + await driver.clickElement({ + text: 'Edit suggested gas fee', + tag: 'button', + }); await driver.delay(veryLargeDelayMs); const inputs = await driver.findElements('input[type="number"]'); const gasLimitInput = inputs[0]; @@ -576,10 +576,10 @@ describe('MetaMask', function () { it('customizes gas', async function () { await driver.clickElement('.confirm-approve-content__small-blue-text'); await driver.delay(regularDelayMs); - await driver.clickElement( - { text: 'Edit suggested gas fee', tag: 'button' }, - 10000, - ); + await driver.clickElement({ + text: 'Edit suggested gas fee', + tag: 'button', + }); await driver.delay(regularDelayMs); const [gasLimitInput, gasPriceInput] = await driver.findElements( diff --git a/test/e2e/tests/custom-token-add-approve.spec.js b/test/e2e/tests/custom-token-add-approve.spec.js index 67e0453250bd..2815f49a4db7 100644 --- a/test/e2e/tests/custom-token-add-approve.spec.js +++ b/test/e2e/tests/custom-token-add-approve.spec.js @@ -221,10 +221,10 @@ describe.skip('Create token, approve token and approve token without gas', funct await driver.clickElement( '.confirm-approve-content__small-blue-text', ); - await driver.clickElement( - { text: 'Edit suggested gas fee', tag: 'button' }, - 10000, - ); + await driver.clickElement({ + text: 'Edit suggested gas fee', + tag: 'button', + }); const [gasLimitInput, gasPriceInput] = await driver.findElements( 'input[type="number"]', ); diff --git a/test/e2e/tests/send-eth.spec.js b/test/e2e/tests/send-eth.spec.js index a0c254dcd75f..b9500e22daef 100644 --- a/test/e2e/tests/send-eth.spec.js +++ b/test/e2e/tests/send-eth.spec.js @@ -239,23 +239,6 @@ describe('Send ETH from dapp using advanced gas controls', function () { await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); - // goes to the settings screen - await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Settings', tag: 'div' }); - await driver.clickElement({ text: 'Advanced', tag: 'div' }); - await driver.clickElement( - '[data-testid="advanced-setting-show-testnet-conversion"] .settings-page__content-item-col > label > div', - ); - const advancedGasTitle = await driver.findElement({ - text: 'Advanced gas controls', - tag: 'span', - }); - await driver.scrollToElement(advancedGasTitle); - await driver.clickElement( - '[data-testid="advanced-setting-advanced-gas-inline"] .settings-page__content-item-col > label > div', - ); - await driver.clickElement('.app-header__logo-container'); - // initiates a send from the dapp await driver.openNewPage('http://127.0.0.1:8080/'); await driver.clickElement({ text: 'Send', tag: 'button' }); @@ -272,10 +255,10 @@ describe('Send ETH from dapp using advanced gas controls', function () { css: '.transaction-total-banner', text: '0.00021 ETH', }); - await driver.clickElement( - { text: 'Edit suggested gas fee', tag: 'button' }, - 10000, - ); + await driver.clickElement({ + text: 'Edit suggested gas fee', + tag: 'button', + }); await driver.waitForSelector({ css: '.transaction-total-banner', text: '0.00021 ETH',