diff --git a/cypress/e2e/pages/create_tx.pages.js b/cypress/e2e/pages/create_tx.pages.js index 65c1fe0ca8..3c14a4a517 100644 --- a/cypress/e2e/pages/create_tx.pages.js +++ b/cypress/e2e/pages/create_tx.pages.js @@ -247,16 +247,17 @@ export function verifyNumberOfCopyIcons(number) { } export function verifyNumberOfExternalLinks(number) { - for (let i = 0; i <= number; i++) { - cy.get(copyIcon).parent().parent().next().should('be.visible') - cy.get(copyIcon) - .parent() - .parent() - .next() - .children() - .should('have.attr', 'href') - .and('include', constants.sepoliaEtherscanlLink) - } + cy.get(copyIcon) + .parent() + .parent() + .next() + .children('a') + .then(($links) => { + expect($links.length).to.be.at.least(number) + for (let i = 0; i < number; i++) { + cy.wrap($links[i]).should('have.attr', 'href').and('include', constants.etherscanlLink) + } + }) } export function clickOnTransactionItemByName(name, token) { @@ -346,29 +347,47 @@ export function verifySpamIconIsDisplayed(name, token) { } export function verifySummaryByName(name, token, data, alt, altToken) { - cy.get(transactionItem) - .filter(':contains("' + name + '")') - .then(($elements) => { - if (token) { - $elements = $elements.filter(':contains("' + token + '")') - } + if (!name) { + throw new Error('Name parameter is required for verification') + } - if ($elements.length > 0) { - cy.wrap($elements.first()).then(($element) => { - if (Array.isArray(data)) { - data.forEach((text) => { - cy.wrap($element).contains(text).should('be.visible') - }) - } else { - cy.wrap($element).contains(data).should('be.visible') - } - if (alt) cy.wrap($element).find('img').eq(0).should('have.attr', 'alt', alt).should('be.visible') - if (altToken) cy.wrap($element).find('img').eq(1).should('have.attr', 'alt', alt).should('be.visible') - }) + let selector = `${transactionItem}:contains("${name}")` + if (token) { + selector += `:contains("${token}")` + } + + cy.get(selector).then(($elements) => { + expect($elements.length, `Transaction items found for name: ${name}`).to.be.greaterThan(0) + + const $element = $elements.first() + + if (Array.isArray(data)) { + data.forEach((text) => { + expect($element.text()).to.include(text) + }) + } else if (data) { + expect($element.text()).to.include(data) + } + + if (alt) { + const firstImg = $element.find('img') + const firstSvg = $element.find('svg') + + if (firstImg.length > 0) { + const targetImg = firstImg.first() + expect(targetImg.attr('alt')).to.equal(alt) + } else if (firstSvg.length > 0) { + const targetSvg = firstSvg.first() + expect(targetSvg.attr('alt')).to.equal(alt) } - }) -} + } + if (altToken) { + const secondImg = $element.find('img').eq(1) + expect(secondImg.attr('alt')).to.equal(altToken) + } + }) +} export function verifySummaryByIndex(index, data, alt) { cy.get(messageItem) .eq(index) diff --git a/cypress/e2e/pages/sidebar.pages.js b/cypress/e2e/pages/sidebar.pages.js index 2f896ffcf8..484c122be0 100644 --- a/cypress/e2e/pages/sidebar.pages.js +++ b/cypress/e2e/pages/sidebar.pages.js @@ -233,7 +233,7 @@ export function verifyEtherscanLinkExists() { cy.get(sidebarContainer) .should('be.visible') .within(() => { - cy.get(explorerBtn).should('have.attr', 'href').and('include', constants.sepoliaEtherscanlLink) + cy.get(explorerBtn).should('have.attr', 'href').and('include', constants.etherscanlLink) }) } diff --git a/cypress/e2e/prodhealthcheck/messages_onchain.cy.js b/cypress/e2e/prodhealthcheck/messages_onchain.cy.js index 3ae76436f0..f0daa16abe 100644 --- a/cypress/e2e/prodhealthcheck/messages_onchain.cy.js +++ b/cypress/e2e/prodhealthcheck/messages_onchain.cy.js @@ -21,8 +21,9 @@ describe('[PROD] Onchain Messages tests', () => { it('Verify summary for signed on-chain message', () => { createTx.verifySummaryByName( typeMessagesOnchain.contractName, + null, [typeMessagesOnchain.success, typeMessagesOnchain.signMessage], - typeMessagesOnchain.altTmage, + typeMessagesOnchain.altImage, ) }) }) diff --git a/cypress/e2e/prodhealthcheck/tx_history.cy.js b/cypress/e2e/prodhealthcheck/tx_history.cy.js index 1c49ba2041..baf145c06c 100644 --- a/cypress/e2e/prodhealthcheck/tx_history.cy.js +++ b/cypress/e2e/prodhealthcheck/tx_history.cy.js @@ -41,8 +41,9 @@ describe('[PROD] Tx history tests 1', () => { it('Verify summary for account creation', () => { createTx.verifySummaryByName( typeCreateAccount.title, + null, [typeCreateAccount.actionsSummary, typeGeneral.statusOk], - typeCreateAccount.altTmage, + typeCreateAccount.altImage, ) }) @@ -78,7 +79,7 @@ describe('[PROD] Tx history tests 1', () => { typeSpendingLimits.title, typeSpendingLimits.summaryTxInfo, [typeGeneral.statusOk], - typeSpendingLimits.altTmage, + typeSpendingLimits.altImage, ) }) diff --git a/cypress/e2e/prodhealthcheck/tx_history_2.cy.js b/cypress/e2e/prodhealthcheck/tx_history_2.cy.js index edbac82f8b..a7ad1394aa 100644 --- a/cypress/e2e/prodhealthcheck/tx_history_2.cy.js +++ b/cypress/e2e/prodhealthcheck/tx_history_2.cy.js @@ -69,12 +69,12 @@ describe('[PROD] Tx history tests 2', () => { // Add owner it('Verify summary for adding owner', () => { - createTx.verifySummaryByName(typeAddOwner.title, [typeGeneral.statusOk], typeAddOwner.altImage) + createTx.verifySummaryByName(typeAddOwner.title, null, [typeGeneral.statusOk], typeAddOwner.altImage) }) // Change owner it('Verify summary for changing owner', () => { - createTx.verifySummaryByName(typeChangeOwner.title, [typeGeneral.statusOk], typeChangeOwner.altImage) + createTx.verifySummaryByName(typeChangeOwner.title, null, [typeGeneral.statusOk], typeChangeOwner.altImage) }) it('Verify exapanded details for changing owner', () => { @@ -93,21 +93,17 @@ describe('[PROD] Tx history tests 2', () => { // Remove owner it('Verify summary for removing owner', () => { - createTx.verifySummaryByName(typeRemoveOwner.title, [typeGeneral.statusOk], typeRemoveOwner.altImage) + createTx.verifySummaryByName(typeRemoveOwner.title, null, [typeGeneral.statusOk], typeRemoveOwner.altImage) }) // Disbale module it('Verify summary for disable module', () => { - createTx.verifySummaryByName(typeDisableOwner.title, [typeGeneral.statusOk], typeDisableOwner.altImage) + createTx.verifySummaryByName(typeDisableOwner.title, null, [typeGeneral.statusOk], typeDisableOwner.altImage) }) // Change threshold it('Verify summary for changing threshold', () => { - createTx.verifySummaryByName( - typeChangeThreshold.title, - [typeChangeThreshold.summaryTxInfo, typeGeneral.statusOk], - typeChangeThreshold.altImage, - ) + createTx.verifySummaryByName(typeChangeThreshold.title, null, [typeGeneral.statusOk], typeChangeThreshold.altImage) }) it('Verify exapanded details for changing threshold', () => { diff --git a/cypress/e2e/regression/messages_onchain.cy.js b/cypress/e2e/regression/messages_onchain.cy.js index 1a0f79c0dd..1d65df2a07 100644 --- a/cypress/e2e/regression/messages_onchain.cy.js +++ b/cypress/e2e/regression/messages_onchain.cy.js @@ -32,8 +32,9 @@ describe('Onchain Messages tests', () => { cy.visit(constants.transactionQueueUrl + staticSafes.SEP_STATIC_SAFE_10) createTx.verifySummaryByName( typeMessagesOnchain.contractName, + null, [typeMessagesOnchain.oneOftwo, typeMessagesOnchain.signMessage], - typeMessagesOnchain.altTmage, + typeMessagesOnchain.altImage, ) }) @@ -41,8 +42,9 @@ describe('Onchain Messages tests', () => { it('Verify summary for signed on-chain message', () => { createTx.verifySummaryByName( typeMessagesOnchain.contractName, - [typeMessagesOnchain.success, typeMessagesOnchain.signMessage], - typeMessagesOnchain.altTmage, + null, + [(typeMessagesOnchain.success, typeMessagesOnchain.signMessage)], + typeMessagesOnchain.altImage, ) }) }) diff --git a/cypress/e2e/regression/sidebar_3.cy.js b/cypress/e2e/regression/sidebar_3.cy.js index f60cdaa1f6..c76b27b042 100644 --- a/cypress/e2e/regression/sidebar_3.cy.js +++ b/cypress/e2e/regression/sidebar_3.cy.js @@ -1,18 +1,12 @@ import * as constants from '../../support/constants.js' -import * as main from '../pages/main.page.js' import * as sideBar from '../pages/sidebar.pages.js' -import * as ls from '../../support/localstorage_data.js' import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' import * as wallet from '../../support/utils/wallet.js' import * as create_wallet from '../pages/create_wallet.pages.js' -import * as navigation from '../pages/navigation.page.js' -import * as owner from '../pages/owners.pages.js' let staticSafes = [] const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) const signer = walletCredentials.OWNER_4_PRIVATE_KEY -const signer1 = walletCredentials.OWNER_1_PRIVATE_KEY -const signer2 = walletCredentials.OWNER_3_PRIVATE_KEY describe('Sidebar tests 3', () => { before(async () => { @@ -64,77 +58,4 @@ describe('Sidebar tests 3', () => { sideBar.openSidebar() sideBar.verifySafeGiveNameOptionExists(0) }) - - it('Verify Import/export buttons are present', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafes) - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) - cy.intercept('GET', constants.safeListEndpoint, { - 11155111: [sideBar.sideBarSafes.safe1, sideBar.sideBarSafes.safe2], - }) - wallet.connectSigner(signer) - sideBar.openSidebar() - main.checkButtonByTextExists(sideBar.importBtnStr) - main.checkButtonByTextExists(sideBar.exportBtnStr) - }) - - // Added to prod - it('Verify the "Accounts" counter at the top is counting all safes the user owns', () => { - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) - cy.intercept('GET', constants.safeListEndpoint, { - 11155111: [sideBar.sideBarSafes.safe1, sideBar.sideBarSafes.safe2], - }) - wallet.connectSigner(signer) - sideBar.openSidebar() - sideBar.checkAccountsCounter('2') - }) - - it('Verify that safes the user do not owns show in the watchlist after adding them', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4) - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) - wallet.connectSigner(signer1) - sideBar.openSidebar() - sideBar.verifyAddedSafesExist([sideBar.sideBarSafes.safe3short]) - }) - - it('Verify that safes that the user owns do show in the watchlist after adding them', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4) - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) - wallet.connectSigner(signer1) - sideBar.openSidebar() - sideBar.verifyAddedSafesExist([sideBar.sideBarSafes.safe3short]) - }) - - // Added to prod - it('Verify pending signature is displayed in sidebar for unsigned tx', () => { - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7) - wallet.connectSigner(signer) - cy.intercept('GET', constants.safeListEndpoint, { - 11155111: [sideBar.sideBarSafesPendingActions.safe1], - }) - sideBar.openSidebar() - sideBar.verifyTxToConfirmDoesNotExist() - owner.clickOnWalletExpandMoreIcon() - navigation.clickOnDisconnectBtn() - cy.intercept('GET', constants.safeListEndpoint, { - 11155111: [sideBar.sideBarSafesPendingActions.safe1], - }) - wallet.connectSigner(signer2) - sideBar.verifyAddedSafesExist([sideBar.sideBarSafesPendingActions.safe1short]) - sideBar.checkTxToConfirm(1) - }) - - // Added to prod - it('Verify balance exists in a tx in sidebar', () => { - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7) - wallet.connectSigner(signer) - owner.clickOnWalletExpandMoreIcon() - navigation.clickOnDisconnectBtn() - wallet.connectSigner(signer) - cy.intercept('GET', constants.safeListEndpoint, { - 11155111: [sideBar.sideBarSafesPendingActions.safe1], - }) - sideBar.openSidebar() - sideBar.verifyTxToConfirmDoesNotExist() - sideBar.checkBalanceExists() - }) }) diff --git a/cypress/e2e/regression/sidebar_7.cy.js b/cypress/e2e/regression/sidebar_7.cy.js new file mode 100644 index 0000000000..1ff05d6950 --- /dev/null +++ b/cypress/e2e/regression/sidebar_7.cy.js @@ -0,0 +1,93 @@ +import * as constants from '../../support/constants.js' +import * as main from '../pages/main.page.js' +import * as sideBar from '../pages/sidebar.pages.js' +import * as ls from '../../support/localstorage_data.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' +import * as wallet from '../../support/utils/wallet.js' +import * as navigation from '../pages/navigation.page.js' +import * as owner from '../pages/owners.pages.js' + +let staticSafes = [] +const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) +const signer = walletCredentials.OWNER_4_PRIVATE_KEY +const signer1 = walletCredentials.OWNER_1_PRIVATE_KEY +const signer2 = walletCredentials.OWNER_3_PRIVATE_KEY + +describe('Sidebar tests 7', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + it('Verify Import/export buttons are present', () => { + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafes) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) + cy.intercept('GET', constants.safeListEndpoint, { + 11155111: [sideBar.sideBarSafes.safe1, sideBar.sideBarSafes.safe2], + }) + wallet.connectSigner(signer) + sideBar.openSidebar() + main.checkButtonByTextExists(sideBar.importBtnStr) + main.checkButtonByTextExists(sideBar.exportBtnStr) + }) + + // Added to prod + it('Verify the "Accounts" counter at the top is counting all safes the user owns', () => { + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) + cy.intercept('GET', constants.safeListEndpoint, { + 11155111: [sideBar.sideBarSafes.safe1, sideBar.sideBarSafes.safe2], + }) + wallet.connectSigner(signer) + sideBar.openSidebar() + sideBar.checkAccountsCounter('2') + }) + + it('Verify that safes the user do not owns show in the watchlist after adding them', () => { + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) + wallet.connectSigner(signer1) + sideBar.openSidebar() + sideBar.verifyAddedSafesExist([sideBar.sideBarSafes.safe3short]) + }) + + it('Verify that safes that the user owns do show in the watchlist after adding them', () => { + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) + wallet.connectSigner(signer1) + sideBar.openSidebar() + sideBar.verifyAddedSafesExist([sideBar.sideBarSafes.safe3short]) + }) + + // Added to prod + it('Verify pending signature is displayed in sidebar for unsigned tx', () => { + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7) + wallet.connectSigner(signer) + cy.intercept('GET', constants.safeListEndpoint, { + 11155111: [sideBar.sideBarSafesPendingActions.safe1], + }) + sideBar.openSidebar() + sideBar.verifyTxToConfirmDoesNotExist() + owner.clickOnWalletExpandMoreIcon() + navigation.clickOnDisconnectBtn() + cy.intercept('GET', constants.safeListEndpoint, { + 11155111: [sideBar.sideBarSafesPendingActions.safe1], + }) + wallet.connectSigner(signer2) + sideBar.verifyAddedSafesExist([sideBar.sideBarSafesPendingActions.safe1short]) + sideBar.checkTxToConfirm(1) + }) + + // Added to prod + it('Verify balance exists in a tx in sidebar', () => { + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7) + wallet.connectSigner(signer) + owner.clickOnWalletExpandMoreIcon() + navigation.clickOnDisconnectBtn() + wallet.connectSigner(signer) + cy.intercept('GET', constants.safeListEndpoint, { + 11155111: [sideBar.sideBarSafesPendingActions.safe1], + }) + sideBar.openSidebar() + sideBar.verifyTxToConfirmDoesNotExist() + sideBar.checkBalanceExists() + }) +}) diff --git a/cypress/e2e/regression/tx_history.cy.js b/cypress/e2e/regression/tx_history.cy.js index d722b59fc2..20b28c5562 100644 --- a/cypress/e2e/regression/tx_history.cy.js +++ b/cypress/e2e/regression/tx_history.cy.js @@ -40,8 +40,10 @@ describe('Tx history tests 1', () => { it('Verify summary for account creation', () => { createTx.verifySummaryByName( typeCreateAccount.title, + null, [typeCreateAccount.actionsSummary, typeGeneral.statusOk], typeCreateAccount.altTmage, + null, ) }) @@ -81,11 +83,12 @@ describe('Tx history tests 1', () => { // Added to prod // Spending limits it('Verify summary for setting spend limits', () => { + // name, token, data, alt, altToken createTx.verifySummaryByName( typeSpendingLimits.title, typeSpendingLimits.summaryTxInfo, [typeGeneral.statusOk], - typeSpendingLimits.altTmage, + typeSpendingLimits.altImage, ) }) diff --git a/cypress/e2e/regression/tx_history_2.cy.js b/cypress/e2e/regression/tx_history_2.cy.js index 49e778839e..e132c6702c 100644 --- a/cypress/e2e/regression/tx_history_2.cy.js +++ b/cypress/e2e/regression/tx_history_2.cy.js @@ -71,7 +71,7 @@ describe('Tx history tests 2', () => { // Added to prod // Add owner it('Verify summary for adding owner', () => { - createTx.verifySummaryByName(typeAddOwner.title, [typeGeneral.statusOk], typeAddOwner.altImage) + createTx.verifySummaryByName(typeAddOwner.title, null, [typeGeneral.statusOk], typeAddOwner.altImage) }) it('Verify exapanded details for adding owner', () => { @@ -91,7 +91,7 @@ describe('Tx history tests 2', () => { // Added to prod // Change owner it('Verify summary for changing owner', () => { - createTx.verifySummaryByName(typeChangeOwner.title, [typeGeneral.statusOk], typeChangeOwner.altImage) + createTx.verifySummaryByName(typeChangeOwner.title, null, [typeGeneral.statusOk], typeChangeOwner.altImage) }) // Added to prod @@ -112,7 +112,7 @@ describe('Tx history tests 2', () => { // Added to prod // Remove owner it('Verify summary for removing owner', () => { - createTx.verifySummaryByName(typeRemoveOwner.title, [typeGeneral.statusOk], typeRemoveOwner.altImage) + createTx.verifySummaryByName(typeRemoveOwner.title, null, [typeGeneral.statusOk], typeRemoveOwner.altImage) }) it('Verify exapanded details for removing owner', () => { @@ -133,7 +133,7 @@ describe('Tx history tests 2', () => { // Added to prod // Disbale module it('Verify summary for disable module', () => { - createTx.verifySummaryByName(typeDisableOwner.title, [typeGeneral.statusOk], typeDisableOwner.altImage) + createTx.verifySummaryByName(typeDisableOwner.title, null, [typeGeneral.statusOk], typeDisableOwner.altImage) }) it('Verify exapanded details for disable module', () => { @@ -149,11 +149,7 @@ describe('Tx history tests 2', () => { // Added to prod // Change threshold it('Verify summary for changing threshold', () => { - createTx.verifySummaryByName( - typeChangeThreshold.title, - [typeChangeThreshold.summaryTxInfo, typeGeneral.statusOk], - typeChangeThreshold.altImage, - ) + createTx.verifySummaryByName(typeChangeThreshold.title, null, [typeGeneral.statusOk], typeChangeThreshold.altImage) }) // Added to prod diff --git a/cypress/e2e/regression/tx_history_3.cy.js b/cypress/e2e/regression/tx_history_3.cy.js new file mode 100644 index 0000000000..933dd1c836 --- /dev/null +++ b/cypress/e2e/regression/tx_history_3.cy.js @@ -0,0 +1,68 @@ +import * as constants from '../../support/constants.js' +import * as createTx from '../pages/create_tx.pages.js' +import * as data from '../../fixtures/txhistory_data_data.json' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] + +const typeReceive = data.type.receive +const typeGeneral = data.type.general + +describe('Incoming tx history tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.intercept( + 'GET', + `**${constants.stagingCGWChains}${constants.networkKeys.sepolia}/${ + constants.stagingCGWSafes + }${staticSafes.SEP_STATIC_SAFE_7.substring(4)}/transactions/history**`, + { fixture: 'txhistory_incoming_data.json' }, + ).as('txHistory') + + cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7) + cy.wait('@txHistory') + }) + + it('Verify Incoming ERC20 with logo in the history', () => { + createTx.verifySummaryByName( + typeReceive.summaryTxInfoDAI, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altImageDAI, + ) + }) + + it('Verify Incoming ERC20 without logo in the history', () => { + createTx.verifySummaryByName( + typeReceive.summaryTxInfoETH35, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altTokenETH35, + ) + }) + + it('Verify Incoming native token in the history', () => { + createTx.verifySummaryByName( + typeReceive.summaryTxInfoETH, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altToken, + ) + }) + + it('Verify Incoming NFT in the history', () => { + createTx.verifySummaryByName( + typeReceive.summaryTxInfoNFT, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altTokenNFT, + ) + }) +}) diff --git a/cypress/e2e/regression/tx_history_4.cy.js b/cypress/e2e/regression/tx_history_4.cy.js new file mode 100644 index 0000000000..39ba1e23e8 --- /dev/null +++ b/cypress/e2e/regression/tx_history_4.cy.js @@ -0,0 +1,84 @@ +import * as constants from '../../support/constants.js' +import * as createTx from '../pages/create_tx.pages.js' +import * as data from '../../fixtures/txhistory_data_data.json' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' +import * as address_book from '../pages/address_book.page.js' + +let staticSafes = [] + +const typeReceive = data.type.receive +const typeGeneral = data.type.general + +const safe = 'eth:0x8675B754342754A30A2AeF474D114d8460bca19b' +const dai = + '&id=transfer_0x8675B754342754A30A2AeF474D114d8460bca19b_e715646c00d8c513b16de213dbdcfea16f58aa1294306fdd5866a4d1fab643e4794' +const nft = + '&id=transfer_0x8675B754342754A30A2AeF474D114d8460bca19b_e3873b1a1310fd4acd00249456b9700ea7fbe1e61261c3efd08a288abf8756d0b138' +const eth = + '&id=transfer_0x8675B754342754A30A2AeF474D114d8460bca19b_idc6b8280a40b5979908bc7a116b38ac6b7ae22feea09fbc1dc1373421ff4f250' + +describe('Incoming tx history details tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + it('Verify Incoming details ERC20', () => { + cy.visit(constants.transactionUrl + safe + dai) + createTx.verifySummaryByName( + typeReceive.summaryTxInfoDAI, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altImageDAI, + ) + createTx.verifyExpandedDetails([ + typeReceive.GPv2Settlement, + typeReceive.GPv2SettlementAddress, + typeReceive.txHashDAI, + typeReceive.executionDateDAI, + ]) + createTx.verifyNumberOfExternalLinks(2) + }) + + it('Verify Incoming details ERC721', () => { + cy.visit(constants.transactionUrl + safe + nft) + createTx.verifySummaryByName( + typeReceive.summaryTxInfoNFT, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altTokenNFT, + ) + createTx.verifyExpandedDetails([ + typeReceive.Proxy, + typeReceive.ProxyAddress, + typeReceive.nftHash, + typeReceive.executionDateNFT, + ]) + createTx.verifyNumberOfExternalLinks(2) + }) + + it('Verify Incoming details Native token', () => { + cy.visit(constants.transactionUrl + safe + eth) + createTx.verifySummaryByName( + typeReceive.summaryTxInfoETH_2, + null, + [typeReceive.summaryTitle, typeGeneral.statusOk], + typeReceive.altImage, + typeReceive.altToken, + ) + createTx.verifyExpandedDetails([typeReceive.senderAddressEth, typeReceive.txHashEth, typeReceive.executionDateEth]) + createTx.verifyNumberOfExternalLinks(2) + }) + + it('Verify add to the address book for the sender in the incoming tx', () => { + const senderName = 'Sender100' + cy.visit(constants.transactionUrl + safe + eth) + address_book.clickOnMoreActionsBtn() + address_book.clickOnAddToAddressBookBtn() + address_book.typeInName(senderName) + address_book.clickOnSaveEntryBtn() + cy.visit(constants.addressBookUrl + safe) + cy.contains(senderName) + }) +}) diff --git a/cypress/e2e/smoke/tx_history.cy.js b/cypress/e2e/smoke/tx_history.cy.js index 8bdaf3e983..a7495a5e12 100644 --- a/cypress/e2e/smoke/tx_history.cy.js +++ b/cypress/e2e/smoke/tx_history.cy.js @@ -29,7 +29,7 @@ describe('[SMOKE] Tx history tests', () => { typeReceive.summaryTitle, typeReceive.summaryTxInfo, [typeReceive.summaryTxInfo, typeGeneral.statusOk], - typeReceive.altTmage, + typeReceive.altImage, ) }) @@ -46,6 +46,7 @@ describe('[SMOKE] Tx history tests', () => { it('[SMOKE] Verify summary for token send', () => { createTx.verifySummaryByName( typeSend.title, + null, [typeSend.summaryTxInfo, typeGeneral.statusOk], typeSend.altImage, typeSend.altToken, @@ -53,7 +54,12 @@ describe('[SMOKE] Tx history tests', () => { }) it('[SMOKE] Verify summary for on-chain rejection', () => { - createTx.verifySummaryByName(typeOnchainRejection.title, [typeGeneral.statusOk], typeOnchainRejection.altImage) + createTx.verifySummaryByName( + typeOnchainRejection.title, + null, + [typeGeneral.statusOk], + typeOnchainRejection.altImage, + ) }) it('[SMOKE] Verify summary for batch', () => { diff --git a/cypress/fixtures/txhistory_data_data.json b/cypress/fixtures/txhistory_data_data.json index e80972788f..65431321ee 100644 --- a/cypress/fixtures/txhistory_data_data.json +++ b/cypress/fixtures/txhistory_data_data.json @@ -34,14 +34,33 @@ "receive": { "title": "Receive", "summaryTitle": "Received", + "summaryTxInfoDAI": "25.50103 DAI", + "summaryTxInfoETH35": "ETH35.com", + "summaryTxInfoETH": "0.018 ETH", + "summaryTxInfoETH_2": "1 ETH", + "summaryTxInfoNFT": "1 FLOWER #6188", "summaryTxInfo": "1,000 QTRUST", "summaryTime": "11:00 AM", "receivedFrom": "Received 1,000 QTRUST from", "senderAddress": "sep:0x96D4c6fFC338912322813a77655fCC926b9A5aC5", + "senderAddressEth": "eth:0x5c4378Be60a8Af15d7d1Eeb61Dbc637aD56f2D23", "transactionHash": "0xd89d...9136", "transactionHashCopied": "0x415977f4e4912e22a5cabc4116f7e8f8984996e00a641dcccf8cbe1eb3db3e7d", "altImage": "Received", - "altToken": "ETH" + "altImageDAI": "DAI", + "altToken": "ETH", + "altTokenNFT": "FLOWER #6188", + "altTokenETH35": "$ ETH35.com", + "GPv2Settlement": "GPv2Settlement", + "GPv2SettlementAddress": "eth:0x9008D19f58AAbD9eD0D60971565", + "Proxy": "Proxy", + "ProxyAddress": "eth:0xeF6d82f75E0429fC9261583108542B87089CC47B", + "txHashDAI": "0x7156...3e47", + "nftHash": "0x3873...6d0b", + "txHashEth": "0xdc6b...f250", + "executionDateDAI": "30/10/2023, 02:37:11", + "executionDateNFT": "28/09/2023, 02:48:11", + "executionDateEth": "19/08/2020, 08:51:31" }, "send": { "title": "Sent", diff --git a/cypress/fixtures/txhistory_incoming_data.json b/cypress/fixtures/txhistory_incoming_data.json new file mode 100644 index 0000000000..d1836018e6 --- /dev/null +++ b/cypress/fixtures/txhistory_incoming_data.json @@ -0,0 +1,154 @@ +{ + "results": [ + { + "type": "TRANSACTION", + "transaction": { + "id": "transfer_0x8675B754342754A30A2AeF474D114d8460bca19b_e715646c00d8c513b16de213dbdcfea16f58aa1294306fdd5866a4d1fab643e4794", + "timestamp": 1698633431000, + "txStatus": "SUCCESS", + "txInfo": { + "type": "Transfer", + "humanDescription": null, + "sender": { + "value": "0x9008D19f58AAbD9eD0D60971565AA8510560ab41", + "name": "GPv2Settlement", + "logoUri": null + }, + "recipient": { + "value": "0x8675B754342754A30A2AeF474D114d8460bca19b", + "name": "Proxy", + "logoUri": null + }, + "direction": "INCOMING", + "transferInfo": { + "type": "ERC20", + "tokenAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F", + "value": "25501028934092566738", + "tokenName": "Dai Stablecoin", + "tokenSymbol": "DAI", + "logoUri": "https://safe-transaction-assets.staging.5afe.dev/tokens/logos/0x6B175474E89094C44Da98b954EedeAC495271d0F.png", + "decimals": 18, + "trusted": true, + "imitation": false + } + }, + "executionInfo": null, + "safeAppInfo": null, + "txHash": "0x715646c00d8c513b16de213dbdcfea16f58aa1294306fdd5866a4d1fab643e47" + }, + "conflictType": "None" + }, + { + "type": "TRANSACTION", + "transaction": { + "id": "transfer_0x8675B754342754A30A2AeF474D114d8460bca19b_e3873b1a1310fd4acd00249456b9700ea7fbe1e61261c3efd08a288abf8756d0b138", + "timestamp": 1695869291000, + "txStatus": "SUCCESS", + "txInfo": { + "type": "Transfer", + "humanDescription": null, + "sender": { + "value": "0xeF6d82f75E0429fC9261583108542B87089CC47B", + "name": "Proxy", + "logoUri": null + }, + "recipient": { + "value": "0x8675B754342754A30A2AeF474D114d8460bca19b", + "name": "Proxy", + "logoUri": null + }, + "direction": "INCOMING", + "transferInfo": { + "type": "ERC721", + "tokenAddress": "0x4F41d10F7E67fD16bDe916b4A6DC3Dd101C57394", + "tokenId": "6188", + "tokenName": "Flower", + "tokenSymbol": "FLOWER", + "logoUri": "https://safe-transaction-assets.staging.5afe.dev/tokens/logos/0x4F41d10F7E67fD16bDe916b4A6DC3Dd101C57394.png", + "trusted": false + } + }, + "executionInfo": null, + "safeAppInfo": null, + "txHash": "0x3873b1a1310fd4acd00249456b9700ea7fbe1e61261c3efd08a288abf8756d0b" + }, + "conflictType": "None" + }, + + { + "type": "TRANSACTION", + "transaction": { + "id": "transfer_0x8675B754342754A30A2AeF474D114d8460bca19b_e698326275adfeeb7bfbf0fbb05a547c569934392caaa69ad6c1ebb1d960cca8f497", + "timestamp": 1725733523000, + "txStatus": "SUCCESS", + "txInfo": { + "type": "Transfer", + "humanDescription": null, + "sender": { + "value": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "name": "Wrapped Ether", + "logoUri": "https://assets.coingecko.com/coins/images/2518/thumb/weth.png?1696503332" + }, + "recipient": { + "value": "0x8675B754342754A30A2AeF474D114d8460bca19b", + "name": "Proxy", + "logoUri": null + }, + "direction": "INCOMING", + "transferInfo": { + "type": "ERC20", + "tokenAddress": "0xC6d3D201530a6D4aD9dFbAAd39C5f68A9A470a69", + "value": "9283", + "tokenName": "$ ETH35.com - Visit to claim bonus rewards", + "tokenSymbol": "$ ETH35.com", + "logoUri": "https://safe-transaction-assets.staging.5afe.dev/tokens/logos/0xC6d3D201530a6D4aD9dFbAAd39C5f68A9A470a69.png", + "decimals": 0, + "trusted": false, + "imitation": false + } + }, + "executionInfo": null, + "safeAppInfo": null, + "txHash": "0x698326275adfeeb7bfbf0fbb05a547c569934392caaa69ad6c1ebb1d960cca8f" + }, + "conflictType": "None" + }, + { + "type": "TRANSACTION", + "transaction": { + "id": "multisig_0x8675B754342754A30A2AeF474D114d8460bca19b_0x36248faa2973e04d2d2a78916d417ff32e4e558b587923268f6c4f928d30b730", + "timestamp": 1722806183000, + "txStatus": "SUCCESS", + "txInfo": { + "type": "Transfer", + "humanDescription": null, + "sender": { + "value": "0x8675B754342754A30A2AeF474D114d8460bca19b", + "name": null, + "logoUri": null + }, + "recipient": { + "value": "0xF616fA313Cc2E9C517DFe87D80ab280d16aBbc26", + "name": null, + "logoUri": null + }, + "direction": "INCOMING", + "transferInfo": { + "type": "NATIVE_COIN", + "value": "18000000000000000" + } + }, + "executionInfo": { + "type": "MULTISIG", + "nonce": 378, + "confirmationsRequired": 1, + "confirmationsSubmitted": 1, + "missingSigners": null + }, + "safeAppInfo": null, + "txHash": "0x91b501fe122ae0b76e53b09b8f033f2520109ceb85c177d20b3030fb1902bebe" + }, + "conflictType": "None" + } + ] +} diff --git a/cypress/support/constants.js b/cypress/support/constants.js index e48a822c4c..d1e6438099 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -73,7 +73,7 @@ export const notificationsUrl = '/settings/notifications?safe=' export const invalidAppUrl = 'https://my-invalid-custom-app.com/manifest.json' export const validAppUrlJson = 'https://my-valid-custom-app.com/manifest.json' export const validAppUrl = 'https://my-valid-custom-app.com' -export const sepoliaEtherscanlLink = 'https://sepolia.etherscan.io/address' +export const etherscanlLink = 'etherscan.io' export const stagingTxServiceUrl = 'https://safe-transaction-sepolia.staging.5afe.dev/api' export const stagingTxServiceSafesUrl = '/safes/' export const stagingTxServiceBalancesUrl = '/balances/' diff --git a/cypress/support/utils/wallet.js b/cypress/support/utils/wallet.js index 6232d94d1f..93673c2164 100644 --- a/cypress/support/utils/wallet.js +++ b/cypress/support/utils/wallet.js @@ -41,7 +41,7 @@ export function connectSigner(signer) { } function enterPrivateKey() { - cy.wait(1000) + cy.wait(3000) cy.get('body').then(($body) => { if ($body.find(pkInput).length > 0) { cy.get(pkInput)