From a93145c7a903ae29bc3c89ac378caa4b1d34bf9c Mon Sep 17 00:00:00 2001 From: Michael <30682308+mike10ca@users.noreply.github.com> Date: Thu, 2 May 2024 16:50:46 +0200 Subject: [PATCH] Tests: organise test safes (#3641) --- cypress/e2e/happypath/recovery_hp_1.cy.js | 9 +- cypress/e2e/happypath/recovery_hp_2.cy.js | 13 ++- cypress/e2e/happypath/recovery_hp_3.cy.js | 13 ++- .../sendfunds_connected_wallet.cy.js | 11 ++- cypress/e2e/happypath/sendfunds_queue_1.cy.js | 11 ++- cypress/e2e/happypath/sendfunds_relay.cy.js | 18 ++-- cypress/e2e/pages/address_book.page.js | 7 +- cypress/e2e/pages/dashboard.pages.js | 11 +-- cypress/e2e/pages/sidebar.pages.js | 15 ++-- cypress/e2e/regression/add_owner.cy.js | 13 ++- cypress/e2e/regression/address_book.cy.js | 9 +- cypress/e2e/regression/address_book_2.cy.js | 16 +++- cypress/e2e/regression/batch_tx.cy.js | 9 +- cypress/e2e/regression/beamer.cy.js | 8 +- cypress/e2e/regression/create_tx.cy.js | 9 +- cypress/e2e/regression/load_safe.cy.js | 11 ++- cypress/e2e/regression/load_safe_2.cy.js | 39 ++++++--- cypress/e2e/regression/nfts.cy.js | 29 +++++-- cypress/e2e/regression/remove_owner.cy.js | 11 ++- cypress/e2e/regression/replace_owner.cy.js | 17 ++-- cypress/e2e/regression/sidebar.cy.js | 13 ++- cypress/e2e/regression/sidebar_2.cy.js | 9 +- cypress/e2e/regression/sidebar_nonowner.cy.js | 9 +- cypress/e2e/regression/spending_limits.cy.js | 13 ++- .../regression/spending_limits_nonowner.cy.js | 9 +- cypress/e2e/regression/tokens.cy.js | 10 ++- cypress/e2e/regression/tx_history.cy.js | 9 +- cypress/e2e/regression/tx_history_2.cy.js | 9 +- cypress/e2e/safe-apps/apps_list.cy.js | 9 +- .../e2e/safe-apps/drain_account.spec.cy.js | 26 ++++-- cypress/e2e/safe-apps/info_modal.cy.js | 9 +- .../e2e/safe-apps/permissions_settings.cy.js | 87 ++++++++++--------- cypress/e2e/safe-apps/preview_drawer.cy.js | 9 +- cypress/e2e/safe-apps/tx-builder.spec.cy.js | 35 +++++--- cypress/e2e/smoke/add_owner.cy.js | 15 +++- cypress/e2e/smoke/address_book.cy.js | 9 +- cypress/e2e/smoke/assets.cy.js | 9 +- cypress/e2e/smoke/batch_tx.cy.js | 9 +- cypress/e2e/smoke/create_tx.cy.js | 11 ++- cypress/e2e/smoke/dashboard.cy.js | 19 ++-- cypress/e2e/smoke/import_export_data.cy.js | 15 +++- cypress/e2e/smoke/import_export_data_2.cy.js | 17 ++-- cypress/e2e/smoke/load_safe.cy.js | 19 ++-- cypress/e2e/smoke/nfts.cy.js | 9 +- cypress/e2e/smoke/replace_owner.cy.js | 11 ++- cypress/e2e/smoke/spending_limits.cy.js | 13 ++- cypress/e2e/smoke/tx_history.cy.js | 9 +- cypress/fixtures/safes/funds.json | 15 ++++ cypress/fixtures/safes/nfts.json | 4 + cypress/fixtures/safes/recovery.json | 5 ++ cypress/fixtures/safes/safeapps.json | 4 + cypress/fixtures/safes/static.json | 20 +++++ cypress/support/constants.js | 66 +------------- cypress/support/safe-apps-commands.js | 5 +- cypress/support/safes/safesHandler.js | 25 ++++++ 55 files changed, 584 insertions(+), 260 deletions(-) create mode 100644 cypress/fixtures/safes/funds.json create mode 100644 cypress/fixtures/safes/nfts.json create mode 100644 cypress/fixtures/safes/recovery.json create mode 100644 cypress/fixtures/safes/safeapps.json create mode 100644 cypress/fixtures/safes/static.json create mode 100644 cypress/support/safes/safesHandler.js diff --git a/cypress/e2e/happypath/recovery_hp_1.cy.js b/cypress/e2e/happypath/recovery_hp_1.cy.js index 2de2449d37..30ecce703a 100644 --- a/cypress/e2e/happypath/recovery_hp_1.cy.js +++ b/cypress/e2e/happypath/recovery_hp_1.cy.js @@ -3,10 +3,17 @@ import * as main from '../pages/main.page' import * as owner from '../pages/owners.pages' import * as recovery from '../pages/recovery.pages' import * as tx from '../pages/transactions.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' +let recoverySafes = [] +// describe('Recovery happy path tests 1', () => { + before(async () => { + recoverySafes = await getSafes(CATEGORIES.recovery) + }) + beforeEach(() => { - cy.visit(constants.securityUrl + constants.SEPOLIA_TEST_SAFE_23_RECOVERY_1) + cy.visit(constants.securityUrl + recoverySafes.SEP_RECOVERY_SAFE_1) cy.clearLocalStorage() main.acceptCookies() }) diff --git a/cypress/e2e/happypath/recovery_hp_2.cy.js b/cypress/e2e/happypath/recovery_hp_2.cy.js index fe5f80e95d..e1a7d2c99c 100644 --- a/cypress/e2e/happypath/recovery_hp_2.cy.js +++ b/cypress/e2e/happypath/recovery_hp_2.cy.js @@ -2,10 +2,17 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as ownerP from '../pages/owners.pages' import * as recovery from '../pages/recovery.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let recoverySafes = [] describe('Recovery happy path tests 2', () => { + before(async () => { + recoverySafes = await getSafes(CATEGORIES.recovery) + }) + beforeEach(() => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_24_RECOVERY_2) + cy.visit(constants.homeUrl + recoverySafes.SEP_RECOVERY_SAFE_2) cy.clearLocalStorage() main.acceptCookies() }) @@ -16,7 +23,7 @@ describe('Recovery happy path tests 2', () => { recovery.clickOnRecoveryExecuteBtn() return false }) - main.fetchSafeData(constants.SEPOLIA_TEST_SAFE_24_RECOVERY_2.substring(4)).then((response) => { + main.fetchSafeData(recoverySafes.SEP_RECOVERY_SAFE_2.substring(4)).then((response) => { expect(response.status).to.eq(200) console.log(response.body) expect(response.body).to.have.property('owners') @@ -42,7 +49,7 @@ describe('Recovery happy path tests 2', () => { recovery.verifyTxNotInQueue() cy.wait(2000) - main.fetchSafeData(constants.SEPOLIA_TEST_SAFE_24_RECOVERY_2.substring(4)).then((response) => { + main.fetchSafeData(recoverySafes.SEP_RECOVERY_SAFE_2.substring(4)).then((response) => { const owners = response.body.owners expect(owners).to.include(owner) }) diff --git a/cypress/e2e/happypath/recovery_hp_3.cy.js b/cypress/e2e/happypath/recovery_hp_3.cy.js index c78684e1a4..49126d321a 100644 --- a/cypress/e2e/happypath/recovery_hp_3.cy.js +++ b/cypress/e2e/happypath/recovery_hp_3.cy.js @@ -3,17 +3,24 @@ import * as main from '../pages/main.page' import * as ownerP from '../pages/owners.pages' import * as recovery from '../pages/recovery.pages' import * as tx from '../pages/transactions.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let recoverySafes = [] describe('Recovery happy path tests 3', () => { + before(async () => { + recoverySafes = await getSafes(CATEGORIES.recovery) + }) + beforeEach(() => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_25_RECOVERY_3) + cy.visit(constants.homeUrl + recoverySafes.SEP_RECOVERY_SAFE_3) cy.clearLocalStorage() main.acceptCookies() }) // Check that an owner can cancel account recovery tx it.skip('Recovery setup happy path 3', { defaultCommandTimeout: 300000 }, () => { - main.fetchSafeData(constants.SEPOLIA_TEST_SAFE_25_RECOVERY_3.substring(4)).then((response) => { + main.fetchSafeData(recoverySafes.SEP_RECOVERY_SAFE_3.substring(4)).then((response) => { expect(response.status).to.eq(200) console.log(response.body) expect(response.body).to.have.property('owners') @@ -45,7 +52,7 @@ describe('Recovery happy path tests 3', () => { tx.clickOnFinishBtn() cy.wait(1000) - main.fetchSafeData(constants.SEPOLIA_TEST_SAFE_25_RECOVERY_3.substring(4)).then((response) => { + main.fetchSafeData(recoverySafes.SEP_RECOVERY_SAFE_3.substring(4)).then((response) => { const owners = response.body.owners expect(owners).to.include(constants.SPENDING_LIMIT_ADDRESS_2) }) diff --git a/cypress/e2e/happypath/sendfunds_connected_wallet.cy.js b/cypress/e2e/happypath/sendfunds_connected_wallet.cy.js index 2d0cdba38e..330119f9f5 100644 --- a/cypress/e2e/happypath/sendfunds_connected_wallet.cy.js +++ b/cypress/e2e/happypath/sendfunds_connected_wallet.cy.js @@ -11,6 +11,7 @@ import SafeApiKit from '@safe-global/api-kit' import { createEthersAdapter, createSigners } from '../../support/api/utils_ether' import { createSafes } from '../../support/api/utils_protocolkit' import { contracts, abi_qtrust, abi_nft_pc2 } from '../../support/api/contracts' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const safeBalanceEth = 305220000000000000n const qtrustBanance = 93000000000000000025n @@ -26,6 +27,7 @@ const unit_eth = 'ether' let apiKit, protocolKitOwner1_S3, protocolKitOwner2_S3, outgoingSafeAddress let safes = [] +let safesData = [] const provider = new ethers.InfuraProvider(netwrok, Cypress.env('INFURA_API_KEY')) const privateKeys = [walletCredentials.OWNER_1_PRIVATE_KEY, walletCredentials.OWNER_2_PRIVATE_KEY] @@ -49,6 +51,7 @@ function visit(url) { describe('Send funds with connected signer happy path tests', { defaultCommandTimeout: 60000 }, () => { before(async () => { + safesData = await getSafes(CATEGORIES.funds) main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__cookies, ls.cookies.acceptedCookies) main.addToLocalStorage( constants.localStorageKeys.SAFE_v2__tokenlist_onboarding, @@ -59,7 +62,7 @@ describe('Send funds with connected signer happy path tests', { defaultCommandTi txServiceUrl: constants.stagingTxServiceUrl, }) - outgoingSafeAddress = constants.SEPOLIA_TEST_SAFE_43_SEND_FUNDS_HP13.substring(4) + outgoingSafeAddress = safesData.SEP_FUNDS_SAFE_6.substring(4) const safeConfigurations = [ { ethAdapter: ethAdapterOwner1, safeAddress: outgoingSafeAddress }, @@ -74,7 +77,7 @@ describe('Send funds with connected signer happy path tests', { defaultCommandTi it('Verify tx creation and execution of NFT with connected signer', () => { cy.wait(2000) - const originatingSafe = constants.SEPOLIA_TEST_SAFE_44_SEND_FUNDS_HP14.substring(4) + const originatingSafe = safesData.SEP_FUNDS_SAFE_7.substring(4) function executeTransactionFlow(fromSafe, toSafe) { return cy.visit(constants.balanceNftsUrl + fromSafe).then(() => { @@ -106,7 +109,7 @@ describe('Send funds with connected signer happy path tests', { defaultCommandTi it('Verify tx creation and execution of native token with connected signer', () => { cy.wait(2000) - const targetSafe = constants.SEPOLIA_TEST_SAFE_32_SEND_NATIVE_HP1.substring(4) + const targetSafe = safesData.SEP_FUNDS_SAFE_12.substring(4) function executeTransactionFlow(fromSafe, toSafe, tokenAmount) { visit(constants.BALANCE_URL + fromSafe) assets.clickOnSendBtn(0) @@ -158,7 +161,7 @@ describe('Send funds with connected signer happy path tests', { defaultCommandTi it('Verify tx creation and execution of non-native token with connected signer', () => { cy.wait(2000) - const originatingSafe = constants.SEPOLIA_TEST_SAFE_28_SEND_FUNDS_HP1.substring(4) + const originatingSafe = safesData.SEP_FUNDS_SAFE_11.substring(4) const amount = ethers.parseUnits(transferAmount, unit_eth).toString() function executeTransactionFlow(fromSafe, toSafe) { diff --git a/cypress/e2e/happypath/sendfunds_queue_1.cy.js b/cypress/e2e/happypath/sendfunds_queue_1.cy.js index 47addc0ec3..dbde035b6f 100644 --- a/cypress/e2e/happypath/sendfunds_queue_1.cy.js +++ b/cypress/e2e/happypath/sendfunds_queue_1.cy.js @@ -6,6 +6,7 @@ import { ethers } from 'ethers' import SafeApiKit from '@safe-global/api-kit' import { createEthersAdapter, createSigners } from '../../support/api/utils_ether' import { createSafes } from '../../support/api/utils_protocolkit' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) const receiver = walletCredentials.OWNER_2_WALLET_ADDRESS @@ -24,6 +25,7 @@ let apiKit, existingSafeAddress3 let safes = [] +let safesData = [] const provider = new ethers.InfuraProvider(netwrok, Cypress.env('INFURA_API_KEY')) const privateKeys = [walletCredentials.OWNER_1_PRIVATE_KEY, walletCredentials.OWNER_2_PRIVATE_KEY] @@ -51,14 +53,15 @@ function executeTransactionFlow(fromSafe) { describe('Send funds from queue happy path tests 1', () => { before(async () => { + safesData = await getSafes(CATEGORIES.funds) apiKit = new SafeApiKit({ chainId: BigInt(1), txServiceUrl: constants.stagingTxServiceUrl, }) - existingSafeAddress1 = constants.SEPOLIA_TEST_SAFE_40_SEND_FUNDS_HP9.substring(4) - existingSafeAddress2 = constants.SEPOLIA_TEST_SAFE_41_SEND_FUNDS_HP10.substring(4) - existingSafeAddress3 = constants.SEPOLIA_TEST_SAFE_41_SEND_FUNDS_HP11.substring(4) + existingSafeAddress1 = safesData.SEP_FUNDS_SAFE_3.substring(4) + existingSafeAddress2 = safesData.SEP_FUNDS_SAFE_4.substring(4) + existingSafeAddress3 = safesData.SEP_FUNDS_SAFE_5.substring(4) const safeConfigurations = [ { ethAdapter: ethAdapterOwner1, safeAddress: existingSafeAddress1 }, @@ -107,7 +110,7 @@ describe('Send funds from queue happy path tests 1', () => { }) }) - it('Verify confirmation and execution of native token queued tx by second signer with relayer', () => { + it.skip('Verify confirmation and execution of native token queued tx by second signer with relayer', () => { function executeTransactionFlow(fromSafe) { visit(constants.transactionQueueUrl + fromSafe) assets.clickOnConfirmBtn(0) diff --git a/cypress/e2e/happypath/sendfunds_relay.cy.js b/cypress/e2e/happypath/sendfunds_relay.cy.js index 67db2d0ba5..ae0c129919 100644 --- a/cypress/e2e/happypath/sendfunds_relay.cy.js +++ b/cypress/e2e/happypath/sendfunds_relay.cy.js @@ -11,6 +11,7 @@ import SafeApiKit from '@safe-global/api-kit' import { createEthersAdapter, createSigners } from '../../support/api/utils_ether' import { createSafes } from '../../support/api/utils_protocolkit' import { contracts, abi_qtrust, abi_nft_pc2 } from '../../support/api/contracts' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const safeBalanceEth = 405210000000000000n const qtrustBanance = 59000000000000000000n @@ -25,6 +26,7 @@ const unit_eth = 'ether' let apiKit, protocolKitOwner1_S3, protocolKitOwner2_S3, outgoingSafeAddress let safes = [] +let safesData = [] const provider = new ethers.InfuraProvider(netwrok, Cypress.env('INFURA_API_KEY')) const privateKeys = [walletCredentials.OWNER_1_PRIVATE_KEY, walletCredentials.OWNER_2_PRIVATE_KEY] @@ -48,6 +50,7 @@ function visit(url) { describe('Send funds with relay happy path tests', { defaultCommandTimeout: 60000 }, () => { before(async () => { + safesData = await getSafes(CATEGORIES.funds) main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__cookies, ls.cookies.acceptedCookies) main.addToLocalStorage( constants.localStorageKeys.SAFE_v2__tokenlist_onboarding, @@ -58,7 +61,7 @@ describe('Send funds with relay happy path tests', { defaultCommandTimeout: 6000 txServiceUrl: constants.stagingTxServiceUrl, }) - outgoingSafeAddress = constants.SEPOLIA_TEST_SAFE_45_SEND_FUNDS_HP15.substring(4) + outgoingSafeAddress = safesData.SEP_FUNDS_SAFE_8.substring(4) const safeConfigurations = [ { ethAdapter: ethAdapterOwner1, safeAddress: outgoingSafeAddress }, @@ -71,10 +74,9 @@ describe('Send funds with relay happy path tests', { defaultCommandTimeout: 6000 protocolKitOwner2_S3 = safes[1] }) - it('Verify tx creation and execution of NFT with relay', () => { + it.skip('Verify tx creation and execution of NFT with relay', () => { cy.wait(2000) - const originatingSafe = constants.SEPOLIA_TEST_SAFE_46_SEND_FUNDS_HP16.substring(4) - + const originatingSafe = safesData.SEP_FUNDS_SAFE_9.substring(4) function executeTransactionFlow(fromSafe, toSafe) { return cy.visit(constants.balanceNftsUrl + fromSafe).then(() => { nfts.selectNFTs(1) @@ -104,9 +106,9 @@ describe('Send funds with relay happy path tests', { defaultCommandTimeout: 6000 }) }) - it('Verify tx creation and execution of native token with relay', () => { + it.skip('Verify tx creation and execution of native token with relay', () => { cy.wait(2000) - const targetSafe = constants.SEPOLIA_TEST_SAFE_34_SEND_FUNDS_HP3.substring(4) + const targetSafe = safesData.SEP_FUNDS_SAFE_1.substring(4) function executeTransactionFlow(fromSafe, toSafe, tokenAmount) { visit(constants.BALANCE_URL + fromSafe) assets.clickOnSendBtn(0) @@ -156,9 +158,9 @@ describe('Send funds with relay happy path tests', { defaultCommandTimeout: 6000 }) }) - it('Verify tx creation and execution of non-native token with with relay', () => { + it.skip('Verify tx creation and execution of non-native token with with relay', () => { cy.wait(2000) - const originatingSafe = constants.SEPOLIA_TEST_SAFE_36_SEND_FUNDS_HP5.substring(4) + const originatingSafe = safesData.SEP_FUNDS_SAFE_2.substring(4) const amount = ethers.parseUnits(transferAmount, unit_eth).toString() function executeTransactionFlow(fromSafe, toSafe) { diff --git a/cypress/e2e/pages/address_book.page.js b/cypress/e2e/pages/address_book.page.js index 0fee419e05..8f998797e7 100644 --- a/cypress/e2e/pages/address_book.page.js +++ b/cypress/e2e/pages/address_book.page.js @@ -1,5 +1,6 @@ -import * as constants from '../../support/constants' -import * as main from '../pages/main.page' +import * as constants from '../../support/constants.js' +import * as main from './main.page.js' +import staticSafes from '../../fixtures/safes/static.json' export const addressBookRecipient = '[data-testid="address-book-recipient"]' const beameriFrameContainer = '#beamerOverlay .iframeCointaner' @@ -119,7 +120,7 @@ export function addEntryByENS(name, ens) { typeInName(name) typeInAddress(ens) clickOnSaveEntryBtn() - verifyNewEntryAdded(name, constants.SEPOLIA_TEST_SAFE_7) + verifyNewEntryAdded(name, staticSafes.SEP_STATIC_SAFE_6) } export function verifyModalSummaryMessage(entryCount, chainCount) { diff --git a/cypress/e2e/pages/dashboard.pages.js b/cypress/e2e/pages/dashboard.pages.js index 263604d368..6dc024f54e 100644 --- a/cypress/e2e/pages/dashboard.pages.js +++ b/cypress/e2e/pages/dashboard.pages.js @@ -1,7 +1,8 @@ -import * as constants from '../../support/constants' -import * as safeapps from '../pages/safeapps.pages' -import * as main from '../pages/main.page' -import * as createtx from '../../e2e/pages/create_tx.pages' +import * as constants from '../../support/constants.js' +import * as safeapps from './safeapps.pages.js' +import * as main from './main.page.js' +import * as createtx from './create_tx.pages.js' +import staticSafes from '../../fixtures/safes/static.json' const connectAndTransactStr = 'Connect & transact' const transactionQueueStr = 'Pending transactions' @@ -137,7 +138,7 @@ export function verifyTxQueueWidget() { ).should('exist') cy.contains( - `a[href="${constants.transactionQueueUrl}${encodeURIComponent(constants.SEPOLIA_TEST_SAFE_5)}"]`, + `a[href="${constants.transactionQueueUrl}${encodeURIComponent(staticSafes.SEP_STATIC_SAFE_2)}"]`, viewAllStr, ) }) diff --git a/cypress/e2e/pages/sidebar.pages.js b/cypress/e2e/pages/sidebar.pages.js index 63f78ba21c..882f872abe 100644 --- a/cypress/e2e/pages/sidebar.pages.js +++ b/cypress/e2e/pages/sidebar.pages.js @@ -1,9 +1,10 @@ -import * as constants from '../../support/constants' -import * as main from './main.page' -import * as modal from '../pages/modals.page' -import * as navigation from './navigation.page' -import { safeHeaderInfo } from './import_export.pages' -import * as file from '../pages/import_export.pages' +import * as constants from '../../support/constants.js' +import * as main from './main.page.js' +import * as modal from './modals.page.js' +import * as navigation from './navigation.page.js' +import { safeHeaderInfo } from './import_export.pages.js' +import * as file from './import_export.pages.js' +import safes from '../../fixtures/safes/static.json' export const chainLogo = '[data-testid="chain-logo"]' const safeIcon = '[data-testid="safe-icon"]' @@ -36,7 +37,7 @@ export const pendingActivationIcon = '[data-testid="pending-activation-icon"]' export const addedSafesEth = ['0x8675...a19b'] export const addedSafesSepolia = ['0x6d0b...6dC1', '0x5912...fFdb', '0x0637...708e', '0xD157...DE9a'] export const sideBarListItems = ['Home', 'Assets', 'Transactions', 'Address book', 'Apps', 'Settings'] -export const testSafeHeaderDetails = ['2/2', constants.SEPOLIA_TEST_SAFE_13_SHORT] +export const testSafeHeaderDetails = ['2/2', safes.SEP_STATIC_SAFE_9_SHORT] const receiveAssetsStr = 'Receive assets' export function getImportBtn() { diff --git a/cypress/e2e/regression/add_owner.cy.js b/cypress/e2e/regression/add_owner.cy.js index 8f8b925087..23c1e802e4 100644 --- a/cypress/e2e/regression/add_owner.cy.js +++ b/cypress/e2e/regression/add_owner.cy.js @@ -2,10 +2,17 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as owner from '../pages/owners.pages' import * as addressBook from '../pages/address_book.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Add Owners tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() main.acceptCookies() cy.contains(owner.safeAccountNonceStr, { timeout: 10000 }) @@ -31,13 +38,13 @@ describe('Add Owners tests', () => { }) it('Verify that the "Name" field is auto-filled with the relevant name from Address Book', () => { - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) addressBook.clickOnCreateEntryBtn() addressBook.typeInName(constants.addresBookContacts.user1.name) addressBook.typeInAddress(constants.addresBookContacts.user1.address) addressBook.clickOnSaveEntryBtn() addressBook.verifyNewEntryAdded(constants.addresBookContacts.user1.name, constants.addresBookContacts.user1.address) - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) owner.waitForConnectionStatus() owner.openAddOwnerWindow() owner.typeOwnerAddress(constants.addresBookContacts.user1.address) diff --git a/cypress/e2e/regression/address_book.cy.js b/cypress/e2e/regression/address_book.cy.js index b2f9ee4150..bae7a4b6e6 100644 --- a/cypress/e2e/regression/address_book.cy.js +++ b/cypress/e2e/regression/address_book.cy.js @@ -6,14 +6,21 @@ import * as addressBook from '../../e2e/pages/address_book.page' import * as main from '../../e2e/pages/main.page' import * as ls from '../../support/localstorage_data.js' import * as sidebar from '../pages/sidebar.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const NAME = 'Owner1' const EDITED_NAME = 'Edited Owner1' const importedSafe = 'imported-safe' describe('Address book tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() main.acceptCookies() }) diff --git a/cypress/e2e/regression/address_book_2.cy.js b/cypress/e2e/regression/address_book_2.cy.js index ddf0f3bff3..9f49706fae 100644 --- a/cypress/e2e/regression/address_book_2.cy.js +++ b/cypress/e2e/regression/address_book_2.cy.js @@ -4,6 +4,9 @@ import * as main from '../pages/main.page.js' import * as ls from '../../support/localstorage_data.js' import * as createtx from '../../e2e/pages/create_tx.pages' import * as data from '../../fixtures/txhistory_data_data.json' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const typeReceive = data.type.receive @@ -12,8 +15,12 @@ const onwer2 = 'Changed Automation owner' const onwer3 = 'New Automation owner' describe('Address book tests - 2', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() cy.wait(1000) main.acceptCookies() @@ -42,20 +49,21 @@ describe('Address book tests - 2', () => { addressBook.typeInNameInput(onwer2) addressBook.clickOnSaveEntryBtn() addressBook.verifyNameWasChanged(owner1, onwer2) - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) addressBook.verifyNameWasChanged(owner1, onwer2) }) it('Verify that editing an entry from the transaction details updates the name in address book', () => { - cy.visit(constants.transactionsHistoryUrl + constants.SEPOLIA_TEST_SAFE_8) + cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7) main.waitForHistoryCallToComplete() + console.log(typeReceive.summaryTitle) createtx.clickOnTransactionItemByName(typeReceive.summaryTitle, typeReceive.summaryTxInfo) addressBook.clickOnMoreActionsBtn() addressBook.clickOnAddToAddressBookBtn() addressBook.typeInNameInput(onwer3) addressBook.clickOnSaveEntryBtn() addressBook.verifyNameWasChanged(owner1, onwer3) - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_8) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_7) addressBook.verifyNameWasChanged(owner1, onwer3) }) diff --git a/cypress/e2e/regression/batch_tx.cy.js b/cypress/e2e/regression/batch_tx.cy.js index 7ae147fee7..6986e03460 100644 --- a/cypress/e2e/regression/batch_tx.cy.js +++ b/cypress/e2e/regression/batch_tx.cy.js @@ -2,15 +2,22 @@ import * as batch from '../pages/batches.pages' import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as owner from '../../e2e/pages/owners.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const currentNonce = 3 const funds_first_tx = '0.001' const funds_second_tx = '0.002' +let staticSafes = [] + describe('Batch transaction tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2) owner.waitForConnectionStatus() main.acceptCookies() }) diff --git a/cypress/e2e/regression/beamer.cy.js b/cypress/e2e/regression/beamer.cy.js index 4280e7f15a..7dd046e3dc 100644 --- a/cypress/e2e/regression/beamer.cy.js +++ b/cypress/e2e/regression/beamer.cy.js @@ -1,11 +1,15 @@ import * as constants from '../../support/constants' import * as addressbook from '../pages/address_book.page' import * as main from '../../e2e/pages/main.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Beamer tests', () => { - before(() => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) cy.clearLocalStorage() - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) main.acceptCookies() }) diff --git a/cypress/e2e/regression/create_tx.cy.js b/cypress/e2e/regression/create_tx.cy.js index 69fb2d9f1a..fbb218bed9 100644 --- a/cypress/e2e/regression/create_tx.cy.js +++ b/cypress/e2e/regression/create_tx.cy.js @@ -1,6 +1,9 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as createtx from '../../e2e/pages/create_tx.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const sendValue = 0.00002 @@ -12,9 +15,13 @@ function happyPathToStepTwo() { } describe('Create transactions tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_7) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_6) main.acceptCookies() createtx.clickOnNewtransactionBtn() createtx.clickOnSendTokensBtn() diff --git a/cypress/e2e/regression/load_safe.cy.js b/cypress/e2e/regression/load_safe.cy.js index 1846ee3fc1..87533108d8 100644 --- a/cypress/e2e/regression/load_safe.cy.js +++ b/cypress/e2e/regression/load_safe.cy.js @@ -3,6 +3,9 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safe from '../pages/load_safe.pages' import * as createwallet from '../pages/create_wallet.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const testSafeName = 'Test safe name' const testOwnerName = 'Test Owner Name' @@ -19,6 +22,10 @@ const OWNER_ENS_DEFAULT_NAME = 'test20.eth' const OWNER_ADDRESS = constants.EOA describe('Load Safe tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.loadNewSafeSepoliaUrl) @@ -27,14 +34,14 @@ describe('Load Safe tests', () => { }) it('Verify custom name in the first owner can be set', () => { - safe.inputNameAndAddress(testSafeName, constants.SEPOLIA_TEST_SAFE_1) + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_4) safe.clickOnNextBtn() createwallet.typeOwnerName(testOwnerName, 0) safe.clickOnNextBtn() }) it('Verify Safe and owner names are displayed in the Review step', () => { - safe.inputNameAndAddress(testSafeName, constants.SEPOLIA_TEST_SAFE_1) + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_4) safe.clickOnNextBtn() createwallet.typeOwnerName(testOwnerName, 0) safe.clickOnNextBtn() diff --git a/cypress/e2e/regression/load_safe_2.cy.js b/cypress/e2e/regression/load_safe_2.cy.js index 080a5edc62..0ddcf3d84f 100644 --- a/cypress/e2e/regression/load_safe_2.cy.js +++ b/cypress/e2e/regression/load_safe_2.cy.js @@ -4,12 +4,27 @@ import * as main from '../pages/main.page' import * as safe from '../pages/load_safe.pages' import * as ls from '../../support/localstorage_data.js' import * as owner from '../pages/owners.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes, + fundSafes = [] const ownerNames = ['Automation owner'] const ownerSepolia = ['Automation owner Sepolia'] const ownerEth = ['Automation owner Eth'] describe('Load Safe tests 2', () => { + before(() => { + getSafes(CATEGORIES.funds) + .then((funds) => { + fundSafes = funds + return getSafes(CATEGORIES.static) + }) + .then((statics) => { + staticSafes = statics + }) + }) + beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.loadNewSafeSepoliaUrl) @@ -22,7 +37,7 @@ describe('Load Safe tests 2', () => { .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName) .then(() => { cy.reload() - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) safe.clickOnNextBtn() safe.verifyOwnerNames(ownerNames) safe.verifyOnwerInputIsNotEmpty(0) @@ -30,21 +45,21 @@ describe('Load Safe tests 2', () => { }) it('Verify Safe address checksum', () => { - safe.verifyAddressCheckSum(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) - safe.verifyAddressInputValue(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE.split(':')[1].toLowerCase()) - safe.verifyAddressInputValue(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) + 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) }) it('Verify owner name cannot be longer than 50 characters', () => { - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) 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(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) safe.clickOnNextBtn() safe.verifyOnwerNameENS(1, constants.ENS_TEST_SEPOLIA_VALID) }) @@ -56,13 +71,13 @@ describe('Load Safe tests 2', () => { cy.reload() safe.clickNetworkSelector(constants.networks.sepolia) safe.selectEth() - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_21_LOAD_SAFE) + safe.inputAddress(fundSafes.ETH_FUNDS_SAFE_13) safe.clickOnNextBtn() safe.verifyOwnerNames(ownerEth) safe.clickOnBackBtn() safe.clickNetworkSelector(constants.networks.ethereum) safe.selectSepolia() - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) safe.clickOnNextBtn() safe.verifyOwnerNames(ownerSepolia) }) @@ -74,21 +89,21 @@ describe('Load Safe tests 2', () => { }) it('Verify a valid address can be entered', () => { - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_20_LOAD_SAFE) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_15) 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(constants.SEPOLIA_TEST_SAFE_3) + safe.inputAddress(staticSafes.SEP_STATIC_SAFE_5) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.safeAlreadyAdded) safe.verifyNextButtonStatus(constants.enabledStates.disabled) }) }) it('Verify that the wrong prefix is not allowed', () => { - safe.inputAddress(constants.SEPOLIA_TEST_SAFE_21_LOAD_SAFE) + safe.inputAddress(fundSafes.ETH_FUNDS_SAFE_13) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.prefixMismatch) safe.verifyNextButtonStatus(constants.enabledStates.disabled) }) diff --git a/cypress/e2e/regression/nfts.cy.js b/cypress/e2e/regression/nfts.cy.js index 7d4338c421..700161492e 100644 --- a/cypress/e2e/regression/nfts.cy.js +++ b/cypress/e2e/regression/nfts.cy.js @@ -3,16 +3,31 @@ import * as main from '../pages/main.page' import * as nfts from '../pages/nfts.pages' import * as navigation from '../pages/navigation.page' import * as createTx from '../pages/create_tx.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const singleNFT = ['safeTransferFrom'] const multipleNFT = ['multiSend'] const multipleNFTAction = 'safeTransferFrom' const NFTSentName = 'GTT #22' +let nftsSafes, + staticSafes = [] + describe('NFTs tests', () => { + before(() => { + getSafes(CATEGORIES.nfts) + .then((nfts) => { + nftsSafes = nfts + return getSafes(CATEGORIES.static) + }) + .then((statics) => { + staticSafes = statics + }) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.balanceNftsUrl + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.balanceNftsUrl + staticSafes.SEP_STATIC_SAFE_2) main.acceptCookies() nfts.waitForNftItems(2) }) @@ -24,7 +39,7 @@ describe('NFTs tests', () => { nfts.deselectNFTs([2], 3) nfts.sendNFT() nfts.verifyNFTModalData() - nfts.typeRecipientAddress(constants.SEPOLIA_TEST_SAFE_4) + nfts.typeRecipientAddress(staticSafes.SEP_STATIC_SAFE_1) nfts.clikOnNextBtn() nfts.verifyReviewModalData(2) }) @@ -33,7 +48,7 @@ describe('NFTs tests', () => { nfts.verifyInitialNFTData() nfts.selectNFTs(1) nfts.sendNFT() - nfts.typeRecipientAddress(constants.SEPOLIA_TEST_SAFE_4) + nfts.typeRecipientAddress(staticSafes.SEP_STATIC_SAFE_1) nfts.clikOnNextBtn() nfts.verifyTxDetails(singleNFT) nfts.verifyCountOfActions(0) @@ -43,7 +58,7 @@ describe('NFTs tests', () => { nfts.verifyInitialNFTData() nfts.selectNFTs(2) nfts.sendNFT() - nfts.typeRecipientAddress(constants.SEPOLIA_TEST_SAFE_4) + nfts.typeRecipientAddress(staticSafes.SEP_STATIC_SAFE_1) nfts.clikOnNextBtn() nfts.verifyTxDetails(multipleNFT) nfts.verifyCountOfActions(2) @@ -52,7 +67,7 @@ describe('NFTs tests', () => { }) it('Verify Send button is disabled for non-owner', () => { - cy.visit(constants.balanceNftsUrl + constants.SEPOLIA_TEST_SAFE_19_NONOWNER_NFT) + cy.visit(constants.balanceNftsUrl + nftsSafes.SEP_NFT_SAFE_2) nfts.verifyInitialNFTData() nfts.selectNFTs(1) nfts.verifySendNFTBtnDisabled() @@ -66,11 +81,11 @@ describe('NFTs tests', () => { }) it('Verify Send NFT transaction has been created', () => { - cy.visit(constants.balanceNftsUrl + constants.SEPOLIA_TEST_SAFE_27_SEND_NFT) + cy.visit(constants.balanceNftsUrl + nftsSafes.SEP_NFT_SAFE_1) nfts.verifyInitialNFTData() nfts.selectNFTs(1) nfts.sendNFT() - nfts.typeRecipientAddress(constants.SEPOLIA_TEST_SAFE_4) + nfts.typeRecipientAddress(staticSafes.SEP_STATIC_SAFE_1) createTx.changeNonce(2) nfts.clikOnNextBtn() createTx.clickOnSignTransactionBtn() diff --git a/cypress/e2e/regression/remove_owner.cy.js b/cypress/e2e/regression/remove_owner.cy.js index d4df4d28c0..c702640b3e 100644 --- a/cypress/e2e/regression/remove_owner.cy.js +++ b/cypress/e2e/regression/remove_owner.cy.js @@ -3,10 +3,17 @@ import * as main from '../../e2e/pages/main.page' import * as owner from '../pages/owners.pages' import * as createwallet from '../pages/create_wallet.pages' import * as createTx from '../pages/create_tx.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Remove Owners tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_3) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_5) main.waitForHistoryCallToComplete() cy.clearLocalStorage() main.acceptCookies() @@ -19,7 +26,7 @@ describe('Remove Owners tests', () => { }) it('Verify Tooltip displays correct message for Non-Owner', () => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_4) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_1) main.waitForHistoryCallToComplete() owner.waitForConnectionStatus() owner.verifyRemoveBtnIsDisabled() diff --git a/cypress/e2e/regression/replace_owner.cy.js b/cypress/e2e/regression/replace_owner.cy.js index 8da80ffded..434bb24e41 100644 --- a/cypress/e2e/regression/replace_owner.cy.js +++ b/cypress/e2e/regression/replace_owner.cy.js @@ -3,12 +3,19 @@ import * as main from '../../e2e/pages/main.page' import * as owner from '../pages/owners.pages' import * as addressBook from '../pages/address_book.page' import * as createTx from '../pages/create_tx.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const ownerName = 'Replacement Signer Name' describe('Replace Owners tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() main.acceptCookies() cy.contains(owner.safeAccountNonceStr, { timeout: 10000 }) @@ -31,13 +38,13 @@ describe('Replace Owners tests', () => { // TODO: Rework with localstorage it('Verify that Address input auto-fills with related value', () => { - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) addressBook.clickOnCreateEntryBtn() addressBook.typeInName(constants.addresBookContacts.user1.name) addressBook.typeInAddress(constants.addresBookContacts.user1.address) addressBook.clickOnSaveEntryBtn() addressBook.verifyNewEntryAdded(constants.addresBookContacts.user1.name, constants.addresBookContacts.user1.address) - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) owner.waitForConnectionStatus() owner.openReplaceOwnerWindow() owner.typeOwnerAddress(constants.addresBookContacts.user1.address) @@ -61,7 +68,7 @@ describe('Replace Owners tests', () => { owner.typeOwnerAddress(constants.addresBookContacts.user1.address.toUpperCase()) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.invalidChecksum) - owner.typeOwnerAddress(constants.SEPOLIA_TEST_SAFE_1) + owner.typeOwnerAddress(staticSafes.SEP_STATIC_SAFE_4) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.ownSafe) owner.typeOwnerAddress(constants.addresBookContacts.user1.address.replace('F', 'f')) @@ -72,7 +79,7 @@ describe('Replace Owners tests', () => { }) it("Verify 'Replace' tx is created", () => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_26_REPLACE_OWNER) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_17) owner.waitForConnectionStatus() owner.openReplaceOwnerWindow() cy.wait(1000) diff --git a/cypress/e2e/regression/sidebar.cy.js b/cypress/e2e/regression/sidebar.cy.js index 101be1ea5a..eeb45df9b1 100644 --- a/cypress/e2e/regression/sidebar.cy.js +++ b/cypress/e2e/regression/sidebar.cy.js @@ -2,10 +2,17 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as sideBar from '../pages/sidebar.pages' import * as navigation from '../pages/navigation.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Sidebar tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_13) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9) cy.clearLocalStorage() main.acceptCookies() }) @@ -24,7 +31,7 @@ describe('Sidebar tests', () => { }) it.skip('Verify Copy button copies the address', () => { - sideBar.verifyCopyAddressBtn(constants.SEPOLIA_TEST_SAFE_13.substring(4)) + sideBar.verifyCopyAddressBtn(staticSafes.SEP_STATIC_SAFE_9.substring(4)) }) it('Verify Open blockexplorer button contain etherscan link', () => { @@ -36,7 +43,7 @@ describe('Sidebar tests', () => { }) it('Verify New transaction button enabled for beneficiaries who are non-owners', () => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_14) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_10) sideBar.verifyNewTxBtnStatus(constants.enabledStates.enabled) }) diff --git a/cypress/e2e/regression/sidebar_2.cy.js b/cypress/e2e/regression/sidebar_2.cy.js index 9d9a25290c..7f82bfcfa2 100644 --- a/cypress/e2e/regression/sidebar_2.cy.js +++ b/cypress/e2e/regression/sidebar_2.cy.js @@ -3,14 +3,21 @@ import * as main from '../pages/main.page' import * as sideBar from '../pages/sidebar.pages' import * as ls from '../../support/localstorage_data.js' import * as assets from '../pages/assets.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const newSafeName = 'Added safe 3' const addedSafe900 = 'Added safe 900' const staticSafe200 = 'Added safe 200' describe('Sidebar added sidebar tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_13) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9) cy.wait(2000) cy.clearLocalStorage() main.acceptCookies() diff --git a/cypress/e2e/regression/sidebar_nonowner.cy.js b/cypress/e2e/regression/sidebar_nonowner.cy.js index c399fa9f66..4e02c0571a 100644 --- a/cypress/e2e/regression/sidebar_nonowner.cy.js +++ b/cypress/e2e/regression/sidebar_nonowner.cy.js @@ -3,13 +3,20 @@ import * as main from '../pages/main.page.js' import * as sideBar from '../pages/sidebar.pages.js' import * as navigation from '../pages/navigation.page.js' import * as ls from '../../support/localstorage_data.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const addedOwner = 'Added owner' const addedNonowner = 'Added non-owner' describe('Sidebar non-owner tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_17_SIDEBAR_NONOWNER) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_13) 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 8a8b79f935..1e95615d7d 100644 --- a/cypress/e2e/regression/spending_limits.cy.js +++ b/cypress/e2e/regression/spending_limits.cy.js @@ -5,14 +5,21 @@ import * as owner from '../pages/owners.pages' import * as navigation from '../pages/navigation.page' import * as tx from '../pages/create_tx.pages' import * as ls from '../../support/localstorage_data.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const tokenAmount = 0.1 const newTokenAmount = 0.001 const spendingLimitBalance = '(0.17 ETH)' describe('Spending limits tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.securityUrl + constants.SEPOLIA_TEST_SAFE_12) + cy.visit(constants.securityUrl + staticSafes.SEP_STATIC_SAFE_8) cy.clearLocalStorage() main.acceptCookies() owner.waitForConnectionStatus() @@ -22,12 +29,12 @@ describe('Spending limits tests', () => { it('Verify that the Review step shows beneficiary, amount allowed, reset time', () => { //Assume that default reset time is set to One time spendinglimit.clickOnNewSpendingLimitBtn() - spendinglimit.enterBeneficiaryAddress(constants.SEPOLIA_TEST_SAFE_7) + spendinglimit.enterBeneficiaryAddress(staticSafes.SEP_STATIC_SAFE_6) spendinglimit.enterSpendingLimitAmount(0.1) spendinglimit.clickOnNextBtn() spendinglimit.checkReviewData( tokenAmount, - constants.SEPOLIA_TEST_SAFE_7, + staticSafes.SEP_STATIC_SAFE_6, spendinglimit.timePeriodOptions.oneTime.split(' ').join('-'), ) }) diff --git a/cypress/e2e/regression/spending_limits_nonowner.cy.js b/cypress/e2e/regression/spending_limits_nonowner.cy.js index 8df3489f4d..bd2d2dc1cc 100644 --- a/cypress/e2e/regression/spending_limits_nonowner.cy.js +++ b/cypress/e2e/regression/spending_limits_nonowner.cy.js @@ -2,10 +2,17 @@ import * as constants from '../../support/constants.js' import * as main from '../pages/main.page.js' import * as spendinglimit from '../pages/spending_limits.pages.js' import * as owner from '../pages/owners.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Spending limits non-owner tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.securityUrl + constants.SEPOLIA_TEST_SAFE_2) + cy.visit(constants.securityUrl + staticSafes.SEP_STATIC_SAFE_3) cy.clearLocalStorage() main.acceptCookies() owner.waitForConnectionStatus() diff --git a/cypress/e2e/regression/tokens.cy.js b/cypress/e2e/regression/tokens.cy.js index 927c8e149c..a8cda89eb5 100644 --- a/cypress/e2e/regression/tokens.cy.js +++ b/cypress/e2e/regression/tokens.cy.js @@ -2,16 +2,22 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as assets from '../pages/assets.pages' import * as owner from '../pages/owners.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const ASSET_NAME_COLUMN = 0 const TOKEN_AMOUNT_COLUMN = 1 const FIAT_AMOUNT_COLUMN = 2 +let staticSafes = [] + describe('Tokens tests', () => { const fiatRegex = assets.fiatRegex + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) beforeEach(() => { - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2) cy.clearLocalStorage() main.acceptCookies() }) @@ -177,7 +183,7 @@ describe('Tokens tests', () => { }) it('Verify that when connected user is not owner, Send button is disabled', () => { - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_15_TOKEN) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_11) assets.selectTokenList(assets.tokenListOptions.allTokens) assets.showSendBtn(0) assets.VerifySendButtonIsDisabled() diff --git a/cypress/e2e/regression/tx_history.cy.js b/cypress/e2e/regression/tx_history.cy.js index 625a65c5b8..d183720011 100644 --- a/cypress/e2e/regression/tx_history.cy.js +++ b/cypress/e2e/regression/tx_history.cy.js @@ -2,6 +2,9 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as createTx from '../pages/create_tx.pages' import * as data from '../../fixtures/txhistory_data_data.json' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const typeCreateAccount = data.type.accountCreation const typeReceive = data.type.receive @@ -12,9 +15,13 @@ const typeSideActions = data.type.sideActions const typeGeneral = data.type.general describe('Tx history tests 1', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.transactionsHistoryUrl + constants.SEPOLIA_TEST_SAFE_8) + cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7) main.acceptCookies() }) diff --git a/cypress/e2e/regression/tx_history_2.cy.js b/cypress/e2e/regression/tx_history_2.cy.js index af633f5693..db98c415c7 100644 --- a/cypress/e2e/regression/tx_history_2.cy.js +++ b/cypress/e2e/regression/tx_history_2.cy.js @@ -2,6 +2,9 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as createTx from '../pages/create_tx.pages' import * as data from '../../fixtures/txhistory_data_data.json' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const typeOnchainRejection = data.type.onchainRejection const typeBatch = data.type.batchNativeTransfer @@ -15,9 +18,13 @@ const typeGeneral = data.type.general const typeUntrustedToken = data.type.untrustedReceivedToken describe('Tx history tests 2', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.transactionsHistoryUrl + constants.SEPOLIA_TEST_SAFE_8) + cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7) main.acceptCookies() }) diff --git a/cypress/e2e/safe-apps/apps_list.cy.js b/cypress/e2e/safe-apps/apps_list.cy.js index 13fbf370ef..7d3e4750e9 100644 --- a/cypress/e2e/safe-apps/apps_list.cy.js +++ b/cypress/e2e/safe-apps/apps_list.cy.js @@ -1,14 +1,21 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' const myCustomAppTitle = 'Cypress Test App' const myCustomAppDescrAdded = 'Cypress Test App Description' +let staticSafes = [] + describe('Safe Apps list tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(`${constants.appsUrl}?safe=${constants.SEPOLIA_TEST_SAFE_4}`, { + cy.visit(`${constants.appsUrl}?safe=${staticSafes.SEP_STATIC_SAFE_1}`, { failOnStatusCode: false, }) main.acceptCookies() diff --git a/cypress/e2e/safe-apps/drain_account.spec.cy.js b/cypress/e2e/safe-apps/drain_account.spec.cy.js index 07ada74d84..032e751572 100644 --- a/cypress/e2e/safe-apps/drain_account.spec.cy.js +++ b/cypress/e2e/safe-apps/drain_account.spec.cy.js @@ -3,14 +3,22 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' import * as navigation from '../pages/navigation.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let safeAppSafes = [] +let iframeSelector describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { - const appUrl = constants.drainAccount_url - const iframeSelector = `iframe[id="iframe-${appUrl}"]` - const visitUrl = `/apps/open?safe=${constants.SEPOLIA_TEST_SAFE_9}&appUrl=${encodeURIComponent(appUrl)}` + before(async () => { + safeAppSafes = await getSafes(CATEGORIES.safeapps) + }) beforeEach(() => { - cy.intercept(`**//v1/chains/11155111/safes/${constants.SEPOLIA_TEST_SAFE_9.substring(4)}/balances/**`, { + const appUrl = constants.drainAccount_url + iframeSelector = `iframe[id="iframe-${appUrl}"]` + const visitUrl = `/apps/open?safe=${safeAppSafes.SEP_SAFEAPP_SAFE_1}&appUrl=${encodeURIComponent(appUrl)}` + + cy.intercept(`**//v1/chains/11155111/safes/${safeAppSafes.SEP_SAFEAPP_SAFE_1.substring(4)}/balances/**`, { fixture: 'balances.json', }) @@ -22,7 +30,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { it('Verify drain can be created', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.recipientStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.recipientStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findAllByText(safeapps.transferEverythingStr).click() }) cy.findByRole('button', { name: safeapps.testTransfer1 }) @@ -34,7 +42,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click() getBody().findAllByLabelText(safeapps.selectRowChbxStr).eq(1).click() getBody().findAllByLabelText(safeapps.selectRowChbxStr).eq(2).click() - getBody().findByLabelText(safeapps.recipientStr).clear().type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.recipientStr).clear().type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findAllByText(safeapps.transfer2AssetsStr).click() }) cy.findByRole('button', { name: safeapps.testTransfer2 }) @@ -53,7 +61,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { it('Verify when cancelling a drain, previous data is preserved', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.recipientStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.recipientStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findAllByText(safeapps.transferEverythingStr).click() }) navigation.clickOnModalCloseBtn() @@ -71,7 +79,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { it('Verify a drain cannot be created with invalid recipient selected', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.recipientStr).type(constants.SEPOLIA_TEST_SAFE_10.substring(1)) + getBody().findByLabelText(safeapps.recipientStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2.substring(1)) getBody().findAllByText(safeapps.transferEverythingStr).click() getBody().findByText(safeapps.validRecipientAddressStr) }) @@ -80,7 +88,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { it('Verify a drain cannot be created when no assets are selected', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click() - getBody().findByLabelText(safeapps.recipientStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.recipientStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findAllByText(safeapps.noTokensSelectedStr).should('be.visible') }) }) diff --git a/cypress/e2e/safe-apps/info_modal.cy.js b/cypress/e2e/safe-apps/info_modal.cy.js index db7d25c729..f89febd702 100644 --- a/cypress/e2e/safe-apps/info_modal.cy.js +++ b/cypress/e2e/safe-apps/info_modal.cy.js @@ -1,11 +1,18 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Info modal tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(`${constants.appsUrl}?safe=${constants.SEPOLIA_TEST_SAFE_5}`, { + cy.visit(`${constants.appsUrl}?safe=${staticSafes.SEP_STATIC_SAFE_2}`, { failOnStatusCode: false, }) main.acceptCookies() diff --git a/cypress/e2e/safe-apps/permissions_settings.cy.js b/cypress/e2e/safe-apps/permissions_settings.cy.js index a530f0c182..d332f11550 100644 --- a/cypress/e2e/safe-apps/permissions_settings.cy.js +++ b/cypress/e2e/safe-apps/permissions_settings.cy.js @@ -1,55 +1,58 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' -let $dapps = [] +let $dapps, + staticSafes = [] const app1 = 'https://app1.com' const app3 = 'https://app3.com' describe('Permissions settings tests', () => { before(() => { - cy.clearLocalStorage() - cy.on('window:before:load', (window) => { - window.localStorage.setItem( - constants.BROWSER_PERMISSIONS_KEY, - JSON.stringify({ - app1: [ - { feature: 'camera', status: 'granted' }, - { feature: 'fullscreen', status: 'granted' }, - { feature: 'geolocation', status: 'granted' }, - ], - app2: [{ feature: 'microphone', status: 'granted' }], - app3: [{ feature: 'camera', status: 'denied' }], - }), - ) - window.localStorage.setItem( - constants.SAFE_PERMISSIONS_KEY, - JSON.stringify({ - app2: [ - { - invoker: app1, - parentCapability: 'requestAddressBook', - date: 1666103778276, - caveats: [], - }, - ], - app4: [ - { - invoker: app3, - parentCapability: 'requestAddressBook', - date: 1666103787026, - caveats: [], - }, - ], - }), - ) - }) - - cy.visit(`${constants.appSettingsUrl}?safe=${constants.SEPOLIA_TEST_SAFE_5}`, { - failOnStatusCode: false, + getSafes(CATEGORIES.static).then((statics) => { + staticSafes = statics + cy.clearLocalStorage() + cy.on('window:before:load', (window) => { + window.localStorage.setItem( + constants.BROWSER_PERMISSIONS_KEY, + JSON.stringify({ + app1: [ + { feature: 'camera', status: 'granted' }, + { feature: 'fullscreen', status: 'granted' }, + { feature: 'geolocation', status: 'granted' }, + ], + app2: [{ feature: 'microphone', status: 'granted' }], + app3: [{ feature: 'camera', status: 'denied' }], + }), + ) + window.localStorage.setItem( + constants.SAFE_PERMISSIONS_KEY, + JSON.stringify({ + app2: [ + { + invoker: app1, + parentCapability: 'requestAddressBook', + date: 1666103778276, + caveats: [], + }, + ], + app4: [ + { + invoker: app3, + parentCapability: 'requestAddressBook', + date: 1666103787026, + caveats: [], + }, + ], + }), + ) + }) + cy.visit(`${constants.appSettingsUrl}?safe=${staticSafes.SEP_STATIC_SAFE_2}`, { + failOnStatusCode: false, + }) + main.acceptCookies() }) - - main.acceptCookies() }) it('Verify for each stored app the permissions configuration is shown', () => { diff --git a/cypress/e2e/safe-apps/preview_drawer.cy.js b/cypress/e2e/safe-apps/preview_drawer.cy.js index a3c7e966f8..e24c590fa3 100644 --- a/cypress/e2e/safe-apps/preview_drawer.cy.js +++ b/cypress/e2e/safe-apps/preview_drawer.cy.js @@ -1,11 +1,18 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('Preview drawer tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(`${constants.appsUrl}?safe=${constants.SEPOLIA_TEST_SAFE_5}`, { + cy.visit(`${constants.appsUrl}?safe=${staticSafes.SEP_STATIC_SAFE_2}`, { failOnStatusCode: false, }) main.acceptCookies() diff --git a/cypress/e2e/safe-apps/tx-builder.spec.cy.js b/cypress/e2e/safe-apps/tx-builder.spec.cy.js index 201feec1ee..7dd84ba19c 100644 --- a/cypress/e2e/safe-apps/tx-builder.spec.cy.js +++ b/cypress/e2e/safe-apps/tx-builder.spec.cy.js @@ -4,12 +4,21 @@ import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' import * as createtx from '../../e2e/pages/create_tx.pages' import * as navigation from '../pages/navigation.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let safeAppSafes = [] +let iframeSelector describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { - const appUrl = constants.TX_Builder_url - const iframeSelector = `iframe[id="iframe-${appUrl}"]` - const visitUrl = `/apps/open?safe=${constants.SEPOLIA_TEST_SAFE_9}&appUrl=${encodeURIComponent(appUrl)}` + before(async () => { + safeAppSafes = await getSafes(CATEGORIES.safeapps) + }) + beforeEach(() => { + const appUrl = constants.TX_Builder_url + iframeSelector = `iframe[id="iframe-${appUrl}"]` + const visitUrl = `/apps/open?safe=${safeAppSafes.SEP_SAFEAPP_SAFE_1}&appUrl=${encodeURIComponent(appUrl)}` + cy.clearLocalStorage() cy.visit(visitUrl) main.acceptCookies() @@ -21,7 +30,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SAFE_APP_ADDRESS) getBody().find(safeapps.contractMethodIndex).parent().click() getBody().findByRole('option', { name: safeapps.testAddressValue2 }).click() - getBody().findByLabelText(safeapps.newAddressValueStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.newAddressValueStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.addTransactionStr).click() getBody().findAllByText(constants.SEPOLIA_CONTRACT_SHORT).should('have.length', 1) getBody().findByText(safeapps.testAddressValueStr).should('exist') @@ -90,7 +99,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { it('Verify a batch can be created from an ABI', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.enterABIStr).type(safeapps.abi) - getBody().findByLabelText(safeapps.toAddressStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.toAddressStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByLabelText(safeapps.tokenAmount).type('0') getBody().findByText(safeapps.addTransactionStr).click() @@ -136,7 +145,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SAFE_APP_ADDRESS) getBody().find(safeapps.contractMethodIndex).parent().click() getBody().findByRole('option', { name: safeapps.testAddressValue2 }).click() - getBody().findByLabelText(safeapps.newAddressValueStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.newAddressValueStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.addTransactionStr).click() getBody().findByText(safeapps.createBatchStr).click() getBody().findByRole('button', { name: safeapps.cancelBtnStr }).click() @@ -151,7 +160,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SAFE_APP_ADDRESS) getBody().find(safeapps.contractMethodIndex).parent().click() getBody().findByRole('option', { name: safeapps.testAddressValue2 }).click() - getBody().findByLabelText(safeapps.newAddressValueStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.newAddressValueStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.addTransactionStr).click() getBody().findByText(safeapps.createBatchStr).click() getBody().findByRole('button', { name: safeapps.cancelBtnStr }).click() @@ -166,14 +175,14 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SAFE_APP_ADDRESS) getBody().find(safeapps.contractMethodIndex).parent().click() getBody().findByRole('option', { name: safeapps.testAddressValue2 }).click() - getBody().findByLabelText(safeapps.newAddressValueStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.newAddressValueStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.addTransactionStr).click() getBody().findByText(safeapps.createBatchStr).click() getBody().findByText(safeapps.backToTransactionStr).click() getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SAFE_APP_ADDRESS) getBody().find(safeapps.contractMethodIndex).parent().click() getBody().findByRole('option', { name: safeapps.testAddressValue2 }).click() - getBody().findByLabelText(safeapps.newAddressValueStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.newAddressValueStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.addTransactionStr).click() getBody().findByText(safeapps.createBatchStr).click() getBody().findByText(safeapps.sendBatchStr).click() @@ -189,7 +198,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { it('Verify a batch cannot be created with invalid address', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SEPOLIA_TEST_SAFE_10.substring(5)) + getBody().findByLabelText(safeapps.enterAddressStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2.substring(5)) getBody() .findAllByText(safeapps.addressNotValidStr) .should('have.css', 'color', 'rgb(244, 67, 54)') @@ -199,7 +208,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { it.skip('Verify a batch cannot be created without asset amount', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.enterAddressStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.keepProxiABIStr).click() getBody().findByText(safeapps.addTransactionStr).click() getBody().findAllByText(safeapps.requiredStr).should('have.css', 'color', 'rgb(244, 67, 54)') @@ -269,7 +278,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { it.skip('Verify a valid batch as successful can be simulated', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.enterAddressStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.keepProxiABIStr).click() getBody().findByLabelText(safeapps.tokenAmount).type('0') getBody().findByText(safeapps.addTransactionStr).click() @@ -282,7 +291,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => { it.skip('Verify an invalid batch as failed can be simulated', () => { cy.enter(iframeSelector).then((getBody) => { - getBody().findByLabelText(safeapps.enterAddressStr).type(constants.SEPOLIA_TEST_SAFE_10) + getBody().findByLabelText(safeapps.enterAddressStr).type(safeAppSafes.SEP_SAFEAPP_SAFE_2) getBody().findByText(safeapps.keepProxiABIStr).click() getBody().findByLabelText(safeapps.tokenAmount).type('100') getBody().findByText(safeapps.addTransactionStr).click() diff --git a/cypress/e2e/smoke/add_owner.cy.js b/cypress/e2e/smoke/add_owner.cy.js index 26c85dd85e..8d3fb799e4 100644 --- a/cypress/e2e/smoke/add_owner.cy.js +++ b/cypress/e2e/smoke/add_owner.cy.js @@ -2,10 +2,17 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as owner from '../pages/owners.pages' import * as navigation from '../pages/navigation.page' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('[SMOKE] Add Owners tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() main.waitForHistoryCallToComplete() main.acceptCookies() @@ -17,7 +24,7 @@ describe('[SMOKE] Add Owners tests', () => { }) it('[SMOKE] Verify “Add new owner” button tooltip displays correct message for Non-Owner', () => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_2) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_3) main.waitForHistoryCallToComplete() owner.verifyAddOwnerBtnIsDisabled() }) @@ -32,7 +39,7 @@ describe('[SMOKE] Add Owners tests', () => { owner.typeOwnerAddress(constants.addresBookContacts.user1.address.toUpperCase()) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.invalidChecksum) - owner.typeOwnerAddress(constants.SEPOLIA_TEST_SAFE_1) + owner.typeOwnerAddress(staticSafes.SEP_STATIC_SAFE_4) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.ownSafe) owner.typeOwnerAddress(constants.addresBookContacts.user1.address.replace('F', 'f')) @@ -56,7 +63,7 @@ describe('[SMOKE] Add Owners tests', () => { owner.clickOnNextBtn() owner.verifyConfirmTransactionWindowDisplayed() owner.clickOnBackBtn() - owner.typeOwnerAddress(constants.SEPOLIA_TEST_SAFE_2) + owner.typeOwnerAddress(staticSafes.SEP_STATIC_SAFE_3) owner.clickOnNextBtn() owner.verifyConfirmTransactionWindowDisplayed() }) diff --git a/cypress/e2e/smoke/address_book.cy.js b/cypress/e2e/smoke/address_book.cy.js index 203c94c90c..e6144afbe0 100644 --- a/cypress/e2e/smoke/address_book.cy.js +++ b/cypress/e2e/smoke/address_book.cy.js @@ -3,6 +3,9 @@ import * as constants from '../../support/constants' import * as addressBook from '../../e2e/pages/address_book.page' import * as main from '../../e2e/pages/main.page' import * as ls from '../../support/localstorage_data.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const NAME = 'Owner1' const NAME_2 = 'Owner2' @@ -13,8 +16,12 @@ const owner1 = 'Automation owner' const recipientData = [owner1, constants.DEFAULT_OWNER_ADDRESS] describe('[SMOKE] Address book tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() main.waitForHistoryCallToComplete() main.acceptCookies() diff --git a/cypress/e2e/smoke/assets.cy.js b/cypress/e2e/smoke/assets.cy.js index c7fcafcfee..fc9562cd4b 100644 --- a/cypress/e2e/smoke/assets.cy.js +++ b/cypress/e2e/smoke/assets.cy.js @@ -1,6 +1,9 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as assets from '../pages/assets.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const ASSET_NAME_COLUMN = 0 const TOKEN_AMOUNT_COLUMN = 1 @@ -9,8 +12,12 @@ const FIAT_AMOUNT_COLUMN = 2 describe('[SMOKE] Assets tests', () => { const fiatRegex = assets.fiatRegex + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2) cy.clearLocalStorage() main.acceptCookies() }) diff --git a/cypress/e2e/smoke/batch_tx.cy.js b/cypress/e2e/smoke/batch_tx.cy.js index 7454c002f7..a94cfe2eba 100644 --- a/cypress/e2e/smoke/batch_tx.cy.js +++ b/cypress/e2e/smoke/batch_tx.cy.js @@ -3,15 +3,22 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as owner from '../../e2e/pages/owners.pages.js' import * as ls from '../../support/localstorage_data.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const currentNonce = 3 const funds_first_tx = '0.001' const funds_second_tx = '0.002' describe('[SMOKE] Batch transaction tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2) owner.waitForConnectionStatus() main.acceptCookies() }) diff --git a/cypress/e2e/smoke/create_tx.cy.js b/cypress/e2e/smoke/create_tx.cy.js index c994a7887a..ce2cb9a993 100644 --- a/cypress/e2e/smoke/create_tx.cy.js +++ b/cypress/e2e/smoke/create_tx.cy.js @@ -1,6 +1,9 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as createtx from '../../e2e/pages/create_tx.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const sendValue = 0.00002 const currentNonce = 2 @@ -13,9 +16,13 @@ function happyPathToStepTwo() { } describe('[SMOKE] Create transactions tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_16_CREATE_TX) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_12) main.acceptCookies() createtx.clickOnNewtransactionBtn() createtx.clickOnSendTokensBtn() @@ -28,7 +35,7 @@ describe('[SMOKE] Create transactions tests', () => { it('[SMOKE] Verify address input resolves a valid ENS name', () => { createtx.typeRecipientAddress(constants.ENS_TEST_SEPOLIA) - createtx.verifyENSResolves(constants.SEPOLIA_TEST_SAFE_7) + createtx.verifyENSResolves(staticSafes.SEP_STATIC_SAFE_6) }) it('[SMOKE] Verify error message for invalid amount input', () => { diff --git a/cypress/e2e/smoke/dashboard.cy.js b/cypress/e2e/smoke/dashboard.cy.js index 5c2e3552d5..ff428599bf 100644 --- a/cypress/e2e/smoke/dashboard.cy.js +++ b/cypress/e2e/smoke/dashboard.cy.js @@ -3,16 +3,23 @@ import * as dashboard from '../pages/dashboard.pages' import * as main from '../pages/main.page' import * as safeapps from '../pages/safeapps.pages' import * as createTx from '../pages/create_tx.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const txData = ['14', 'Send', '-0.00002 ETH', '1 out of 1'] const txaddOwner = ['5', 'addOwnerWithThreshold', '1 out of 2'] const txMultiSendCall3 = ['4', 'Safe: MultiSendCallOnly 1.3.0', '3 actions', '1 out of 2'] const txMultiSendCall2 = ['6', 'Safe: MultiSendCallOnly 1.3.0', '2 actions', '1 out of 2'] -describe('[SMOKE] Dashboard tests', () => { +describe('[SMOKE] Dashboard tests', { defaultCommandTimeout: 20000 }, () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_2) main.acceptCookies() dashboard.verifyConnectTransactStrIsVisible() }) @@ -43,9 +50,9 @@ describe('[SMOKE] Dashboard tests', () => { it('[SMOKE] Verify that pinned in dashboard, an app keeps its status on apps page', () => { dashboard.pinAppByIndex(0).then((pinnedApp) => { - cy.visit(constants.appsUrlGeneral + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_2) safeapps.verifyPinnedApp(pinnedApp) - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_2) dashboard.clickOnPinBtnByName(pinnedApp) dashboard.verifyPinnedAppsCount(0) }) @@ -57,7 +64,7 @@ describe('[SMOKE] Dashboard tests', () => { }) it('[SMOKE] Verify there is empty tx string and image when there are no tx queued', () => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_14) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_10) dashboard.verifyEmptyTxSection() }) @@ -66,7 +73,7 @@ describe('[SMOKE] Dashboard tests', () => { }) it('[SMOKE] Verify that tx are displayed correctly in Pending tx section', () => { - cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_18_PENDING_TX) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_14) 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 05feacbd27..761083f925 100644 --- a/cypress/e2e/smoke/import_export_data.cy.js +++ b/cypress/e2e/smoke/import_export_data.cy.js @@ -4,8 +4,15 @@ 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 { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('[SMOKE] Import Export Data tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.dataSettingsUrl).then(() => { @@ -33,7 +40,7 @@ describe('[SMOKE] Import Export Data tests', () => { main .addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.importedSafe) .then(() => { - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_3) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_5) file.verifyImportedAddressBookData() }) }) @@ -42,7 +49,7 @@ describe('[SMOKE] Import Export Data tests', () => { it('[SMOKE] Verify pinned apps', () => { const appNames = ['Transaction Builder'] - cy.visit(constants.appsUrlGeneral + constants.SEPOLIA_TEST_SAFE_3).then(() => { + 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) @@ -63,7 +70,7 @@ describe('[SMOKE] Import Export Data tests', () => { const unchecked = [file.copyAddressStr] const checked = [file.darkModeStr] - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_3).then(() => { + 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(() => { @@ -81,7 +88,7 @@ describe('[SMOKE] Import Export Data tests', () => { }) it('[SMOKE] Verify data for export in Data tab', () => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_3).then(() => { + 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 diff --git a/cypress/e2e/smoke/import_export_data_2.cy.js b/cypress/e2e/smoke/import_export_data_2.cy.js index 2ec51e30e3..91e960ba2b 100644 --- a/cypress/e2e/smoke/import_export_data_2.cy.js +++ b/cypress/e2e/smoke/import_export_data_2.cy.js @@ -3,6 +3,9 @@ import * as file from '../pages/import_export.pages.js' import * as main from '../pages/main.page.js' import * as constants from '../../support/constants.js' import * as sidebar from '../pages/sidebar.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const validJsonPath = 'cypress/fixtures/data_import.json' const invalidJsonPath = 'cypress/fixtures/address_book_test.csv' @@ -12,8 +15,12 @@ const invalidJsonPath_3 = 'cypress/fixtures/test-empty-batch.json' const appNames = ['Transaction Builder'] describe('[SMOKE] Import Export Data tests 2', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_22_IMPORT) + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_16) cy.clearLocalStorage() main.acceptCookies() }) @@ -30,9 +37,9 @@ describe('[SMOKE] Import Export Data tests 2', () => { file.verifyImportMessages() file.verifyImportBtnStatus(constants.enabledStates.enabled) file.clickOnImportBtn() - cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_22_IMPORT) + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_16) file.verifyImportedAddressBookData() - cy.visit(constants.appsUrlGeneral + constants.SEPOLIA_TEST_SAFE_22_IMPORT) + cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_16) file.verifyPinnedApps(appNames) }) @@ -45,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 + constants.SEPOLIA_TEST_SAFE_22_IMPORT) + cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_16) file.verifyImportSectionVisible() file.verifyValidImportInputExists() }) @@ -63,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 + constants.SEPOLIA_TEST_SAFE_22_IMPORT) + cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_16) file.verifyExportFileSectionIsVisible() }) }) diff --git a/cypress/e2e/smoke/load_safe.cy.js b/cypress/e2e/smoke/load_safe.cy.js index b7be85e600..1b7c7d5695 100644 --- a/cypress/e2e/smoke/load_safe.cy.js +++ b/cypress/e2e/smoke/load_safe.cy.js @@ -3,11 +3,18 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as safe from '../pages/load_safe.pages' import * as createwallet from '../pages/create_wallet.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const testSafeName = 'Test safe name' const testOwnerName = 'Test Owner Name' describe('[SMOKE] Load Safe tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() cy.visit(constants.loadNewSafeSepoliaUrl) @@ -29,9 +36,9 @@ describe('[SMOKE] Load Safe tests', () => { createwallet.verifyDefaultWalletName(createwallet.defaultSepoliaPlaceholder) safe.verifyIncorrectAddressErrorMessage() - safe.inputNameAndAddress(testSafeName, constants.SEPOLIA_TEST_SAFE_1) + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_4) - safe.verifyAddressInputValue(constants.SEPOLIA_TEST_SAFE_1) + safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_4) safe.verifyNextButtonStatus('be.enabled') safe.clickOnNextBtn() }) @@ -44,13 +51,13 @@ describe('[SMOKE] Load Safe tests', () => { it('[SMOKE] Verify ENS name is translated to a valid address', () => { // cy.visit(constants.loadNewSafeEthUrl) safe.inputAddress(constants.ENS_TEST_SEPOLIA) - safe.verifyAddressInputValue(constants.SEPOLIA_TEST_SAFE_7) + safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_6) safe.verifyNextButtonStatus('be.enabled') safe.clickOnNextBtn() }) it('[SMOKE] Verify the custom Safe name is successfully loaded', () => { - safe.inputNameAndAddress(testSafeName, constants.SEPOLIA_TEST_SAFE_2) + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_3) safe.clickOnNextBtn() createwallet.typeOwnerName(testOwnerName, 0) safe.clickOnNextBtn() @@ -62,7 +69,7 @@ describe('[SMOKE] Load Safe tests', () => { constants.SEPOLIA_OWNER_2, ) safe.clickOnAddBtn() - main.verifyHomeSafeUrl(constants.SEPOLIA_TEST_SAFE_2) + main.verifyHomeSafeUrl(staticSafes.SEP_STATIC_SAFE_3) safe.veriySidebarSafeNameIsVisible(testSafeName) safe.verifyOwnerNamePresentInSettings(testOwnerName) }) @@ -74,7 +81,7 @@ describe('[SMOKE] Load Safe tests', () => { }) it('[SMOKE] Verify that after loading existing Safe, its name input is not empty', () => { - safe.inputNameAndAddress(testSafeName, constants.SEPOLIA_TEST_SAFE_1) + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_4) safe.clickOnNextBtn() safe.verifyOnwerInputIsNotEmpty(0) }) diff --git a/cypress/e2e/smoke/nfts.cy.js b/cypress/e2e/smoke/nfts.cy.js index 11cd2217d2..30fa5c8d58 100644 --- a/cypress/e2e/smoke/nfts.cy.js +++ b/cypress/e2e/smoke/nfts.cy.js @@ -1,15 +1,22 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as nfts from '../pages/nfts.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const nftsName = 'CatFactory' const nftsAddress = '0x373B...866c' const nftsTokenID = 'CF' describe('[SMOKE] NFTs tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.balanceNftsUrl + constants.SEPOLIA_TEST_SAFE_5) + cy.visit(constants.balanceNftsUrl + staticSafes.SEP_STATIC_SAFE_2) main.acceptCookies() nfts.waitForNftItems(2) }) diff --git a/cypress/e2e/smoke/replace_owner.cy.js b/cypress/e2e/smoke/replace_owner.cy.js index 6bccf10e28..60dd4e5b84 100644 --- a/cypress/e2e/smoke/replace_owner.cy.js +++ b/cypress/e2e/smoke/replace_owner.cy.js @@ -1,10 +1,17 @@ import * as constants from '../../support/constants' import * as main from '../../e2e/pages/main.page' import * as owner from '../pages/owners.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('[SMOKE] Replace Owners tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) cy.clearLocalStorage() main.acceptCookies() cy.contains(owner.safeAccountNonceStr, { timeout: 10000 }) @@ -16,7 +23,7 @@ describe('[SMOKE] Replace Owners tests', () => { // TODO: Remove "tooltip" from title it('[SMOKE] Verify Tooltip displays correct message for Non-Owner', () => { - cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_2) + cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_3) owner.waitForConnectionStatus() owner.verifyReplaceBtnIsDisabled() }) diff --git a/cypress/e2e/smoke/spending_limits.cy.js b/cypress/e2e/smoke/spending_limits.cy.js index 038005efe5..ad815a8f39 100644 --- a/cypress/e2e/smoke/spending_limits.cy.js +++ b/cypress/e2e/smoke/spending_limits.cy.js @@ -2,10 +2,17 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as spendinglimit from '../pages/spending_limits.pages' import * as owner from '../pages/owners.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] describe('[SMOKE] Spending limits tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { - cy.visit(constants.securityUrl + constants.SEPOLIA_TEST_SAFE_12) + cy.visit(constants.securityUrl + staticSafes.SEP_STATIC_SAFE_8) cy.clearLocalStorage() main.acceptCookies() owner.waitForConnectionStatus() @@ -15,11 +22,11 @@ describe('[SMOKE] Spending limits tests', () => { it('Verify A valid ENS name is resolved successfully', () => { spendinglimit.enterBeneficiaryAddress(constants.ENS_TEST_SEPOLIA) - spendinglimit.checkBeneficiaryENS(constants.SEPOLIA_TEST_SAFE_7) + spendinglimit.checkBeneficiaryENS(staticSafes.SEP_STATIC_SAFE_6) }) it('Verify writing a valid address shows no errors', () => { - spendinglimit.enterBeneficiaryAddress(constants.SEPOLIA_TEST_SAFE_7) + spendinglimit.enterBeneficiaryAddress(staticSafes.SEP_STATIC_SAFE_6) spendinglimit.verifyValidAddressShowsNoErrors() }) diff --git a/cypress/e2e/smoke/tx_history.cy.js b/cypress/e2e/smoke/tx_history.cy.js index b12147af42..7559ed74a7 100644 --- a/cypress/e2e/smoke/tx_history.cy.js +++ b/cypress/e2e/smoke/tx_history.cy.js @@ -2,6 +2,9 @@ import * as constants from '../../support/constants' import * as main from '../pages/main.page' import * as createTx from '../pages/create_tx.pages' import * as data from '../../fixtures/txhistory_data_data.json' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] const typeOnchainRejection = data.type.onchainRejection const typeBatch = data.type.batchNativeTransfer @@ -12,9 +15,13 @@ const typeGeneral = data.type.general const typeUntrustedToken = data.type.untrustedReceivedToken describe('[SMOKE] Tx history tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + beforeEach(() => { cy.clearLocalStorage() - cy.visit(constants.transactionsHistoryUrl + constants.SEPOLIA_TEST_SAFE_8) + cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7) main.acceptCookies() }) diff --git a/cypress/fixtures/safes/funds.json b/cypress/fixtures/safes/funds.json new file mode 100644 index 0000000000..66cda07728 --- /dev/null +++ b/cypress/fixtures/safes/funds.json @@ -0,0 +1,15 @@ +{ + "SEP_FUNDS_SAFE_1": "sep:0xFE8697FE746Ff566C4962675270F446a9F54a187", + "SEP_FUNDS_SAFE_2": "sep:0x21074f7A5C7bc2BCfD818fFeFfB442ab4877D2d2", + "SEP_FUNDS_SAFE_3": "sep:0xAC456f5422C13b93d4ac819c3E52bA418E401EaA", + "SEP_FUNDS_SAFE_4": "sep:0x20Acedd07F00192F9C3B4e30935B68D1ef4E3560", + "SEP_FUNDS_SAFE_5": "sep:0xBB5887698819c893105E706973C51A8Ac5ee46F7", + "SEP_FUNDS_SAFE_6": "sep:0xbaDd745E0e2738152651185217349A3B0aF415cd", + "SEP_FUNDS_SAFE_7": "sep:0x1ecC109589d12525d96623021f1633D236E38f6F", + "SEP_FUNDS_SAFE_8": "sep:0x0210400C7bB52f72023725137000F685d674F210", + "SEP_FUNDS_SAFE_9": "sep:0x010F5D3524a371ce5b63bdD67ddFbcDe58c9b530", + "SEP_FUNDS_SAFE_10": "sep:0xE72d4D7E87672c14Df3d449C6b79f20151c18fC1", + "SEP_FUNDS_SAFE_11": "sep:0x74D5228112a9652a9825a6A285Fb39e290269172", + "SEP_FUNDS_SAFE_12": "sep:0xe5DC58EfDA6ebe93014AaE7A5a673C5F80118171", + "ETH_FUNDS_SAFE_13": "eth:0x8675B754342754A30A2AeF474D114d8460bca19b" +} diff --git a/cypress/fixtures/safes/nfts.json b/cypress/fixtures/safes/nfts.json new file mode 100644 index 0000000000..fad431e866 --- /dev/null +++ b/cypress/fixtures/safes/nfts.json @@ -0,0 +1,4 @@ +{ + "SEP_NFT_SAFE_1": "sep:0xE72d4D7E87672c14Df3d449C6b79f20151c18fC1", + "SEP_NFT_SAFE_2": "sep:0x3e259dea1E317743Cb49CA9358904E07420ff061" +} diff --git a/cypress/fixtures/safes/recovery.json b/cypress/fixtures/safes/recovery.json new file mode 100644 index 0000000000..f04d8c5d7d --- /dev/null +++ b/cypress/fixtures/safes/recovery.json @@ -0,0 +1,5 @@ +{ + "SEP_RECOVERY_SAFE_1": "sep:0x702E067A0015F1b835d9c631Cb28A9F617314F27", + "SEP_RECOVERY_SAFE_2": "sep:0xb791302040DB5Ab4Ade0b5295cecCaeF07AF07a1", + "SEP_RECOVERY_SAFE_3": "sep:0xAE1E3f93fda95eEbb857Ee06325f6F1e45EF3CBE" +} diff --git a/cypress/fixtures/safes/safeapps.json b/cypress/fixtures/safes/safeapps.json new file mode 100644 index 0000000000..977397dd13 --- /dev/null +++ b/cypress/fixtures/safes/safeapps.json @@ -0,0 +1,4 @@ +{ + "SEP_SAFEAPP_SAFE_1": "sep:0xD1571E8Cc4438aFef2836DD9a0E5D09fb63EDE9a", + "SEP_SAFEAPP_SAFE_2": "sep:0x4DD4cB2299E491E1B469245DB589ccB2B16d7bde" +} diff --git a/cypress/fixtures/safes/static.json b/cypress/fixtures/safes/static.json new file mode 100644 index 0000000000..9e7777a0b4 --- /dev/null +++ b/cypress/fixtures/safes/static.json @@ -0,0 +1,20 @@ +{ + "SEP_STATIC_SAFE_1": "sep:0x03042B890b99552b60A073F808100517fb148F60", + "SEP_STATIC_SAFE_2": "sep:0xBd69b0a9DC90eB6F9bAc3E4a5875f437348b6415", + "SEP_STATIC_SAFE_3": "sep:0x33C4AA5729D91FfB3B87AEf8a324bb6304Fb905c", + "SEP_STATIC_SAFE_4": "sep:0xBb26E3717172d5000F87DeFd391994f789D80aEB", + "SEP_STATIC_SAFE_5": "sep:0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7", + "SEP_STATIC_SAFE_6": "sep:0xBf30F749FC027a5d79c4710D988F0D3C8e217A4F", + "SEP_STATIC_SAFE_7": "sep:0x5912f6616c84024cD1aff0D5b55bb36F5180fFdb", + "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" +} diff --git a/cypress/support/constants.js b/cypress/support/constants.js index 374f03ddf8..cdb00e0382 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -1,73 +1,15 @@ import { LS_NAMESPACE } from '../../src/config/constants' +import safes from '../fixtures/safes/static.json' + export const RECIPIENT_ADDRESS = '0x6a5602335a878ADDCa4BF63a050E34946B56B5bC' export const GOERLI_SAFE_APPS_SAFE = 'gor:0x168ca275d1103cb0a30980813140053c7566932F' export const GOERLI_TEST_SAFE = 'gor:0x97d314157727D517A706B5D08507A1f9B44AaaE9' -// SEPOLIA_TEST_SAFE_1 should always have no transactions, tokens and NFTs -export const SEPOLIA_TEST_SAFE_1 = 'sep:0xBb26E3717172d5000F87DeFd391994f789D80aEB' -// SEPOLIA_TEST_SAFE_2 Has no transactions, 1 owner, using for verificatons only -// Also used for non-owner verifications in spending limits -export const SEPOLIA_TEST_SAFE_2 = 'sep:0x33C4AA5729D91FfB3B87AEf8a324bb6304Fb905c' -export const SEPOLIA_TEST_SAFE_3 = 'sep:0x6E834E9D04ad6b26e1525dE1a37BFd9b215f40B7' -export const SEPOLIA_TEST_SAFE_4 = 'sep:0x03042B890b99552b60A073F808100517fb148F60' -export const SEPOLIA_TEST_SAFE_5 = 'sep:0xBd69b0a9DC90eB6F9bAc3E4a5875f437348b6415' export const SEPOLIA_TEST_SAFE_6 = 'sep:0x6d0b6F96f665Bb4490f9ddb2e450Da2f7e546dC1' -// SAFE_7 has ENS assigned to it -export const SEPOLIA_TEST_SAFE_7 = 'sep:0xBf30F749FC027a5d79c4710D988F0D3C8e217A4F' -// SAFE 8 is used for tx history tests -export const SEPOLIA_TEST_SAFE_8 = 'sep:0x5912f6616c84024cD1aff0D5b55bb36F5180fFdb' -// SAFE 9 & 10 are used for safe apps tests -export const SEPOLIA_TEST_SAFE_9 = 'sep:0xD1571E8Cc4438aFef2836DD9a0E5D09fb63EDE9a' -export const SEPOLIA_TEST_SAFE_10 = 'sep:0x4DD4cB2299E491E1B469245DB589ccB2B16d7bde' -// SAFE 11 is used for remove owner tests -export const SEPOLIA_TEST_SAFE_11 = 'sep:0x81034C61a318649F7aD43f9e8C1051427e326443' -// SAFE 12 is used for spending limits -export const SEPOLIA_TEST_SAFE_12 = 'sep:0x9190cc22D592dDcf396Fa616ce84a9978fD96Fc9' -// SAFE 13 & 14 are used for sidebar with pending tx, no further tx should be made in it -export const SEPOLIA_TEST_SAFE_13 = 'sep:0x98705770aF3b18db0a64597F6d4DCe825915fec0' -export const SEPOLIA_TEST_SAFE_13_SHORT = '0x9870...fec0' -export const SEPOLIA_TEST_SAFE_14 = 'sep:0xC23e061252BFc7967203D054136d8fA7c7df2fc4' -// SAFE 15 is a safe with native tokens but the automation user is not its owner -export const SEPOLIA_TEST_SAFE_15_TOKEN = 'sep:0xfC0A7ac73Fde7547ac0792Cca1D8A50CE0AFC4Df' -export const SEPOLIA_TEST_SAFE_16_CREATE_TX = 'sep:0xc2F3645bfd395516d1a18CA6ad9298299d328C01' -export const SEPOLIA_TEST_SAFE_17_SIDEBAR_NONOWNER = 'sep:0x10B45a24640E2170B6AA63ea3A289D723a0C9cba' -export const SEPOLIA_TEST_SAFE_18_PENDING_TX = 'sep:0xFFfaC243A24EecE6553f0Da278322aCF1Fb6CeF1' -export const SEPOLIA_TEST_SAFE_19_NONOWNER_NFT = 'sep:0x3e259dea1E317743Cb49CA9358904E07420ff061' -export const SEPOLIA_TEST_SAFE_20_LOAD_SAFE = 'sep:0x027bBe128174F0e5e5d22ECe9623698E01cd3970' -export const SEPOLIA_TEST_SAFE_21_LOAD_SAFE = 'eth:0x8675B754342754A30A2AeF474D114d8460bca19b' -export const SEPOLIA_TEST_SAFE_22_IMPORT = 'sep:0xBc7e586D276e2da521DE8ff17255fd878621cc59' -export const SEPOLIA_TEST_SAFE_23_RECOVERY_1 = 'sep:0x702E067A0015F1b835d9c631Cb28A9F617314F27' -export const SEPOLIA_TEST_SAFE_24_RECOVERY_2 = 'sep:0xb791302040DB5Ab4Ade0b5295cecCaeF07AF07a1' -export const SEPOLIA_TEST_SAFE_25_RECOVERY_3 = 'sep:0xAE1E3f93fda95eEbb857Ee06325f6F1e45EF3CBE' -export const SEPOLIA_TEST_SAFE_26_REPLACE_OWNER = 'sep:0x6860336C97966c17fDD812939c2E2400626a181a' -export const SEPOLIA_TEST_SAFE_27_SEND_NFT = 'sep:0xE72d4D7E87672c14Df3d449C6b79f20151c18fC1' -export const SEPOLIA_TEST_SAFE_28_SEND_FUNDS_HP1 = 'sep:0x74D5228112a9652a9825a6A285Fb39e290269172' -export const SEPOLIA_TEST_SAFE_29_SEND_FUNDS_HP2 = 'sep:0xA6D975f30d48402D9952E3F3D569AADAd161f336' -export const SEPOLIA_TEST_SAFE_30_SEND_NFT_HP1 = 'sep:0x6C7d3939Ae99dd3e4422D8b3e442e13Ee21EFCEc' -export const SEPOLIA_TEST_SAFE_31_SEND_NFT_HP2 = 'sep:0x97143f05ad523027b0F6F86FeD96E5e51F58DdAc' -export const SEPOLIA_TEST_SAFE_32_SEND_NATIVE_HP1 = 'sep:0xe5DC58EfDA6ebe93014AaE7A5a673C5F80118171' -export const SEPOLIA_TEST_SAFE_33_SEND_NATIVE_HP2 = 'sep:0x9DF284917ff80c0a95c20ea2151Eb2a39a13cf4E' - -export const SEPOLIA_TEST_SAFE_34_SEND_FUNDS_HP3 = 'sep:0xFE8697FE746Ff566C4962675270F446a9F54a187' -export const SEPOLIA_TEST_SAFE_35_SEND_FUNDS_HP4 = 'sep:0x9711ad5B73Ae6B2e01031D1D798949a8e7E889a6' - -export const SEPOLIA_TEST_SAFE_36_SEND_FUNDS_HP5 = 'sep:0x21074f7A5C7bc2BCfD818fFeFfB442ab4877D2d2' -export const SEPOLIA_TEST_SAFE_37_SEND_FUNDS_HP6 = 'sep:0xAd65717D60f7f2c65895c800148bc53eedC73c24' - -export const SEPOLIA_TEST_SAFE_38_SEND_FUNDS_HP7 = 'sep:0xad23bd2D4cDB86FF2a6600c74995c01eA209AfC1' -export const SEPOLIA_TEST_SAFE_39_SEND_FUNDS_HP8 = 'sep:0xEbED8ABaAe1FCFA9D3343B34a2373a57A558abd1' -export const SEPOLIA_TEST_SAFE_40_SEND_FUNDS_HP9 = 'sep:0xAC456f5422C13b93d4ac819c3E52bA418E401EaA' -export const SEPOLIA_TEST_SAFE_41_SEND_FUNDS_HP10 = 'sep:0x20Acedd07F00192F9C3B4e30935B68D1ef4E3560' -export const SEPOLIA_TEST_SAFE_41_SEND_FUNDS_HP11 = 'sep:0xBB5887698819c893105E706973C51A8Ac5ee46F7' -export const SEPOLIA_TEST_SAFE_42_SEND_FUNDS_HP12 = 'sep:0xB7A5a8D5bD32F4544446d6E0B181E1837e7E36A4' -export const SEPOLIA_TEST_SAFE_43_SEND_FUNDS_HP13 = 'sep:0xbaDd745E0e2738152651185217349A3B0aF415cd' -export const SEPOLIA_TEST_SAFE_44_SEND_FUNDS_HP14 = 'sep:0x1ecC109589d12525d96623021f1633D236E38f6F' -export const SEPOLIA_TEST_SAFE_45_SEND_FUNDS_HP15 = 'sep:0x0210400C7bB52f72023725137000F685d674F210' -export const SEPOLIA_TEST_SAFE_46_SEND_FUNDS_HP16 = 'sep:0x010F5D3524a371ce5b63bdD67ddFbcDe58c9b530' export const SEPOLIA_CONTRACT_SHORT = '0x11AB...34aF' export const SEPOLIA_RECIPIENT_ADDR_SHORT = '0x4DD4...7bde' +// Need clarification/refactor: TEST_SAFE / GNO_TEST_SAFE export const GNO_TEST_SAFE = 'gno:0xB8d760a90a5ed54D3c2b3EFC231277e99188642A' -export const PAGINATION_TEST_SAFE = 'gor:0x850493a15914aAC05a821A3FAb973b4598889A7b' export const TEST_SAFE = 'gor:0x04f8b1EA3cBB315b87ced0E32deb5a43cC151a91' export const EOA = '0x03042B890b99552b60A073F808100517fb148F60' export const SAFE_APP_ADDRESS = '0x11AB70A4564C62F567B92868Cb5e69b50c5434aF' @@ -158,7 +100,7 @@ export const mainSideMenuOptions = { } export const SEPOLIA_CSV_ENTRY = { name: 'test-sepolia-3', - address: SEPOLIA_TEST_SAFE_3, + address: safes.SEP_STATIC_SAFE_5, } export const GNO_CSV_ENTRY = { diff --git a/cypress/support/safe-apps-commands.js b/cypress/support/safe-apps-commands.js index f303b4ea79..ddbf3d826b 100644 --- a/cypress/support/safe-apps-commands.js +++ b/cypress/support/safe-apps-commands.js @@ -1,8 +1,7 @@ import { INFO_MODAL_KEY } from '../e2e/safe-apps/constants' -import * as constants from '../support/constants' +import safes from '../fixtures/safes/static.json' const allowedApps = ['https://safe-test-app.com'] -const TEST_SAFE = constants.SEPOLIA_TEST_SAFE_5 Cypress.Commands.add('visitSafeApp', (appUrl) => { cy.on('window:before:load', (window) => { @@ -14,7 +13,7 @@ Cypress.Commands.add('visitSafeApp', (appUrl) => { ) }) - cy.visit(`/apps/open?safe=${TEST_SAFE}&appUrl=${encodeURIComponent(appUrl)}`, { + cy.visit(`/apps/open?safe=${safes.SEP_STATIC_SAFE_2}&appUrl=${encodeURIComponent(appUrl)}`, { failOnStatusCode: false, onBeforeLoad: (win) => { win.addEventListener('message', cy.stub().as('safeAppsMessage')) diff --git a/cypress/support/safes/safesHandler.js b/cypress/support/safes/safesHandler.js new file mode 100644 index 0000000000..b462b298ca --- /dev/null +++ b/cypress/support/safes/safesHandler.js @@ -0,0 +1,25 @@ +export const CATEGORIES = { + funds: 'funds', + nfts: 'nfts', + static: 'static', + safeapps: 'safeapps', + recovery: 'recovery', +} + +function loadSafesModule(categoryKey) { + const category = CATEGORIES[categoryKey] + if (!category) { + throw new Error(`Category key '${categoryKey}' is not recognized.`) + } + + return cy.fixture(`safes/${category}.json`).then((data) => { + return data + }) +} + +export function getSafes(categoryKey) { + return loadSafesModule(categoryKey).then((safes) => { + console.log(`Loaded ${categoryKey}:`, safes) + return safes + }) +}