From 1b8c6eeaf929733adeefa6218ed28781fbec5fb8 Mon Sep 17 00:00:00 2001 From: katspaugh Date: Sun, 29 Oct 2023 14:10:42 +0100 Subject: [PATCH] fix e2e --- cypress/e2e/pages/balances.pages.js | 9 --------- cypress/e2e/pages/main.page.js | 4 +++- cypress/e2e/smoke/assets.cy.js | 2 -- cypress/e2e/smoke/balances.cy.js | 1 - cypress/e2e/smoke/balances_pagination.cy.js | 1 - cypress/e2e/smoke/batch_tx.cy.js | 2 -- cypress/e2e/smoke/create_tx.cy.js | 2 -- 7 files changed, 3 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/pages/balances.pages.js b/cypress/e2e/pages/balances.pages.js index e3e6d14dbc..1dcaf46e5c 100644 --- a/cypress/e2e/pages/balances.pages.js +++ b/cypress/e2e/pages/balances.pages.js @@ -20,7 +20,6 @@ const hiddenTokenDeselectAllBtn = 'span[data-track="assets: Deselect all hide di const hiddenTokenIcon = 'svg[data-testid="VisibilityOffOutlinedIcon"]' const hideTokenDefaultString = 'Hide tokens' -const gotItStr = 'Got it!' const assetNameSortBtnStr = 'Asset' const assetBalanceSortBtnStr = 'Balance' const sendBtnStr = 'Send' @@ -184,14 +183,6 @@ export function verifyEachRowHasCheckbox(state) { }) } -export function acceptSpamWarning() { - cy.get('button').contains(gotItStr).click() - verifySpamWarningNotdisplayed() -} - -export function verifySpamWarningNotdisplayed() { - cy.contains(gotItStr).should('not.exist') -} export function verifyTokensTabIsSelected(option) { cy.get(`a[aria-selected="${option}"]`).contains('Tokens') } diff --git a/cypress/e2e/pages/main.page.js b/cypress/e2e/pages/main.page.js index a901af2a15..1f38e0ded6 100644 --- a/cypress/e2e/pages/main.page.js +++ b/cypress/e2e/pages/main.page.js @@ -9,7 +9,9 @@ export function clickOnSideMenuItem(item) { export function acceptCookies() { cy.wait(1000) - cy.findAllByText('Got it!').each(($el) => $el.click()) + cy.findAllByText('Got it!') + .should('have.length.at.least', 0) + .each(($el) => $el.click()) cy.get('button') .contains(acceptSelection) diff --git a/cypress/e2e/smoke/assets.cy.js b/cypress/e2e/smoke/assets.cy.js index 075ac1bd20..e8067221a9 100644 --- a/cypress/e2e/smoke/assets.cy.js +++ b/cypress/e2e/smoke/assets.cy.js @@ -14,7 +14,6 @@ describe('Assets tests', () => { cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) cy.clearLocalStorage() main.acceptCookies() - balances.acceptSpamWarning() }) it('Verify that the token tab is selected by default and the table is visible [C56039]', () => { @@ -107,7 +106,6 @@ describe('Assets tests', () => { it('Verify that a tool tip is shown pointing to "Token list" dropdown [C56044]', () => { //Spam warning message is removed in beforeEach hook cy.reload() - balances.verifySpamWarningNotdisplayed() }) it('Verify that Token list dropdown down options show/hide spam tokens [C56045]', () => { diff --git a/cypress/e2e/smoke/balances.cy.js b/cypress/e2e/smoke/balances.cy.js index e87d423346..98f32cad67 100644 --- a/cypress/e2e/smoke/balances.cy.js +++ b/cypress/e2e/smoke/balances.cy.js @@ -15,7 +15,6 @@ describe('Balance tests', () => { cy.clearLocalStorage() cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) main.acceptCookies() - balances.acceptSpamWarning() cy.contains('Assets') cy.get(balances.balanceSingleRow).should('have.length.lessThan', ASSETS_LENGTH) balances.selectTokenList(balances.tokenListOptions.allTokens) diff --git a/cypress/e2e/smoke/balances_pagination.cy.js b/cypress/e2e/smoke/balances_pagination.cy.js index e480bf61b4..695dfda308 100644 --- a/cypress/e2e/smoke/balances_pagination.cy.js +++ b/cypress/e2e/smoke/balances_pagination.cy.js @@ -12,7 +12,6 @@ describe('Balance tests', () => { // Table is loaded cy.contains('Görli Ether') - cy.contains('button', 'Got it').click() cy.contains('div', 'Default tokens').click() cy.wait(100) cy.contains('div', 'All tokens').click() diff --git a/cypress/e2e/smoke/batch_tx.cy.js b/cypress/e2e/smoke/batch_tx.cy.js index 9ed34130fc..777621dc43 100644 --- a/cypress/e2e/smoke/batch_tx.cy.js +++ b/cypress/e2e/smoke/batch_tx.cy.js @@ -1,7 +1,6 @@ import * as batch from '../pages/batches.pages' import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' -import * as balances from '../pages/balances.pages' const currentNonce = 3 const funds_first_tx = '0.001' @@ -12,7 +11,6 @@ describe('Batch transaction tests', () => { cy.clearLocalStorage() cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) main.acceptCookies() - balances.acceptSpamWarning() }) it('Verify empty batch list can be opened [C56082]', () => { diff --git a/cypress/e2e/smoke/create_tx.cy.js b/cypress/e2e/smoke/create_tx.cy.js index 033d61f3ca..055adac173 100644 --- a/cypress/e2e/smoke/create_tx.cy.js +++ b/cypress/e2e/smoke/create_tx.cy.js @@ -1,7 +1,6 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as createtx from '../../e2e/pages/create_tx.pages' -import * as balances from '../pages/balances.pages' const sendValue = 0.00002 const currentNonce = 1 @@ -11,7 +10,6 @@ describe('Create transactions tests', () => { cy.clearLocalStorage() cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) main.acceptCookies() - balances.acceptSpamWarning() }) it('Verify a new send token transaction can be created [C56104]', () => {