From ce42a970e7e36ef19c7b1a9fa2588d5dd635fa9e Mon Sep 17 00:00:00 2001 From: Michael <30682308+mike10ca@users.noreply.github.com> Date: Sun, 5 May 2024 21:17:53 +0200 Subject: [PATCH] Tests: Cypress tests refactoring (#3657) * tests: refactoring * tests: update nonce value --- cypress/e2e/regression/address_book.cy.js | 111 +++--- cypress/e2e/regression/load_safe_2.cy.js | 44 +-- cypress/e2e/regression/remove_owner.cy.js | 2 +- cypress/e2e/regression/replace_owner.cy.js | 2 +- cypress/e2e/regression/sidebar.cy.js | 2 +- cypress/e2e/regression/sidebar_nonowner.cy.js | 2 +- cypress/e2e/regression/spending_limits.cy.js | 44 +-- cypress/e2e/regression/tokens.cy.js | 2 +- cypress/e2e/smoke/address_book.cy.js | 21 +- cypress/e2e/smoke/batch_tx.cy.js | 18 +- cypress/e2e/smoke/create_tx.cy.js | 4 +- cypress/e2e/smoke/dashboard.cy.js | 4 +- cypress/e2e/smoke/import_export_data.cy.js | 128 +++---- cypress/e2e/smoke/import_export_data_2.cy.js | 10 +- cypress/fixtures/data_import.json | 323 +++++++++--------- cypress/fixtures/safes/static.json | 12 +- cypress/support/localstorage_data.js | 16 + 17 files changed, 378 insertions(+), 367 deletions(-) diff --git a/cypress/e2e/regression/address_book.cy.js b/cypress/e2e/regression/address_book.cy.js index bae7a4b6e6..aa5f04bcb8 100644 --- a/cypress/e2e/regression/address_book.cy.js +++ b/cypress/e2e/regression/address_book.cy.js @@ -26,18 +26,19 @@ describe('Address book tests', () => { }) it('Verify owners name can be edited', () => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) .then(() => { - main - .isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) - .then(() => { - cy.reload() - addressBook.clickOnEditEntryBtn() - addressBook.typeInNameInput(EDITED_NAME) - addressBook.clickOnSaveEntryBtn() - addressBook.verifyNameWasChanged(NAME, EDITED_NAME) - }) + cy.reload() + addressBook.clickOnEditEntryBtn() + addressBook.typeInNameInput(EDITED_NAME) + addressBook.clickOnSaveEntryBtn() + addressBook.verifyNameWasChanged(NAME, EDITED_NAME) }) }) @@ -61,57 +62,57 @@ describe('Address book tests', () => { }) it('Verify the address book file can be exported', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.dataSet).then(() => { - main - .isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.dataSet) - .then(() => { - cy.reload() - cy.contains(ls.addressBookData.dataSet[11155111]['0xf405BC611F4a4c89CCB3E4d083099f9C36D966f8']) - - const date = format(new Date(), 'yyyy-MM-dd', { timeZone: 'UTC' }) - const fileName = `safe-address-book-${date}.csv` - - addressBook.clickOnExportFileBtn() - addressBook.verifyExportMessage(12) - addressBook.confirmExport() - - const downloadsFolder = Cypress.config('downloadsFolder') - //File reading is failing in the CI. Can be tested locally - cy.readFile(path.join(downloadsFolder, fileName)).should('exist') - }) - }) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.dataSet)) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.dataSet), + ) + .then(() => { + cy.reload() + cy.contains(ls.addressBookData.dataSet[11155111]['0xf405BC611F4a4c89CCB3E4d083099f9C36D966f8']) + const date = format(new Date(), 'yyyy-MM-dd', { timeZone: 'UTC' }) + const fileName = `safe-address-book-${date}.csv` + addressBook.clickOnExportFileBtn() + addressBook.verifyExportMessage(12) + addressBook.confirmExport() + const downloadsFolder = Cypress.config('downloadsFolder') + //File reading is failing in the CI. Can be tested locally + cy.readFile(path.join(downloadsFolder, fileName)).should('exist') + }) }) it('Verify that importing a csv file does not alter addresses in the Address book not present in the file', () => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) .then(() => { - main - .isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) - .then(() => { - cy.wait(1000) - cy.reload() - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.validCSVFile) - addressBook.clickOnImportBtn() - addressBook.verifyDataImported([constants.RECIPIENT_ADDRESS]) - }) + cy.wait(1000) + cy.reload() + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.validCSVFile) + addressBook.clickOnImportBtn() + addressBook.verifyDataImported([constants.RECIPIENT_ADDRESS]) }) }) it('Verify Safe name changes after uploading a csv file', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4).then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafesImport) - .then(() => { - cy.wait(1000) - cy.reload() - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.addedSafesCSVFile) - addressBook.clickOnImportBtn() - sidebar.openSidebar() - sidebar.verifyAddedSafesExist([importedSafe]) - }) - }) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set4)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafesImport), + ) + .then(() => { + cy.wait(1000) + cy.reload() + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.addedSafesCSVFile) + addressBook.clickOnImportBtn() + sidebar.openSidebar() + sidebar.verifyAddedSafesExist([importedSafe]) + }) }) }) diff --git a/cypress/e2e/regression/load_safe_2.cy.js b/cypress/e2e/regression/load_safe_2.cy.js index 0ddcf3d84f..0cd807c43b 100644 --- a/cypress/e2e/regression/load_safe_2.cy.js +++ b/cypress/e2e/regression/load_safe_2.cy.js @@ -33,11 +33,13 @@ describe('Load Safe tests 2', () => { }) it('Verify names in address book are filled by default from address book', () => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName) + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName), + ) .then(() => { cy.reload() - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13) safe.clickOnNextBtn() safe.verifyOwnerNames(ownerNames) safe.verifyOnwerInputIsNotEmpty(0) @@ -45,28 +47,30 @@ describe('Load Safe tests 2', () => { }) it('Verify Safe address checksum', () => { - safe.verifyAddressCheckSum(staticSafes.SEP_STATIC_SAFE_15) - safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_15) - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15.split(':')[1].toLowerCase()) - safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_15) + safe.verifyAddressCheckSum(staticSafes.SEP_STATIC_SAFE_13) + safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_13) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13.split(':')[1].toLowerCase()) + safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_13) }) it('Verify owner name cannot be longer than 50 characters', () => { - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13) safe.clickOnNextBtn() safe.inputOwnerName(0, main.generateRandomString(51)) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.exceedChars) }) it('Verify names with primary ENS name are filled by default', () => { - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13) safe.clickOnNextBtn() safe.verifyOnwerNameENS(1, constants.ENS_TEST_SEPOLIA_VALID) }) it('Verify correct owner names are displayed for certain networks', () => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName) + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName), + ) .then(() => { cy.reload() safe.clickNetworkSelector(constants.networks.sepolia) @@ -77,7 +81,7 @@ describe('Load Safe tests 2', () => { safe.clickOnBackBtn() safe.clickNetworkSelector(constants.networks.ethereum) safe.selectSepolia() - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13) safe.clickOnNextBtn() safe.verifyOwnerNames(ownerSepolia) }) @@ -89,17 +93,19 @@ describe('Load Safe tests 2', () => { }) it('Verify a valid address can be entered', () => { - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13) safe.verifyAddresFormatIsValid() }) it('Verify that safes already added to the watchlist cannot be added again', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1).then(() => { - cy.reload() - safe.inputAddress(staticSafes.SEP_STATIC_SAFE_5) - owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.safeAlreadyAdded) - safe.verifyNextButtonStatus(constants.enabledStates.disabled) - }) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1)) + .then(() => { + cy.reload() + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_13) + owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.safeAlreadyAdded) + safe.verifyNextButtonStatus(constants.enabledStates.disabled) + }) }) it('Verify that the wrong prefix is not allowed', () => { diff --git a/cypress/e2e/regression/remove_owner.cy.js b/cypress/e2e/regression/remove_owner.cy.js index c702640b3e..2ea8f5a129 100644 --- a/cypress/e2e/regression/remove_owner.cy.js +++ b/cypress/e2e/regression/remove_owner.cy.js @@ -13,7 +13,7 @@ describe('Remove Owners tests', () => { }) beforeEach(() => { - cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_5) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_13) main.waitForHistoryCallToComplete() cy.clearLocalStorage() main.acceptCookies() diff --git a/cypress/e2e/regression/replace_owner.cy.js b/cypress/e2e/regression/replace_owner.cy.js index 434bb24e41..ce408ba072 100644 --- a/cypress/e2e/regression/replace_owner.cy.js +++ b/cypress/e2e/regression/replace_owner.cy.js @@ -79,7 +79,7 @@ describe('Replace Owners tests', () => { }) it("Verify 'Replace' tx is created", () => { - cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_17) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) owner.waitForConnectionStatus() owner.openReplaceOwnerWindow() cy.wait(1000) diff --git a/cypress/e2e/regression/sidebar.cy.js b/cypress/e2e/regression/sidebar.cy.js index eeb45df9b1..024f278bd7 100644 --- a/cypress/e2e/regression/sidebar.cy.js +++ b/cypress/e2e/regression/sidebar.cy.js @@ -43,7 +43,7 @@ describe('Sidebar tests', () => { }) it('Verify New transaction button enabled for beneficiaries who are non-owners', () => { - cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_10) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_11) sideBar.verifyNewTxBtnStatus(constants.enabledStates.enabled) }) diff --git a/cypress/e2e/regression/sidebar_nonowner.cy.js b/cypress/e2e/regression/sidebar_nonowner.cy.js index 4e02c0571a..69051fe5a0 100644 --- a/cypress/e2e/regression/sidebar_nonowner.cy.js +++ b/cypress/e2e/regression/sidebar_nonowner.cy.js @@ -16,7 +16,7 @@ describe('Sidebar non-owner tests', () => { }) beforeEach(() => { - cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_13) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_11) cy.wait(2000) cy.clearLocalStorage() main.acceptCookies() diff --git a/cypress/e2e/regression/spending_limits.cy.js b/cypress/e2e/regression/spending_limits.cy.js index 1e95615d7d..c99b764779 100644 --- a/cypress/e2e/regression/spending_limits.cy.js +++ b/cypress/e2e/regression/spending_limits.cy.js @@ -99,31 +99,33 @@ describe('Spending limits tests', () => { }) it('Verify that when multiple assets are available, they are displayed in token dropdown', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.slimitSettings).then(() => { - main - .isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.slimitSettings) - .then(() => { - cy.reload() - navigation.clickOnNewTxBtn() - tx.clickOnSendTokensBtn() - spendinglimit.clickOnTokenDropdown() - spendinglimit.verifyMandatoryTokensExist() - }) - }) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.slimitSettings)) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.slimitSettings), + ) + .then(() => { + cy.reload() + navigation.clickOnNewTxBtn() + tx.clickOnSendTokensBtn() + spendinglimit.clickOnTokenDropdown() + spendinglimit.verifyMandatoryTokensExist() + }) }) it('Verify that beneficiary can be retried from address book', () => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress2) + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress2), + ) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress2), + ) .then(() => { - main - .isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress2) - .then(() => { - cy.reload() - spendinglimit.clickOnNewSpendingLimitBtn() - spendinglimit.enterBeneficiaryAddress(constants.DEFAULT_OWNER_ADDRESS.substring(30)) - spendinglimit.selectRecipient(constants.DEFAULT_OWNER_ADDRESS) - }) + cy.reload() + spendinglimit.clickOnNewSpendingLimitBtn() + spendinglimit.enterBeneficiaryAddress(constants.DEFAULT_OWNER_ADDRESS.substring(30)) + spendinglimit.selectRecipient(constants.DEFAULT_OWNER_ADDRESS) }) }) diff --git a/cypress/e2e/regression/tokens.cy.js b/cypress/e2e/regression/tokens.cy.js index a8cda89eb5..0ffdd593c8 100644 --- a/cypress/e2e/regression/tokens.cy.js +++ b/cypress/e2e/regression/tokens.cy.js @@ -183,7 +183,7 @@ describe('Tokens tests', () => { }) it('Verify that when connected user is not owner, Send button is disabled', () => { - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_11) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_3) assets.selectTokenList(assets.tokenListOptions.allTokens) assets.showSendBtn(0) assets.VerifySendButtonIsDisabled() diff --git a/cypress/e2e/smoke/address_book.cy.js b/cypress/e2e/smoke/address_book.cy.js index e6144afbe0..8be8923ffa 100644 --- a/cypress/e2e/smoke/address_book.cy.js +++ b/cypress/e2e/smoke/address_book.cy.js @@ -33,17 +33,18 @@ describe('[SMOKE] Address book tests', () => { }) it('[SMOKE] Verify entry can be deleted', () => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) .then(() => { - main - .isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) - .then(() => { - cy.reload() - addressBook.clickDeleteEntryButton() - addressBook.clickDeleteEntryModalDeleteButton() - addressBook.verifyEditedNameNotExists(EDITED_NAME) - }) + cy.reload() + addressBook.clickDeleteEntryButton() + addressBook.clickDeleteEntryModalDeleteButton() + addressBook.verifyEditedNameNotExists(EDITED_NAME) }) }) diff --git a/cypress/e2e/smoke/batch_tx.cy.js b/cypress/e2e/smoke/batch_tx.cy.js index a94cfe2eba..01a5f1a929 100644 --- a/cypress/e2e/smoke/batch_tx.cy.js +++ b/cypress/e2e/smoke/batch_tx.cy.js @@ -37,23 +37,26 @@ describe('[SMOKE] Batch transaction tests', () => { }) it('[SMOKE] Verify the batch can be confirmed and related transactions exist in the form', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0).then(() => { - main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0).then(() => { + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) + .then(() => main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) + .then(() => { cy.reload() batch.clickOnBatchCounter() batch.clickOnConfirmBatchBtn() batch.verifyBatchTransactionsCount(2) batch.clickOnBatchCounter() cy.contains(funds_first_tx).parents('ul').as('TransactionList') - cy.get('@TransactionList').find('li').eq(0).find('span').eq(0).contains(funds_first_tx) - cy.get('@TransactionList').find('li').eq(1).find('span').eq(0).contains(funds_first_tx) + cy.get('@TransactionList').find('li').eq(0).contains(funds_first_tx) + cy.get('@TransactionList').find('li').eq(1).contains(funds_first_tx) }) - }) }) it('[SMOKE] Verify a transaction can be removed from the batch', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0).then(() => { - main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0).then(() => { + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) + .then(() => main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) + .then(() => { cy.reload() batch.clickOnBatchCounter() cy.contains(batch.batchedTransactionsStr).should('be.visible').parents('aside').find('ul > li').as('BatchList') @@ -61,6 +64,5 @@ describe('[SMOKE] Batch transaction tests', () => { cy.get('@BatchList').should('have.length', 1) cy.get('@BatchList').contains(funds_second_tx).should('not.exist') }) - }) }) }) diff --git a/cypress/e2e/smoke/create_tx.cy.js b/cypress/e2e/smoke/create_tx.cy.js index ce2cb9a993..ce1a668ba7 100644 --- a/cypress/e2e/smoke/create_tx.cy.js +++ b/cypress/e2e/smoke/create_tx.cy.js @@ -6,7 +6,7 @@ import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' let staticSafes = [] const sendValue = 0.00002 -const currentNonce = 2 +const currentNonce = 3 function happyPathToStepTwo() { createtx.typeRecipientAddress(constants.EOA) @@ -22,7 +22,7 @@ describe('[SMOKE] Create transactions tests', () => { beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_12) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_10) main.acceptCookies() createtx.clickOnNewtransactionBtn() createtx.clickOnSendTokensBtn() diff --git a/cypress/e2e/smoke/dashboard.cy.js b/cypress/e2e/smoke/dashboard.cy.js index ff428599bf..626625d709 100644 --- a/cypress/e2e/smoke/dashboard.cy.js +++ b/cypress/e2e/smoke/dashboard.cy.js @@ -64,7 +64,7 @@ describe('[SMOKE] Dashboard tests', { defaultCommandTimeout: 20000 }, () => { }) it('[SMOKE] Verify there is empty tx string and image when there are no tx queued', () => { - cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_10) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_13) dashboard.verifyEmptyTxSection() }) @@ -73,7 +73,7 @@ describe('[SMOKE] Dashboard tests', { defaultCommandTimeout: 20000 }, () => { }) it('[SMOKE] Verify that tx are displayed correctly in Pending tx section', () => { - cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_14) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_12) cy.wait(1000) dashboard.verifyTxItemInPendingTx(txMultiSendCall3) dashboard.verifyTxItemInPendingTx(txaddOwner) diff --git a/cypress/e2e/smoke/import_export_data.cy.js b/cypress/e2e/smoke/import_export_data.cy.js index 761083f925..6ecc9d6dd9 100644 --- a/cypress/e2e/smoke/import_export_data.cy.js +++ b/cypress/e2e/smoke/import_export_data.cy.js @@ -4,6 +4,7 @@ import * as main from '../pages/main.page' import * as constants from '../../support/constants' import * as ls from '../../support/localstorage_data.js' import * as createwallet from '../pages/create_wallet.pages' +import * as sideBar from '../pages/sidebar.pages' import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' let staticSafes = [] @@ -24,87 +25,86 @@ describe('[SMOKE] Import Export Data tests', () => { it('[SMOKE] Verify Safe can be accessed after test file upload', () => { const safe = constants.SEPOLIA_CSV_ENTRY.name - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1).then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe) - .then(() => { - cy.visit(constants.welcomeUrl) - file.clickOnOpenSafeListSidebar() - file.clickOnImportedSafe(safe) - }) - }) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe), + ) + .then(() => { + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) + return sideBar.openSidebar() + }) + .then(() => { + return file.clickOnImportedSafe(safe) + }) }) it('[SMOKE] Verify address book imported data', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1).then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe) - .then(() => { - cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_5) - file.verifyImportedAddressBookData() - }) - }) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe), + ) + .then(() => { + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_13) + file.verifyImportedAddressBookData() + }) }) it('[SMOKE] Verify pinned apps', () => { const appNames = ['Transaction Builder'] - - cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_5).then(() => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1).then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe) - .then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__safeApps, ls.pinnedApps.transactionBuilder) - .then(() => { - cy.reload().then(() => { - file.verifyPinnedApps(appNames) - }) - }) - }) + cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_13) + .then(() => cy.wrap(null)) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe), + ) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__safeApps, ls.pinnedApps.transactionBuilder), + ) + .then(() => { + cy.reload() + file.verifyPinnedApps(appNames) }) - }) }) it('[SMOKE] Verify imported data in settings', () => { const unchecked = [file.copyAddressStr] const checked = [file.darkModeStr] - - cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_5).then(() => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.settings1).then(() => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__safeApps, ls.pinnedApps.transactionBuilder).then - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1).then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe) - .then(() => { - cy.reload() - file.clickOnAppearenceBtn() - file.verifyCheckboxes(unchecked) - file.verifyCheckboxes(checked, true) - }) - }) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_13) + .then(() => cy.wrap(null)) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.settings1)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__safeApps, ls.pinnedApps.transactionBuilder), + ) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe), + ) + .then(() => { + cy.reload() + file.clickOnAppearenceBtn() + file.verifyCheckboxes(unchecked) + file.verifyCheckboxes(checked, true) }) - }) }) it('[SMOKE] Verify data for export in Data tab', () => { - cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_5).then(() => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.settings1).then(() => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1).then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__safeApps, ls.pinnedApps.transactionBuilder) - .then(() => { - main - .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe) - .then(() => { - cy.reload() - file.clickOnDataTab() - file.verifyImportModalData() - file.verifyFileDownload() - }) - }) - }) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_13) + .then(() => cy.wrap(null)) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.settings1)) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set1)) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__safeApps, ls.pinnedApps.transactionBuilder), + ) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe), + ) + .then(() => { + cy.reload() + file.clickOnDataTab() + file.verifyImportModalData() + file.verifyFileDownload() }) - }) }) }) diff --git a/cypress/e2e/smoke/import_export_data_2.cy.js b/cypress/e2e/smoke/import_export_data_2.cy.js index 91e960ba2b..675ace9b87 100644 --- a/cypress/e2e/smoke/import_export_data_2.cy.js +++ b/cypress/e2e/smoke/import_export_data_2.cy.js @@ -20,7 +20,7 @@ describe('[SMOKE] Import Export Data tests 2', () => { }) beforeEach(() => { - cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_16) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_13) cy.clearLocalStorage() main.acceptCookies() }) @@ -37,9 +37,9 @@ describe('[SMOKE] Import Export Data tests 2', () => { file.verifyImportMessages() file.verifyImportBtnStatus(constants.enabledStates.enabled) file.clickOnImportBtn() - cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_16) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_13) file.verifyImportedAddressBookData() - cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_16) + cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_13) file.verifyPinnedApps(appNames) }) @@ -52,7 +52,7 @@ describe('[SMOKE] Import Export Data tests 2', () => { }) it('[SMOKE] Verify the Import section is on the Global settings', () => { - cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_16) + cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_13) file.verifyImportSectionVisible() file.verifyValidImportInputExists() }) @@ -70,7 +70,7 @@ describe('[SMOKE] Import Export Data tests 2', () => { }) it('[SMOKE] Verify that the Export section is present in the safe settings', () => { - cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_16) + cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_13) file.verifyExportFileSectionIsVisible() }) }) diff --git a/cypress/fixtures/data_import.json b/cypress/fixtures/data_import.json index 7e9a518053..113c5980c8 100644 --- a/cypress/fixtures/data_import.json +++ b/cypress/fixtures/data_import.json @@ -1,186 +1,173 @@ { - "version": "2.0", - "data": { - "addressBook": { - "5": { - "0x61a0c717d18232711bC788F19C9Cd56a43cc8872": "test1", - "0x7724b234c9099C205F03b458944942bcEBA13408": "test2", - "0x6E45d69a383CECa3d54688e833Bd0e1388747e6B": "test3", - "0x10f999F150a2E7fd356Aa471bCBf0b75aA7b0e2A": "safe 1 goerli" + "version": "2.0", + "data": { + "addressBook": { + "5": { + "0x61a0c717d18232711bC788F19C9Cd56a43cc8872": "test1", + "0x7724b234c9099C205F03b458944942bcEBA13408": "test2", + "0x6E45d69a383CECa3d54688e833Bd0e1388747e6B": "test3", + "0x10f999F150a2E7fd356Aa471bCBf0b75aA7b0e2A": "safe 1 goerli" + }, + "100": { + "0x17b34aEf1428A358bA2eA360a098b8A3BEb698C8": "safe 1 GNO", + "0x11A6B41322C57Bd0e56cEe06abB11A1E5c1FF1BB": "Safe 2 GNO", + "0xB8d760a90a5ed54D3c2b3EFC231277e99188642A": "main xdai safe", + "0x11B1D54B66e5e226D6f89069c21A569A22D98cfd": "trez", + "0x61a0c717d18232711bC788F19C9Cd56a43cc8872": "test1", + "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8": "ow1", + "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e": "ow 2" + }, + "11155111": { + "0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7": "test-sepolia-3" + }, + "137": { + "0xC680d44F526f4372693CAc21dcab255b77bc58F4": "Safe 1 Poly", + "0x61a0c717d18232711bC788F19C9Cd56a43cc8872": "Test1 Poly" + } + }, + "addedSafes": { + "11155111": { + "0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7": { + "owners": [ + { + "value": "0xC16Db0251654C0a72E91B190d81eAD367d2C6fED", + "name": null, + "logoUri": null }, - "100": { - "0x17b34aEf1428A358bA2eA360a098b8A3BEb698C8": "safe 1 GNO", - "0x11A6B41322C57Bd0e56cEe06abB11A1E5c1FF1BB": "Safe 2 GNO", - "0xB8d760a90a5ed54D3c2b3EFC231277e99188642A": "main xdai safe", - "0x11B1D54B66e5e226D6f89069c21A569A22D98cfd": "trez", - "0x61a0c717d18232711bC788F19C9Cd56a43cc8872": "test1", - "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8": "ow1", - "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e": "ow 2" + { + "value": "0x96D4c6fFC338912322813a77655fCC926b9A5aC5", + "name": null, + "logoUri": null + } + ], + "threshold": 1, + "ethBalance": "0" + } + }, + "5": { + "0x10f999F150a2E7fd356Aa471bCBf0b75aA7b0e2A": { + "owners": [ + { + "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" }, - "11155111":{ - "0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7":"test-sepolia-3" - }, - "137": { - "0xC680d44F526f4372693CAc21dcab255b77bc58F4": "Safe 1 Poly", - "0x61a0c717d18232711bC788F19C9Cd56a43cc8872": "Test1 Poly" + { + "value": "0x61a0c717d18232711bC788F19C9Cd56a43cc8872" + } + ], + "threshold": 2, + "ethBalance": "0" + } + }, + "100": { + "0x17b34aEf1428A358bA2eA360a098b8A3BEb698C8": { + "owners": [ + { + "value": "0x11B1D54B66e5e226D6f89069c21A569A22D98cfd" } + ], + "threshold": 1, + "ethBalance": "0.001000002" }, - "addedSafes": { - "11155111":{ - - "0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7":{ - "owners":[ - { - "value":"0xC16Db0251654C0a72E91B190d81eAD367d2C6fED", - "name":null, - "logoUri":null - }, - { - "value":"0x96D4c6fFC338912322813a77655fCC926b9A5aC5", - "name":null, - "logoUri":null - } - ], - "threshold":1, - "ethBalance":"0" - } - }, - "5": { - "0x10f999F150a2E7fd356Aa471bCBf0b75aA7b0e2A": { - "owners": [ - { - "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" - }, - { - "value": "0x61a0c717d18232711bC788F19C9Cd56a43cc8872" - } - ], - "threshold": 2, - "ethBalance": "0" - } + "0x11A6B41322C57Bd0e56cEe06abB11A1E5c1FF1BB": { + "owners": [ + { + "value": "0x7724b234c9099C205F03b458944942bcEBA13408" }, - "100": { - "0x17b34aEf1428A358bA2eA360a098b8A3BEb698C8": { - "owners": [ - { - "value": "0x11B1D54B66e5e226D6f89069c21A569A22D98cfd" - } - ], - "threshold": 1, - "ethBalance": "0.001000002" - }, - "0x11A6B41322C57Bd0e56cEe06abB11A1E5c1FF1BB": { - "owners": [ - { - "value": "0x7724b234c9099C205F03b458944942bcEBA13408" - }, - { - "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" - }, - { - "value": "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" - } - ], - "threshold": 1, - "ethBalance": "0" - }, - "0xB8d760a90a5ed54D3c2b3EFC231277e99188642A": { - "owners": [ - { - "value": "0x11B1D54B66e5e226D6f89069c21A569A22D98cfd" - }, - { - "value": "0x457D3Fcb58401F9b98d83BC2fe7BF57FF57603AB" - }, - { - "value": "0x61a0c717d18232711bC788F19C9Cd56a43cc8872" - }, - { - "value": "0xFD71c1ABadBD37F60E4C8F208386dDFC4d2Bf01f" - }, - { - "value": "0x5aC255889882aCd3da2aA939679E3f3d4cea221e" - }, - { - "value": "0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8" - }, - { - "value": "0x86a9F6704280Ac2b99aBD60ed74bF9cF899bd925" - }, - { - "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" - }, - { - "value": "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" - } - ], - "threshold": 1, - "ethBalance": "0.92132507668989" - } + { + "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" }, - "137": { - "0xC680d44F526f4372693CAc21dcab255b77bc58F4": { - "owners": [ - { - "value": "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" - }, - { - "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" - } - ], - "threshold": 1, - "ethBalance": "0" - } + { + "value": "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" } + ], + "threshold": 1, + "ethBalance": "0" }, - "settings": { - "currency": "eur", - "tokenList": "TRUSTED", - "hiddenTokens": {}, - "shortName": { - "show": false, - "copy": false, - "qr": false + "0xB8d760a90a5ed54D3c2b3EFC231277e99188642A": { + "owners": [ + { + "value": "0x11B1D54B66e5e226D6f89069c21A569A22D98cfd" }, - "theme": { - "darkMode": true + { + "value": "0x457D3Fcb58401F9b98d83BC2fe7BF57FF57603AB" }, - "env": { - "rpc": {}, - "tenderly": { - "url": "", - "accessToken": "" - } + { + "value": "0x61a0c717d18232711bC788F19C9Cd56a43cc8872" }, - "signing": { - "onChainSigning": false - } - }, - "safeApps": { - "11155111": { - "pinned": [ - 24 - - ] + { + "value": "0xFD71c1ABadBD37F60E4C8F208386dDFC4d2Bf01f" }, - "5": { - "pinned": [ - 36, - 24 - ] + { + "value": "0x5aC255889882aCd3da2aA939679E3f3d4cea221e" }, - "100": { - "pinned": [ - 17, - 93 - ] + { + "value": "0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8" }, - "137": { - "pinned": [ - 71, - 17 - ] + { + "value": "0x86a9F6704280Ac2b99aBD60ed74bF9cF899bd925" + }, + { + "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" + }, + { + "value": "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" + } + ], + "threshold": 1, + "ethBalance": "0.92132507668989" + } + }, + "137": { + "0xC680d44F526f4372693CAc21dcab255b77bc58F4": { + "owners": [ + { + "value": "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" + }, + { + "value": "0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8" } + ], + "threshold": 1, + "ethBalance": "0" + } + } + }, + "settings": { + "currency": "eur", + "tokenList": "TRUSTED", + "hiddenTokens": {}, + "shortName": { + "show": false, + "copy": false, + "qr": false + }, + "theme": { + "darkMode": true + }, + "env": { + "rpc": {}, + "tenderly": { + "url": "", + "accessToken": "" } + }, + "signing": { + "onChainSigning": false + } + }, + "safeApps": { + "11155111": { + "pinned": [24] + }, + "5": { + "pinned": [36, 24] + }, + "100": { + "pinned": [17, 93] + }, + "137": { + "pinned": [71, 17] + } } -} \ No newline at end of file + } +} diff --git a/cypress/fixtures/safes/static.json b/cypress/fixtures/safes/static.json index 9e7777a0b4..14e88c853e 100644 --- a/cypress/fixtures/safes/static.json +++ b/cypress/fixtures/safes/static.json @@ -9,12 +9,8 @@ "SEP_STATIC_SAFE_8": "sep:0x9190cc22D592dDcf396Fa616ce84a9978fD96Fc9", "SEP_STATIC_SAFE_9": "sep:0x98705770aF3b18db0a64597F6d4DCe825915fec0", "SEP_STATIC_SAFE_9_SHORT": "0x9870...fec0", - "SEP_STATIC_SAFE_10": "sep:0xC23e061252BFc7967203D054136d8fA7c7df2fc4", - "SEP_STATIC_SAFE_11": "sep:0xfC0A7ac73Fde7547ac0792Cca1D8A50CE0AFC4Df", - "SEP_STATIC_SAFE_12": "sep:0xc2F3645bfd395516d1a18CA6ad9298299d328C01", - "SEP_STATIC_SAFE_13": "sep:0x10B45a24640E2170B6AA63ea3A289D723a0C9cba", - "SEP_STATIC_SAFE_14": "sep:0xFFfaC243A24EecE6553f0Da278322aCF1Fb6CeF1", - "SEP_STATIC_SAFE_15": "sep:0x027bBe128174F0e5e5d22ECe9623698E01cd3970", - "SEP_STATIC_SAFE_16": "sep:0xBc7e586D276e2da521DE8ff17255fd878621cc59", - "SEP_STATIC_SAFE_17": "sep:0x6860336C97966c17fDD812939c2E2400626a181a" + "SEP_STATIC_SAFE_10": "sep:0xc2F3645bfd395516d1a18CA6ad9298299d328C01", + "SEP_STATIC_SAFE_11": "sep:0x10B45a24640E2170B6AA63ea3A289D723a0C9cba", + "SEP_STATIC_SAFE_12": "sep:0xFFfaC243A24EecE6553f0Da278322aCF1Fb6CeF1", + "SEP_STATIC_SAFE_13": "sep:0x027bBe128174F0e5e5d22ECe9623698E01cd3970" } diff --git a/cypress/support/localstorage_data.js b/cypress/support/localstorage_data.js index 3991e3086e..6eb629a971 100644 --- a/cypress/support/localstorage_data.js +++ b/cypress/support/localstorage_data.js @@ -479,6 +479,22 @@ export const addedSafes = { }, }, 11155111: { + '0x027bBe128174F0e5e5d22ECe9623698E01cd3970': { + owners: [ + { + value: '0xC16Db0251654C0a72E91B190d81eAD367d2C6fED', + name: null, + logoUri: null, + }, + { + value: '0x96D4c6fFC338912322813a77655fCC926b9A5aC5', + name: null, + logoUri: null, + }, + ], + threshold: 1, + ethBalance: '0', + }, '0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7': { owners: [ {