From 1a3057a8cb7c0de4b7cebd7dd29cce12e4e33f40 Mon Sep 17 00:00:00 2001 From: PeterYinusa Date: Thu, 20 Jul 2023 12:20:26 +0100 Subject: [PATCH] update isElementPresent usages --- test/e2e/nft/send-nft.spec.js | 3 --- test/e2e/tests/onboarding.spec.js | 11 +++++------ test/e2e/tests/settings-security-reveal-srp.spec.js | 12 +++++------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/test/e2e/nft/send-nft.spec.js b/test/e2e/nft/send-nft.spec.js index 1e0ee1c05749..9e801ec704e7 100644 --- a/test/e2e/nft/send-nft.spec.js +++ b/test/e2e/nft/send-nft.spec.js @@ -40,9 +40,6 @@ describe('Send NFT', function () { await driver.clickElement({ text: 'Next', tag: 'button' }); // Edit the NFT, ensure same address, and move forward - await driver.isElementPresentAndVisible( - '[data-testid="confirm-page-back-edit-button"]', - ); await driver.clickElement( '[data-testid="confirm-page-back-edit-button"]', ); diff --git a/test/e2e/tests/onboarding.spec.js b/test/e2e/tests/onboarding.spec.js index d0f494fd7fda..0f1ba862a294 100644 --- a/test/e2e/tests/onboarding.spec.js +++ b/test/e2e/tests/onboarding.spec.js @@ -162,12 +162,11 @@ describe('MetaMask onboarding', function () { ); // Check that the error message is displayed for the password fields - await driver.isElementPresent( - // eslint-disable-next-line prettier/prettier - { text: "Passwords don't match", tag: 'h6' }, - true, - ); - + const passwordErrorIsDisplayed = await driver.isElementPresent({ + text: "Passwords don't match", + css: 'h6', + }); + assert.equal(passwordErrorIsDisplayed, true); // Check that the "Confirm Password" button is disabled const confirmPasswordButton = await driver.findElement( '[data-testid="create-password-wallet"]', diff --git a/test/e2e/tests/settings-security-reveal-srp.spec.js b/test/e2e/tests/settings-security-reveal-srp.spec.js index 1a7cc14c0ee8..ea84cb6bc749 100644 --- a/test/e2e/tests/settings-security-reveal-srp.spec.js +++ b/test/e2e/tests/settings-security-reveal-srp.spec.js @@ -27,13 +27,11 @@ describe('Reveal SRP through settings', function () { await completeSRPRevealQuiz(driver); await driver.fill('#password-box', wrongTestPassword); await driver.press('#password-box', driver.Key.ENTER); - await driver.isElementPresent( - { - css: '.mm-help-text', - text: 'Incorrect password', - }, - true, - ); + const passwordErrorIsDisplayed = await driver.isElementPresent({ + css: '.mm-help-text', + text: 'Incorrect password', + }); + assert.equal(passwordErrorIsDisplayed, true); }, ); });