From eec35252c8cb3d2f5b1f47ac5f9baccc8c98b31a Mon Sep 17 00:00:00 2001 From: mike10ca Date: Wed, 1 Nov 2023 09:07:49 +0100 Subject: [PATCH 1/4] Update skipped tests --- cypress/e2e/pages/dashboard.pages.js | 6 +- cypress/e2e/smoke/dashboard.cy.js | 12 +-- cypress/e2e/smoke/nfts.cy.js | 12 +-- cypress/e2e/smoke/tx_history.cy.js | 115 ++++----------------------- 4 files changed, 30 insertions(+), 115 deletions(-) diff --git a/cypress/e2e/pages/dashboard.pages.js b/cypress/e2e/pages/dashboard.pages.js index 43ad81fa8a..44b0bb4743 100644 --- a/cypress/e2e/pages/dashboard.pages.js +++ b/cypress/e2e/pages/dashboard.pages.js @@ -66,12 +66,8 @@ export function verifyFeaturedAppsSection() { cy.contains(transactionBuilderStr) cy.get(txBuilder).should('exist') - // WalletConnect app - cy.contains(walletConnectStr) - cy.get(walletConnect).should('exist') - // Featured apps have a Safe-specific link - cy.get(safeSpecificLink).should('have.length', 2) + cy.get(safeSpecificLink).should('have.length', 1) }) } diff --git a/cypress/e2e/smoke/dashboard.cy.js b/cypress/e2e/smoke/dashboard.cy.js index fac9d8a91f..ad0ca6d0ee 100644 --- a/cypress/e2e/smoke/dashboard.cy.js +++ b/cypress/e2e/smoke/dashboard.cy.js @@ -3,27 +3,27 @@ import * as dashboard from '../pages/dashboard.pages' import * as main from '../pages/main.page' describe('Dashboard tests', () => { - before(() => { + beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) - main.acceptCookies() + main.acceptCookies(2) main.clickOnSideMenuItem(constants.mainSideMenuOptions.home) dashboard.verifyConnectTransactStrIsVisible() }) - it.skip('Verify the overview widget is displayed [C56107]', () => { + it('Verify the overview widget is displayed [C56107]', () => { dashboard.verifyOverviewWidgetData() }) - it.skip('Verify the transaction queue widget is displayed [C56108]', () => { + it('Verify the transaction queue widget is displayed [C56108]', () => { dashboard.verifyTxQueueWidget() }) - it.skip('Verify the featured Safe Apps are displayed [C56109]', () => { + it('Verify the featured Safe Apps are displayed [C56109]', () => { dashboard.verifyFeaturedAppsSection() }) - it.skip('Verify the Safe Apps Section is displayed [C56110]', () => { + it('Verify the Safe Apps Section is displayed [C56110]', () => { dashboard.verifySafeAppsSection() }) }) diff --git a/cypress/e2e/smoke/nfts.cy.js b/cypress/e2e/smoke/nfts.cy.js index d6cb124519..ecf4972210 100644 --- a/cypress/e2e/smoke/nfts.cy.js +++ b/cypress/e2e/smoke/nfts.cy.js @@ -7,34 +7,34 @@ const nftsAddress = '0x373B...866c' const nftsTokenID = 'CF' describe('NFTs tests', () => { - before(() => { + beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) main.acceptCookies() nfts.clickOnNftsTab() }) - it.skip('Verify that NFTs exist in the table [C56123]', () => { + it('Verify that NFTs exist in the table [C56123]', () => { nfts.verifyNFTNumber(20) }) - it.skip('Verify NFT row contains data [C56124]', () => { + it('Verify NFT row contains data [C56124]', () => { nfts.verifyDataInTable(nftsName, nftsAddress, nftsTokenID) }) - it.skip('Verify NFT preview window can be opened [C56125]', () => { + it('Verify NFT preview window can be opened [C56125]', () => { nfts.openFirstNFT() nfts.verifyNameInNFTModal(nftsTokenID) nfts.verifySelectedNetwrokSepolia() nfts.closeNFTModal() }) - it.skip('Verify NFT open does not open if no NFT exits [C56126]', () => { + it('Verify NFT open does not open if no NFT exits [C56126]', () => { nfts.clickOn6thNFT() nfts.verifyNFTModalDoesNotExist() }) - it.skip('Verify multipls NFTs can be selected and reviewed [C56127]', () => { + it('Verify multipls NFTs can be selected and reviewed [C56127]', () => { nfts.verifyInitialNFTData() nfts.selectNFTs(3) nfts.deselectNFTs([2], 3) diff --git a/cypress/e2e/smoke/tx_history.cy.js b/cypress/e2e/smoke/tx_history.cy.js index dc2fd67b26..cbc49612ed 100644 --- a/cypress/e2e/smoke/tx_history.cy.js +++ b/cypress/e2e/smoke/tx_history.cy.js @@ -2,16 +2,14 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as createTx from '../pages/create_tx.pages' -const INCOMING = 'Received' const OUTGOING = 'Sent' -const CONTRACT_INTERACTION = 'Contract interaction' const str1 = 'Received' const str2 = 'Executed' const str3 = 'Transaction hash' describe('Transaction history tests', () => { - before(() => { + beforeEach(() => { cy.clearLocalStorage() // Go to the test Safe transaction history cy.visit(constants.transactionsHistoryUrl + constants.SEPOLIA_TEST_SAFE_5) @@ -22,110 +20,31 @@ describe('Transaction history tests', () => { main.acceptCookies(1) }) - //Skipping this due to test data creation - it.skip('Verify October 9th transactions are displayed [C56128]', () => { - const DATE = 'Oct 9, 2023' - const NEXT_DATE_LABEL = 'Oct 11, 2023' - const amount = '0.1 ETH' - const amount2 = '15 TT_A' - const amount3 = '21 TT_B' - const amount4 = '82 DAI' - const amount5 = '73 USDC' - const amount6 = '27 AAVE' - const amount7 = '35.94 LINK' - const amount8 = '< 0.00001 ETH' - const time = '2:56 AM' - const time2 = '12:59 AM' - const time3 = '1:00 AM' - const time4 = '1:01 AM' + it('Verify October 9th transactions are displayed [C56128]', () => { + const DATE = 'Oct 29, 2023' + const NEXT_DATE_LABEL = 'Oct 20, 2023' + const amount = '0.00001 ETH' + const time = '10:39 PM' const success = 'Success' createTx.verifyDateExists(DATE) createTx.verifyDateExists(NEXT_DATE_LABEL) - main.scrollToBottomAndWaitForPageLoad() - // Transaction summaries from October 9th const rows = cy.contains('div', DATE).nextUntil(`div:contains(${NEXT_DATE_LABEL})`) - rows.should('have.length', 3) + rows.should('have.length', 10) - rows - .last() - .prev() - .within(() => { - // Type - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) + rows.eq(0).within(() => { + // Type + createTx.verifyImageAltTxt(0, OUTGOING) + createTx.verifyStatus(constants.transactionStatus.sent) - // Info - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.sep) - createTx.verifyTransactionStrExists(amount) - createTx.verifyTransactionStrExists(time) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.tta) - createTx.verifyTransactionStrExists(amount2) - createTx.verifyTransactionStrExists(time2) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.ttb) - createTx.verifyTransactionStrExists(amount3) - createTx.verifyTransactionStrExists(time2) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.dai) - createTx.verifyTransactionStrExists(amount4) - createTx.verifyTransactionStrExists(time2) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.usds) - createTx.verifyTransactionStrExists(amount5) - createTx.verifyTransactionStrExists(time3) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.aave) - createTx.verifyTransactionStrExists(amount6) - createTx.verifyTransactionStrExists(time3) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.link) - createTx.verifyTransactionStrExists(amount7) - createTx.verifyTransactionStrExists(time3) - createTx.verifyTransactionStrExists(success) - }) - .prev() - .within(() => { - createTx.verifyImageAltTxt(0, INCOMING) - createTx.verifyStatus(constants.transactionStatus.received) - createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.sep) - createTx.verifyTransactionStrExists(amount8) - createTx.verifyTransactionStrExists(time4) - createTx.verifyTransactionStrExists(success) - }) + // Info + createTx.verifyImageAltTxt(1, constants.tokenAbbreviation.sep) + createTx.verifyTransactionStrExists(amount) + createTx.verifyTransactionStrExists(time) + createTx.verifyTransactionStrExists(success) + }) }) it('Verify transaction can be expanded/collapsed [C56129]', () => { From 665b1074186c64f5ed89292e243884f2c97ee000 Mon Sep 17 00:00:00 2001 From: mike10ca Date: Wed, 1 Nov 2023 09:40:54 +0100 Subject: [PATCH 2/4] Wait fr 2 tooltips to close --- cypress/e2e/smoke/nfts.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/smoke/nfts.cy.js b/cypress/e2e/smoke/nfts.cy.js index ecf4972210..4e6fccf297 100644 --- a/cypress/e2e/smoke/nfts.cy.js +++ b/cypress/e2e/smoke/nfts.cy.js @@ -10,7 +10,7 @@ describe('NFTs tests', () => { beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) - main.acceptCookies() + main.acceptCookies(2) nfts.clickOnNftsTab() }) From f0fef6a39754bae4cce23a8c8e1e993dd55fc4b3 Mon Sep 17 00:00:00 2001 From: mike10ca Date: Wed, 1 Nov 2023 10:59:22 +0100 Subject: [PATCH 3/4] Fix permissions tests --- cypress/e2e/pages/safeapps.pages.js | 2 +- cypress/e2e/safe-apps/browser_permissions.cy.js | 5 +++-- cypress/e2e/safe-apps/safe_permissions.cy.js | 6 ++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/pages/safeapps.pages.js b/cypress/e2e/pages/safeapps.pages.js index 6c2dce7dcb..1385761e8b 100644 --- a/cypress/e2e/pages/safeapps.pages.js +++ b/cypress/e2e/pages/safeapps.pages.js @@ -143,7 +143,7 @@ function verifyDisclaimerIsVisible() { } export function clickOnContinueBtn() { - return cy.findByRole('button', { name: continueBtnStr }).click() + return cy.findByRole('button', { name: continueBtnStr }).click().wait(1000) } export function verifyCameraCheckBoxExists() { diff --git a/cypress/e2e/safe-apps/browser_permissions.cy.js b/cypress/e2e/safe-apps/browser_permissions.cy.js index cfd4f8ae41..da34de03ab 100644 --- a/cypress/e2e/safe-apps/browser_permissions.cy.js +++ b/cypress/e2e/safe-apps/browser_permissions.cy.js @@ -14,11 +14,11 @@ describe('Browser permissions tests', () => { safe_apps_permissions: ['camera', 'microphone'], }) }) + cy.visitSafeApp(`${constants.testAppUrl}/app`) + main.acceptCookies(1) }) it('Verify a permissions slide to the user is displayed [C56137]', () => { - cy.visitSafeApp(`${constants.testAppUrl}/app`) - main.acceptCookies() safeapps.clickOnContinueBtn() safeapps.verifyCameraCheckBoxExists() safeapps.verifyMicrofoneCheckBoxExists() @@ -29,6 +29,7 @@ describe('Browser permissions tests', () => { safeapps.clickOnContinueBtn() safeapps.verifyWarningDefaultAppMsgIsDisplayed() safeapps.verifyCameraCheckBoxExists() + safeapps.clickOnContinueBtn() safeapps.clickOnContinueBtn().should(() => { expect(window.localStorage.getItem(constants.BROWSER_PERMISSIONS_KEY)).to.eq(safeapps.localStorageItem) }) diff --git a/cypress/e2e/safe-apps/safe_permissions.cy.js b/cypress/e2e/safe-apps/safe_permissions.cy.js index b93a135b90..771beee30d 100644 --- a/cypress/e2e/safe-apps/safe_permissions.cy.js +++ b/cypress/e2e/safe-apps/safe_permissions.cy.js @@ -3,10 +3,8 @@ import * as safeapps from '../pages/safeapps.pages' import * as main from '../pages/main.page' describe('Safe permissions system tests', () => { - before(() => { - cy.clearLocalStorage() - }) beforeEach(() => { + cy.clearLocalStorage() cy.fixture('safe-app').then((html) => { cy.intercept('GET', `${constants.testAppUrl}/*`, html) cy.intercept('GET', `*/manifest.json`, { @@ -58,7 +56,7 @@ describe('Safe permissions system tests', () => { }) cy.visitSafeApp(constants.testAppUrl + constants.getPermissionsUrl) - main.acceptCookies() + main.acceptCookies(1) safeapps.clickOnContinueBtn() safeapps.verifyWarningDefaultAppMsgIsDisplayed() safeapps.clickOnContinueBtn() From 8b8aed066acbccf25257acaa6015efebb40c8d3c Mon Sep 17 00:00:00 2001 From: mike10ca Date: Wed, 1 Nov 2023 11:54:14 +0100 Subject: [PATCH 4/4] Fix NFTS tests --- cypress/e2e/pages/nfts.pages.js | 6 ++++-- cypress/e2e/smoke/nfts.cy.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/pages/nfts.pages.js b/cypress/e2e/pages/nfts.pages.js index 0800d2bb9f..85775098cb 100644 --- a/cypress/e2e/pages/nfts.pages.js +++ b/cypress/e2e/pages/nfts.pages.js @@ -32,8 +32,10 @@ export function verifyDataInTable(name, address, tokenID) { cy.get('tbody tr:first-child').contains('td:nth-child(2)', tokenID) } -export function openFirstNFT() { - cy.get('tbody tr:first-child td:nth-child(2)').click() +export function openNFT(index) { + cy.get('tbody').within(() => { + cy.get('tr').eq(index).click() + }) } export function verifyNameInNFTModal(name) { diff --git a/cypress/e2e/smoke/nfts.cy.js b/cypress/e2e/smoke/nfts.cy.js index 4e6fccf297..e86f1d671a 100644 --- a/cypress/e2e/smoke/nfts.cy.js +++ b/cypress/e2e/smoke/nfts.cy.js @@ -23,7 +23,7 @@ describe('NFTs tests', () => { }) it('Verify NFT preview window can be opened [C56125]', () => { - nfts.openFirstNFT() + nfts.openNFT(1) nfts.verifyNameInNFTModal(nftsTokenID) nfts.verifySelectedNetwrokSepolia() nfts.closeNFTModal()