From 21c30f74af8bc926d6c651a9dda89493adb8954c Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:05:34 +0100 Subject: [PATCH] Make Edit Gas Fee testcase independent of arbitrary Wait time for Gas Editing (#13888) * Added Wait for Element Containing certain value function and made more robust Edit-Gas-Fee test * Fix: changed wait for containing value and included extra waitforelements * Fix: fix lint issue --- test/e2e/tests/edit-gas-fee.spec.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/e2e/tests/edit-gas-fee.spec.js b/test/e2e/tests/edit-gas-fee.spec.js index f6898344b..6b79fcbd8 100644 --- a/test/e2e/tests/edit-gas-fee.spec.js +++ b/test/e2e/tests/edit-gas-fee.spec.js @@ -40,9 +40,11 @@ describe('Editing Confirm Transaction', function () { // update estimates to high await driver.clickElement('[data-testid="edit-gas-fee-button"]'); - await driver.delay(regularDelayMs); + await driver.waitForSelector({ + text: 'sec', + tag: 'span', + }); await driver.clickElement('[data-testid="edit-gas-fee-item-high"]'); - await driver.delay(regularDelayMs); await driver.waitForSelector({ text: '🦍' }); await driver.waitForSelector({ text: 'Aggressive', @@ -50,9 +52,7 @@ describe('Editing Confirm Transaction', function () { // update estimates to medium await driver.clickElement('[data-testid="edit-gas-fee-button"]'); - await driver.delay(regularDelayMs); await driver.clickElement('[data-testid="edit-gas-fee-item-medium"]'); - await driver.delay(regularDelayMs); await driver.waitForSelector({ text: '🦊' }); await driver.waitForSelector({ text: 'Market', @@ -60,9 +60,7 @@ describe('Editing Confirm Transaction', function () { // update estimates to low await driver.clickElement('[data-testid="edit-gas-fee-button"]'); - await driver.delay(regularDelayMs); await driver.clickElement('[data-testid="edit-gas-fee-item-low"]'); - await driver.delay(regularDelayMs); await driver.waitForSelector({ text: '🐢' }); await driver.waitForSelector({ text: 'Low', @@ -121,7 +119,10 @@ describe('Editing Confirm Transaction', function () { // update estimates to high await driver.clickElement('[data-testid="edit-gas-fee-button"]'); - await driver.delay(regularDelayMs); + await driver.waitForSelector({ + text: 'sec', + tag: 'span', + }); await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); await driver.delay(regularDelayMs); @@ -231,7 +232,10 @@ describe('Editing Confirm Transaction', function () { }); await driver.clickElement('[data-testid="edit-gas-fee-button"]'); - await driver.delay(regularDelayMs); + await driver.waitForSelector({ + text: 'sec', + tag: 'span', + }); await driver.clickElement( '[data-testid="edit-gas-fee-item-dappSuggested"]', );