From ccd21116b42a55197600a1d40451ef7d1a56c81e Mon Sep 17 00:00:00 2001 From: mike10ca Date: Mon, 20 Jan 2025 16:05:11 +0100 Subject: [PATCH 1/3] Improve test organization --- .github/workflows/web-e2e-hp-ondemand.yml | 2 +- .../create_safe_cf.cy.js | 4 +- .../cypress/e2e/regression/add_owner.cy.js | 20 +++- .../e2e/regression/address_book_3.cy.js | 102 ++++++++++++++++++ apps/web/cypress/e2e/regression/assets.cy.js | 48 +++++++++ .../web/cypress/e2e/regression/batch_tx.cy.js | 23 ++++ .../e2e/regression/create_safe_simple.cy.js | 1 + .../create_safe_simple_3.cy.js} | 18 ++-- .../{smoke => regression}/create_tx_2.cy.js | 7 +- .../cypress/e2e/regression/dashboard.cy.js | 39 +++++++ .../e2e/regression/import_export_data_2.cy.js | 62 +++++++++++ .../cypress/e2e/regression/load_safe_3.cy.js | 60 +++++++++++ .../e2e/regression/messages_offchain.cy.js | 34 ++++++ .../cypress/e2e/regression/tx_history_5.cy.js | 9 ++ apps/web/cypress/e2e/smoke/add_owner.cy.js | 19 ---- apps/web/cypress/e2e/smoke/address_book.cy.js | 85 --------------- apps/web/cypress/e2e/smoke/assets.cy.js | 30 ++---- apps/web/cypress/e2e/smoke/batch_tx.cy.js | 34 ++---- apps/web/cypress/e2e/smoke/dashboard.cy.js | 23 ---- .../e2e/smoke/import_export_data_2.cy.js | 46 -------- apps/web/cypress/e2e/smoke/load_safe.cy.js | 42 -------- .../cypress/e2e/smoke/messages_offchain.cy.js | 21 ---- apps/web/cypress/e2e/smoke/tx_history.cy.js | 7 -- 23 files changed, 431 insertions(+), 305 deletions(-) rename apps/web/cypress/e2e/{smoke => happypath_2}/create_safe_cf.cy.js (93%) create mode 100644 apps/web/cypress/e2e/regression/address_book_3.cy.js create mode 100644 apps/web/cypress/e2e/regression/assets.cy.js rename apps/web/cypress/e2e/{smoke/create_safe_simple.cy.js => regression/create_safe_simple_3.cy.js} (78%) rename apps/web/cypress/e2e/{smoke => regression}/create_tx_2.cy.js (85%) create mode 100644 apps/web/cypress/e2e/regression/dashboard.cy.js create mode 100644 apps/web/cypress/e2e/regression/import_export_data_2.cy.js create mode 100644 apps/web/cypress/e2e/regression/load_safe_3.cy.js create mode 100644 apps/web/cypress/e2e/regression/messages_offchain.cy.js diff --git a/.github/workflows/web-e2e-hp-ondemand.yml b/.github/workflows/web-e2e-hp-ondemand.yml index ea86d54a8b..04a549dc62 100644 --- a/.github/workflows/web-e2e-hp-ondemand.yml +++ b/.github/workflows/web-e2e-hp-ondemand.yml @@ -3,7 +3,7 @@ name: Web Happy path on demand tests on: workflow_dispatch: schedule: - - cron: '0 4 * * 1,4' + - cron: '0 4 * * 3' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/apps/web/cypress/e2e/smoke/create_safe_cf.cy.js b/apps/web/cypress/e2e/happypath_2/create_safe_cf.cy.js similarity index 93% rename from apps/web/cypress/e2e/smoke/create_safe_cf.cy.js rename to apps/web/cypress/e2e/happypath_2/create_safe_cf.cy.js index 8831f1fe9d..e6f091567a 100644 --- a/apps/web/cypress/e2e/smoke/create_safe_cf.cy.js +++ b/apps/web/cypress/e2e/happypath_2/create_safe_cf.cy.js @@ -9,7 +9,7 @@ const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) // DO NOT use OWNER_2_PRIVATE_KEY for safe creation. Used for CF safes. const signer = walletCredentials.OWNER_2_PRIVATE_KEY -describe('[SMOKE] CF Safe creation tests', () => { +describe('CF Safe creation happy path tests', () => { beforeEach(() => { cy.visit(constants.welcomeUrl + '?chain=sep') // Required for data layer @@ -18,7 +18,7 @@ describe('[SMOKE] CF Safe creation tests', () => { getEvents() }) - it('[SMOKE] CF creation happy path. GA safe_created', () => { + it('CF creation happy path. GA safe_created', () => { wallet.connectSigner(signer) owner.waitForConnectionStatus() createwallet.clickOnContinueWithWalletBtn() diff --git a/apps/web/cypress/e2e/regression/add_owner.cy.js b/apps/web/cypress/e2e/regression/add_owner.cy.js index acf9296f6b..2c5813c683 100644 --- a/apps/web/cypress/e2e/regression/add_owner.cy.js +++ b/apps/web/cypress/e2e/regression/add_owner.cy.js @@ -9,7 +9,6 @@ import { getMockAddress } from '../../support/utils/ethers.js' let staticSafes = [] const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) const signer = walletCredentials.OWNER_4_PRIVATE_KEY -const signer2 = walletCredentials.OWNER_1_PRIVATE_KEY describe('Add Owners tests', () => { before(async () => { @@ -60,4 +59,23 @@ describe('Add Owners tests', () => { owner.clickOnNextBtn() owner.verifyConfirmTransactionWindowDisplayed() }) + + it('Verify default threshold value. Verify correct threshold calculation', () => { + wallet.connectSigner(signer) + owner.openAddOwnerWindow() + owner.typeOwnerAddress(constants.DEFAULT_OWNER_ADDRESS) + owner.verifyThreshold(1, 2) + }) + + it('Verify valid Address validation', () => { + wallet.connectSigner(signer) + owner.openAddOwnerWindow() + owner.typeOwnerAddress(constants.SEPOLIA_OWNER_2) + owner.clickOnNextBtn() + owner.verifyConfirmTransactionWindowDisplayed() + owner.clickOnBackBtn() + owner.typeOwnerAddress(staticSafes.SEP_STATIC_SAFE_3) + owner.clickOnNextBtn() + owner.verifyConfirmTransactionWindowDisplayed() + }) }) diff --git a/apps/web/cypress/e2e/regression/address_book_3.cy.js b/apps/web/cypress/e2e/regression/address_book_3.cy.js new file mode 100644 index 0000000000..a2c12bde69 --- /dev/null +++ b/apps/web/cypress/e2e/regression/address_book_3.cy.js @@ -0,0 +1,102 @@ +import 'cypress-file-upload' +import * as constants from '../../support/constants.js' +import * as addressBook from '../pages/address_book.page.js' +import * as main from '../pages/main.page.js' +import * as ls from '../../support/localstorage_data.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' +import * as wallet from '../../support/utils/wallet.js' + +let staticSafes = [] + +const NAME = 'Owner1' +const NAME_2 = 'Owner2' +const EDITED_NAME = 'Edited Owner1' +const duplicateEntry = 'test-sepolia-90' +const owner1 = 'Automation owner' +const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) +const signer = walletCredentials.OWNER_4_PRIVATE_KEY +const recipientData = [owner1, constants.DEFAULT_OWNER_ADDRESS] + +describe('Address book tests - 3', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4) + }) + + it('Verify entry can be added', () => { + addressBook.clickOnCreateEntryBtn() + addressBook.addEntry(NAME, constants.RECIPIENT_ADDRESS) + }) + + it('Verify entry can be deleted', () => { + cy.wrap(null) + .then(() => + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) + .then(() => + main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), + ) + .then(() => { + cy.reload() + addressBook.clickDeleteEntryButton() + addressBook.clickDeleteEntryModalDeleteButton() + addressBook.verifyEditedNameNotExists(EDITED_NAME) + }) + }) + + it('Verify csv file can be imported', () => { + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.validCSVFile) + addressBook.verifyImportBtnStatus(constants.enabledStates.enabled) + addressBook.clickOnImportBtn() + addressBook.verifyDataImported(addressBook.entries) + addressBook.verifyNumberOfRows(4) + }) + + it('Import a csv file with an empty address/name/network in one row', () => { + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.emptyCSVFile) + addressBook.verifyImportBtnStatus(constants.enabledStates.disabled) + addressBook.verifyUploadExportMessage([addressBook.uploadErrorMessages.emptyFile]) + }) + + it('Import a non-csv file', () => { + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.nonCSVFile) + addressBook.verifyImportBtnStatus(constants.enabledStates.disabled) + addressBook.verifyUploadExportMessage([addressBook.uploadErrorMessages.fileType]) + }) + + it('Import a csv file with a repeated address and same network', () => { + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.duplicatedCSVFile) + addressBook.verifyImportBtnStatus(constants.enabledStates.enabled) + addressBook.clickOnImportBtn() + addressBook.verifyDataImported([duplicateEntry]) + addressBook.verifyNumberOfRows(1) + }) + + it('Verify modal shows the amount of entries and networks detected', () => { + addressBook.clickOnImportFileBtn() + addressBook.importCSVFile(addressBook.networksCSVFile) + addressBook.verifyImportBtnStatus(constants.enabledStates.enabled) + addressBook.verifyModalSummaryMessage(4, 3) + }) + + it('Verify an entry can be added by ENS name', () => { + addressBook.clickOnCreateEntryBtn() + addressBook.addEntryByENS(NAME_2, constants.ENS_TEST_SEPOLIA) + }) + + it('Verify clicking on Send button autofills the recipient filed with correct value', () => { + main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress2) + cy.wait(1000) + cy.reload() + wallet.connectSigner(signer) + addressBook.clickOnSendBtn() + addressBook.verifyRecipientData(recipientData) + }) +}) diff --git a/apps/web/cypress/e2e/regression/assets.cy.js b/apps/web/cypress/e2e/regression/assets.cy.js new file mode 100644 index 0000000000..418fac951b --- /dev/null +++ b/apps/web/cypress/e2e/regression/assets.cy.js @@ -0,0 +1,48 @@ +import * as constants from '../../support/constants' +import * as assets from '../pages/assets.pages' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' +import * as wallet from '../../support/utils/wallet.js' +import * as main from '../pages/main.page' + +let staticSafes = [] + +const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) +const signer = walletCredentials.OWNER_4_PRIVATE_KEY + +describe('Assets tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2) + }) + + it('Verify that "Hide token" button is present and opens the "Hide tokens menu"', () => { + assets.selectTokenList(assets.tokenListOptions.allTokens) + assets.openHideTokenMenu() + assets.verifyEachRowHasCheckbox() + }) + + it('Verify that clicking the button with an owner opens the Send funds form', () => { + wallet.connectSigner(signer) + assets.selectTokenList(assets.tokenListOptions.allTokens) + assets.clickOnSendBtn(0) + }) + + it('[SMOKE] Verify that Token list dropdown down options show/hide spam tokens', () => { + let spamTokens = [ + assets.currencyAave, + assets.currencyTestTokenA, + assets.currencyTestTokenB, + assets.currencyUSDC, + assets.currencyLink, + assets.currencyDaiCap, + ] + + main.verifyValuesDoNotExist(assets.tokenListTable, spamTokens) + assets.selectTokenList(assets.tokenListOptions.allTokens) + spamTokens.push(constants.tokenNames.sepoliaEther) + main.verifyValuesExist(assets.tokenListTable, spamTokens) + }) +}) diff --git a/apps/web/cypress/e2e/regression/batch_tx.cy.js b/apps/web/cypress/e2e/regression/batch_tx.cy.js index 9c2748e336..a8055fcefe 100644 --- a/apps/web/cypress/e2e/regression/batch_tx.cy.js +++ b/apps/web/cypress/e2e/regression/batch_tx.cy.js @@ -88,4 +88,27 @@ describe('Batch transaction tests', { defaultCommandTimeout: 30000 }, () => { cy.get(batch.batchTxTopBar).should('not.exist') }) }) + + it('Verify a transaction can be added to the batch', () => { + wallet.connectSigner(signer) + batch.addNewTransactionToBatch(constants.EOA, currentNonce, funds_first_tx) + batch.verifyBatchIconCount(1) + batch.clickOnBatchCounter() + batch.verifyAmountTransactionsInBatch(1) + }) + + it('Verify a transaction can be removed from the batch', () => { + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) + .then(() => main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) + .then(() => { + cy.reload() + wallet.connectSigner(signer) + batch.clickOnBatchCounter() + cy.contains(batch.batchedTransactionsStr).should('be.visible').parents('aside').find('ul > li').as('BatchList') + cy.get('@BatchList').find(batch.deleteTransactionbtn).eq(0).click() + cy.get('@BatchList').should('have.length', 1) + cy.get('@BatchList').contains(funds_first_tx).should('not.exist') + }) + }) }) diff --git a/apps/web/cypress/e2e/regression/create_safe_simple.cy.js b/apps/web/cypress/e2e/regression/create_safe_simple.cy.js index 484df62ca7..3f896e9188 100644 --- a/apps/web/cypress/e2e/regression/create_safe_simple.cy.js +++ b/apps/web/cypress/e2e/regression/create_safe_simple.cy.js @@ -122,6 +122,7 @@ describe('Safe creation tests', () => { main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName), ) .then(() => { + cy.reload() createwallet.waitForConnectionMsgDisappear() createwallet.selectMultiNetwork(1, constants.networks.sepolia.toLowerCase()) createwallet.clickOnNextBtn() diff --git a/apps/web/cypress/e2e/smoke/create_safe_simple.cy.js b/apps/web/cypress/e2e/regression/create_safe_simple_3.cy.js similarity index 78% rename from apps/web/cypress/e2e/smoke/create_safe_simple.cy.js rename to apps/web/cypress/e2e/regression/create_safe_simple_3.cy.js index 2ba907a99c..1b13140871 100644 --- a/apps/web/cypress/e2e/smoke/create_safe_simple.cy.js +++ b/apps/web/cypress/e2e/regression/create_safe_simple_3.cy.js @@ -1,17 +1,17 @@ -import * as constants from '../../support/constants' -import * as main from '../../e2e/pages/main.page' -import * as createwallet from '../pages/create_wallet.pages' -import * as owner from '../pages/owners.pages' +import * as constants from '../../support/constants.js' +import * as main from '../pages/main.page.js' +import * as createwallet from '../pages/create_wallet.pages.js' +import * as owner from '../pages/owners.pages.js' import * as wallet from '../../support/utils/wallet.js' const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) const signer = walletCredentials.OWNER_4_PRIVATE_KEY -describe('[SMOKE] Safe creation tests', () => { +describe('Safe creation tests 3', () => { beforeEach(() => { cy.visit(constants.welcomeUrl + '?chain=sep') }) - it('[SMOKE] Verify a Wallet can be connected', () => { + it('Verify a Wallet can be connected', () => { wallet.connectSigner(signer) owner.waitForConnectionStatus() createwallet.clickOnContinueWithWalletBtn() @@ -22,7 +22,7 @@ describe('[SMOKE] Safe creation tests', () => { owner.waitForConnectionStatus() }) - it('[SMOKE] Verify that a new Wallet has default name related to the selected network', () => { + it('Verify that a new Wallet has default name related to the selected network', () => { wallet.connectSigner(signer) owner.waitForConnectionStatus() createwallet.clickOnContinueWithWalletBtn() @@ -30,7 +30,7 @@ describe('[SMOKE] Safe creation tests', () => { createwallet.verifyDefaultWalletName(createwallet.defaultSepoliaPlaceholder) }) - it('[SMOKE] Verify Add and Remove Owner Row works as expected', () => { + it('Verify Add and Remove Owner Row works as expected', () => { wallet.connectSigner(signer) owner.waitForConnectionStatus() createwallet.clickOnContinueWithWalletBtn() @@ -46,7 +46,7 @@ describe('[SMOKE] Safe creation tests', () => { owner.verifyNumberOfOwners(2) }) - it('[SMOKE] Verify Threshold Setup', () => { + it('Verify Threshold Setup', () => { wallet.connectSigner(signer) owner.waitForConnectionStatus() createwallet.clickOnContinueWithWalletBtn() diff --git a/apps/web/cypress/e2e/smoke/create_tx_2.cy.js b/apps/web/cypress/e2e/regression/create_tx_2.cy.js similarity index 85% rename from apps/web/cypress/e2e/smoke/create_tx_2.cy.js rename to apps/web/cypress/e2e/regression/create_tx_2.cy.js index 330cabe92e..2753dcdcf4 100644 --- a/apps/web/cypress/e2e/smoke/create_tx_2.cy.js +++ b/apps/web/cypress/e2e/regression/create_tx_2.cy.js @@ -1,5 +1,4 @@ import * as constants from '../../support/constants.js' -import * as main from '../pages/main.page.js' import * as createtx from '../pages/create_tx.pages.js' import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' import * as wallet from '../../support/utils/wallet.js' @@ -18,7 +17,7 @@ function happyPathToStepTwo() { createtx.clickOnNextBtn() } -describe('[SMOKE] Create transactions tests 2', () => { +describe('Create transactions tests 2', () => { before(async () => { staticSafes = await getSafes(CATEGORIES.static) }) @@ -30,7 +29,7 @@ describe('[SMOKE] Create transactions tests 2', () => { createtx.clickOnSendTokensBtn() }) - it('[SMOKE] Verify advance parameters gas limit input', () => { + it('Verify advance parameters gas limit input', () => { happyPathToStepTwo() createtx.changeNonce('1') createtx.selectCurrentWallet() @@ -38,7 +37,7 @@ describe('[SMOKE] Create transactions tests 2', () => { createtx.verifyAndSubmitExecutionParams() }) - it('[SMOKE] Verify a transaction shows relayer and addToBatch button', () => { + it('Verify a transaction shows relayer and addToBatch button', () => { happyPathToStepTwo() createtx.verifySubmitBtnIsEnabled() createtx.verifyNativeTokenTransfer() diff --git a/apps/web/cypress/e2e/regression/dashboard.cy.js b/apps/web/cypress/e2e/regression/dashboard.cy.js new file mode 100644 index 0000000000..2307e446dc --- /dev/null +++ b/apps/web/cypress/e2e/regression/dashboard.cy.js @@ -0,0 +1,39 @@ +import * as constants from '../../support/constants' +import * as dashboard from '../pages/dashboard.pages' +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'] + +describe('Dashboard tests', { defaultCommandTimeout: 20000 }, () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_2) + }) + + it('Verify that pinned in dashboard, an app keeps its status on apps page', () => { + dashboard.pinAppByIndex(0).then((pinnedApp) => { + cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_2) + safeapps.verifyPinnedApp(pinnedApp) + cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_2) + dashboard.clickOnPinBtnByName(pinnedApp) + dashboard.verifyPinnedAppsCount(0) + }) + }) + + it('Verify clicking on View All button directs to list of all queued txs', () => { + dashboard.clickOnViewAllBtn() + createTx.verifyNumberOfTransactions(2) + }) + + it('Verify clicking on any tx takes the user to Transactions > Queue tab', () => { + dashboard.clickOnTxByIndex(0) + dashboard.verifySingleTxItem(txData) + }) +}) diff --git a/apps/web/cypress/e2e/regression/import_export_data_2.cy.js b/apps/web/cypress/e2e/regression/import_export_data_2.cy.js new file mode 100644 index 0000000000..8366ac2406 --- /dev/null +++ b/apps/web/cypress/e2e/regression/import_export_data_2.cy.js @@ -0,0 +1,62 @@ +import 'cypress-file-upload' +import * as file from '../pages/import_export.pages.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' +const invalidJsonPath_2 = 'cypress/fixtures/balances.json' +const invalidJsonPath_3 = 'cypress/fixtures/test-empty-batch.json' + +const appNames = ['Transaction Builder'] + +describe('Import Export Data tests 2', { defaultCommandTimeout: 20000 }, () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_13) + }) + + it('Verify that the Sidebar Import button opens an import modal', () => { + sidebar.openSidebar() + sidebar.clickOnSidebarImportBtn() + }) + + it('Verify that correctly formatted json file can be uploaded and shows data', () => { + sidebar.openSidebar() + sidebar.clickOnSidebarImportBtn() + file.dragAndDropFile(validJsonPath) + file.verifyImportMessages() + file.verifyImportBtnStatus(constants.enabledStates.enabled) + file.clickOnImportBtn() + cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_13) + file.verifyImportedAddressBookData() + cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_13) + file.verifyPinnedApps(appNames) + }) + + it('Verify that only json files can be imported', () => { + sidebar.openSidebar() + sidebar.clickOnSidebarImportBtn() + file.dragAndDropFile(invalidJsonPath) + file.verifyErrorOnUpload() + file.verifyImportBtnStatus(constants.enabledStates.disabled) + }) + + it('Verify that json files with wrong information are rejected', () => { + sidebar.openSidebar() + sidebar.clickOnSidebarImportBtn() + file.dragAndDropFile(invalidJsonPath_3) + file.verifyUploadErrorMessage(file.importErrorMessages.noImportableData) + file.clickOnCancelBtn() + sidebar.clickOnSidebarImportBtn() + file.dragAndDropFile(invalidJsonPath_2) + file.verifyUploadErrorMessage(file.importErrorMessages.noImportableData) + file.clickOnCancelBtn() + }) +}) diff --git a/apps/web/cypress/e2e/regression/load_safe_3.cy.js b/apps/web/cypress/e2e/regression/load_safe_3.cy.js new file mode 100644 index 0000000000..baae295b26 --- /dev/null +++ b/apps/web/cypress/e2e/regression/load_safe_3.cy.js @@ -0,0 +1,60 @@ +import 'cypress-file-upload' +import * as constants from '../../support/constants.js' +import * as main from '../pages/main.page.js' +import * as safe from '../pages/load_safe.pages.js' +import * as createwallet from '../pages/create_wallet.pages.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' + +let staticSafes = [] + +const testSafeName = 'Test safe name' +const testOwnerName = 'Test Owner Name' + +describe('Load Safe tests - 3', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.visit(constants.loadNewSafeSepoliaUrl) + }) + + it('Verify that after loading existing Safe, its name input is not empty', () => { + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_4) + safe.clickOnNextBtn() + safe.verifyOnwerInputIsNotEmpty(0) + }) + + it('Verify that when changing a network in dropdown, the same network is displayed in right top corner', () => { + safe.clickNetworkSelector(constants.networks.sepolia) + safe.selectPolygon() + cy.wait(1000) + safe.checkMainNetworkSelected(constants.networks.polygon) + }) + + it('Verify the custom Safe name is successfully loaded', () => { + safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_3) + safe.clickOnNextBtn() + createwallet.typeOwnerName(testOwnerName, 0) + safe.clickOnNextBtn() + safe.verifyDataInReviewSection( + testSafeName, + testOwnerName, + constants.commonThresholds.oneOfOne, + constants.networks.sepolia, + constants.SEPOLIA_OWNER_2, + ) + safe.clickOnAddBtn() + main.verifyHomeSafeUrl(staticSafes.SEP_STATIC_SAFE_3) + safe.veriySidebarSafeNameIsVisible(testSafeName) + safe.verifyOwnerNamePresentInSettings(testOwnerName) + }) + + it('Verify a network can be selected in the Safe', () => { + safe.clickNetworkSelector(constants.networks.sepolia) + safe.selectPolygon() + cy.wait(2000) + safe.clickNetworkSelector(constants.networks.polygon) + safe.selectSepolia() + }) +}) diff --git a/apps/web/cypress/e2e/regression/messages_offchain.cy.js b/apps/web/cypress/e2e/regression/messages_offchain.cy.js new file mode 100644 index 0000000000..5b98aa1bfb --- /dev/null +++ b/apps/web/cypress/e2e/regression/messages_offchain.cy.js @@ -0,0 +1,34 @@ +import * as constants from '../../support/constants.js' +import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' +import * as modal from '../pages/modals.page' +import * as messages from '../pages/messages.pages.js' +import * as msg_confirmation_modal from '../pages/modals/message_confirmation.pages.js' +import * as wallet from '../../support/utils/wallet.js' + +let staticSafes = [] +const offchainMessage = 'Test message 2 off-chain' + +const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) +const signer2 = walletCredentials.OWNER_1_PRIVATE_KEY + +describe('Offchain Messages tests', () => { + before(async () => { + staticSafes = await getSafes(CATEGORIES.static) + }) + + beforeEach(() => { + cy.visit(constants.transactionsMessagesUrl + staticSafes.SEP_STATIC_SAFE_10) + }) + + it('Verify confirmation window is displayed for unsigned message', () => { + cy.visit(constants.transactionsMessagesUrl + staticSafes.SEP_STATIC_SAFE_26) + wallet.connectSigner(signer2) + messages.clickOnMessageSignBtn(0) + msg_confirmation_modal.verifyConfirmationWindowTitle(modal.modalTitiles.confirmMsg) + msg_confirmation_modal.verifyMessagePresent(offchainMessage) + msg_confirmation_modal.clickOnMessageDetails() + msg_confirmation_modal.verifyOffchainMessageHash(0) + msg_confirmation_modal.verifyOffchainMessageHash(1) + msg_confirmation_modal.checkMessageInfobox() + }) +}) diff --git a/apps/web/cypress/e2e/regression/tx_history_5.cy.js b/apps/web/cypress/e2e/regression/tx_history_5.cy.js index 8675a52082..657d5cb1b7 100644 --- a/apps/web/cypress/e2e/regression/tx_history_5.cy.js +++ b/apps/web/cypress/e2e/regression/tx_history_5.cy.js @@ -8,6 +8,7 @@ let staticSafes = [] const typeSend = data.type.send const typeGeneral = data.type.general +const typeUntrustedToken = data.type.untrustedReceivedToken const safe = 'sep:0x8f4A19C85b39032A37f7a6dCc65234f966F72551' const txbuilder = @@ -23,4 +24,12 @@ describe('Safe app tx history tests', () => { createTx.verifySummaryByName(typeSend.txBuilderTitle, null, [typeGeneral.statusOk], typeSend.txBuilderAltImage) main.verifyValuesExist(createTx.transactionItem, [typeSend.txBuilderTitle]) }) + + it('Verify that copying sender address of untrusted token shows warning popup', () => { + cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7) + createTx.toggleUntrustedTxs() + createTx.clickOnTransactionItemByName(typeUntrustedToken.summaryTitle, typeUntrustedToken.summaryTxInfo) + createTx.clickOnCopyBtn(0) + createTx.verifyWarningModalVisible() + }) }) diff --git a/apps/web/cypress/e2e/smoke/add_owner.cy.js b/apps/web/cypress/e2e/smoke/add_owner.cy.js index 0d54292989..8eb448ffad 100644 --- a/apps/web/cypress/e2e/smoke/add_owner.cy.js +++ b/apps/web/cypress/e2e/smoke/add_owner.cy.js @@ -50,23 +50,4 @@ describe('[SMOKE] Add Owners tests', () => { main.waitForHistoryCallToComplete() owner.verifyAddOwnerBtnIsDisabled() }) - - it('[SMOKE] Verify default threshold value. Verify correct threshold calculation', () => { - wallet.connectSigner(signer) - owner.openAddOwnerWindow() - owner.typeOwnerAddress(constants.DEFAULT_OWNER_ADDRESS) - owner.verifyThreshold(1, 2) - }) - - it('[SMOKE] Verify valid Address validation', () => { - wallet.connectSigner(signer) - owner.openAddOwnerWindow() - owner.typeOwnerAddress(constants.SEPOLIA_OWNER_2) - owner.clickOnNextBtn() - owner.verifyConfirmTransactionWindowDisplayed() - owner.clickOnBackBtn() - owner.typeOwnerAddress(staticSafes.SEP_STATIC_SAFE_3) - owner.clickOnNextBtn() - owner.verifyConfirmTransactionWindowDisplayed() - }) }) diff --git a/apps/web/cypress/e2e/smoke/address_book.cy.js b/apps/web/cypress/e2e/smoke/address_book.cy.js index 326a33ea91..0255458feb 100644 --- a/apps/web/cypress/e2e/smoke/address_book.cy.js +++ b/apps/web/cypress/e2e/smoke/address_book.cy.js @@ -2,22 +2,11 @@ import 'cypress-file-upload' 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 wallet from '../../support/utils/wallet.js' 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' -const EDITED_NAME = 'Edited Owner1' -const duplicateEntry = 'test-sepolia-90' -const owner1 = 'Automation owner' - -const recipientData = [owner1, constants.DEFAULT_OWNER_ADDRESS] -const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) -const signer = walletCredentials.OWNER_4_PRIVATE_KEY - describe('[SMOKE] Address book tests', () => { before(async () => { staticSafes = await getSafes(CATEGORIES.static) @@ -28,71 +17,6 @@ describe('[SMOKE] Address book tests', () => { main.waitForHistoryCallToComplete() }) - it('[SMOKE] Verify entry can be added', () => { - addressBook.clickOnCreateEntryBtn() - addressBook.addEntry(NAME, constants.RECIPIENT_ADDRESS) - }) - - it('[SMOKE] Verify entry can be deleted', () => { - cy.wrap(null) - .then(() => - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), - ) - .then(() => - main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1), - ) - .then(() => { - cy.reload() - addressBook.clickDeleteEntryButton() - addressBook.clickDeleteEntryModalDeleteButton() - addressBook.verifyEditedNameNotExists(EDITED_NAME) - }) - }) - - it('[SMOKE] Verify csv file can be imported', () => { - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.validCSVFile) - addressBook.verifyImportBtnStatus(constants.enabledStates.enabled) - addressBook.clickOnImportBtn() - addressBook.verifyDataImported(addressBook.entries) - addressBook.verifyNumberOfRows(4) - }) - - it('[SMOKE] Import a csv file with an empty address/name/network in one row', () => { - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.emptyCSVFile) - addressBook.verifyImportBtnStatus(constants.enabledStates.disabled) - addressBook.verifyUploadExportMessage([addressBook.uploadErrorMessages.emptyFile]) - }) - - it('[SMOKE] Import a non-csv file', () => { - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.nonCSVFile) - addressBook.verifyImportBtnStatus(constants.enabledStates.disabled) - addressBook.verifyUploadExportMessage([addressBook.uploadErrorMessages.fileType]) - }) - - it('[SMOKE] Import a csv file with a repeated address and same network', () => { - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.duplicatedCSVFile) - addressBook.verifyImportBtnStatus(constants.enabledStates.enabled) - addressBook.clickOnImportBtn() - addressBook.verifyDataImported([duplicateEntry]) - addressBook.verifyNumberOfRows(1) - }) - - it('[SMOKE] Verify modal shows the amount of entries and networks detected', () => { - addressBook.clickOnImportFileBtn() - addressBook.importCSVFile(addressBook.networksCSVFile) - addressBook.verifyImportBtnStatus(constants.enabledStates.enabled) - addressBook.verifyModalSummaryMessage(4, 3) - }) - - it('[SMOKE] Verify an entry can be added by ENS name', () => { - addressBook.clickOnCreateEntryBtn() - addressBook.addEntryByENS(NAME_2, constants.ENS_TEST_SEPOLIA) - }) - it('[SMOKE] Verify empty name is not allowed when editing', () => { main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress1) cy.wait(1000) @@ -100,13 +24,4 @@ describe('[SMOKE] Address book tests', () => { addressBook.clickOnEditEntryBtn() addressBook.verifyEmptyOwnerNameNotAllowed() }) - - it('[SMOKE] Verify clicking on Send button autofills the recipient filed with correct value', () => { - main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sepoliaAddress2) - cy.wait(1000) - cy.reload() - wallet.connectSigner(signer) - addressBook.clickOnSendBtn() - addressBook.verifyRecipientData(recipientData) - }) }) diff --git a/apps/web/cypress/e2e/smoke/assets.cy.js b/apps/web/cypress/e2e/smoke/assets.cy.js index c81721bc29..b3a003741a 100644 --- a/apps/web/cypress/e2e/smoke/assets.cy.js +++ b/apps/web/cypress/e2e/smoke/assets.cy.js @@ -2,13 +2,10 @@ 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' -import * as wallet from '../../support/utils/wallet.js' +import * as ls from '../../support/localstorage_data.js' let staticSafes = [] -const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) -const signer = walletCredentials.OWNER_4_PRIVATE_KEY - describe('[SMOKE] Assets tests', () => { const fiatRegex = assets.fiatRegex @@ -38,21 +35,14 @@ describe('[SMOKE] Assets tests', () => { assets.currencyDaiCap, ] - main.verifyValuesDoNotExist(assets.tokenListTable, spamTokens) - assets.selectTokenList(assets.tokenListOptions.allTokens) - spamTokens.push(constants.tokenNames.sepoliaEther) - main.verifyValuesExist(assets.tokenListTable, spamTokens) - }) - - it('[SMOKE] Verify that "Hide token" button is present and opens the "Hide tokens menu"', () => { - assets.selectTokenList(assets.tokenListOptions.allTokens) - assets.openHideTokenMenu() - assets.verifyEachRowHasCheckbox() - }) - - it('[SMOKE] Verify that clicking the button with an owner opens the Send funds form', () => { - wallet.connectSigner(signer) - assets.selectTokenList(assets.tokenListOptions.allTokens) - assets.clickOnSendBtn(0) + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.slimitSettings)) + .then(() => { + cy.reload() + main.verifyValuesDoNotExist(assets.tokenListTable, spamTokens) + assets.selectTokenList(assets.tokenListOptions.allTokens) + spamTokens.push(constants.tokenNames.sepoliaEther) + main.verifyValuesExist(assets.tokenListTable, spamTokens) + }) }) }) diff --git a/apps/web/cypress/e2e/smoke/batch_tx.cy.js b/apps/web/cypress/e2e/smoke/batch_tx.cy.js index f363b5a48e..a48706b49d 100644 --- a/apps/web/cypress/e2e/smoke/batch_tx.cy.js +++ b/apps/web/cypress/e2e/smoke/batch_tx.cy.js @@ -24,17 +24,18 @@ describe('[SMOKE] Batch transaction tests', { defaultCommandTimeout: 30000 }, () }) it('[SMOKE] Verify empty batch list can be opened', () => { - wallet.connectSigner(signer) batch.openBatchtransactionsModal() - batch.openNewTransactionModal() + cy.contains(batch.addInitialTransactionStr).should('be.visible') }) - it('[SMOKE] Verify a transaction can be added to the batch', () => { - wallet.connectSigner(signer) - batch.addNewTransactionToBatch(constants.EOA, currentNonce, funds_first_tx) - batch.verifyBatchIconCount(1) - batch.clickOnBatchCounter() - batch.verifyAmountTransactionsInBatch(1) + it('[SMOKE] Verify a transaction is visible in a batch', () => { + cy.wrap(null) + .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry1)) + .then(() => { + batch.verifyBatchIconCount(1) + batch.clickOnBatchCounter() + batch.verifyAmountTransactionsInBatch(1) + }) }) it('[SMOKE] Verify the batch can be confirmed and related transactions exist in the form', () => { @@ -42,10 +43,8 @@ describe('[SMOKE] Batch transaction tests', { defaultCommandTimeout: 30000 }, () .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) .then(() => main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) .then(() => { - cy.reload() wallet.connectSigner(signer) batch.clickOnBatchCounter() - batch.clickOnConfirmBatchBtn() batch.verifyBatchTransactionsCount(2) batch.clickOnBatchCounter() @@ -54,19 +53,4 @@ describe('[SMOKE] Batch transaction tests', { defaultCommandTimeout: 30000 }, () cy.get('@TransactionList').find('li').eq(1).contains(funds_second_tx) }) }) - - it('[SMOKE] Verify a transaction can be removed from the batch', () => { - cy.wrap(null) - .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) - .then(() => main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) - .then(() => { - cy.reload() - wallet.connectSigner(signer) - batch.clickOnBatchCounter() - cy.contains(batch.batchedTransactionsStr).should('be.visible').parents('aside').find('ul > li').as('BatchList') - cy.get('@BatchList').find(batch.deleteTransactionbtn).eq(0).click() - cy.get('@BatchList').should('have.length', 1) - cy.get('@BatchList').contains(funds_first_tx).should('not.exist') - }) - }) }) diff --git a/apps/web/cypress/e2e/smoke/dashboard.cy.js b/apps/web/cypress/e2e/smoke/dashboard.cy.js index cfdb9b9c12..11d85aab75 100644 --- a/apps/web/cypress/e2e/smoke/dashboard.cy.js +++ b/apps/web/cypress/e2e/smoke/dashboard.cy.js @@ -1,8 +1,5 @@ import * as constants from '../../support/constants' 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 = [] @@ -37,21 +34,6 @@ describe('[SMOKE] Dashboard tests', { defaultCommandTimeout: 20000 }, () => { dashboard.clickOnExploreAppsBtn() }) - it('[SMOKE] Verify that pinned in dashboard, an app keeps its status on apps page', () => { - dashboard.pinAppByIndex(0).then((pinnedApp) => { - cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_2) - safeapps.verifyPinnedApp(pinnedApp) - cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_2) - dashboard.clickOnPinBtnByName(pinnedApp) - dashboard.verifyPinnedAppsCount(0) - }) - }) - - it('[SMOKE] Verify clicking on View All button directs to list of all queued txs', () => { - dashboard.clickOnViewAllBtn() - createTx.verifyNumberOfTransactions(2) - }) - it('[SMOKE] Verify there is empty tx string and image when there are no tx queued', () => { cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_13) dashboard.verifyEmptyTxSection() @@ -68,9 +50,4 @@ describe('[SMOKE] Dashboard tests', { defaultCommandTimeout: 20000 }, () => { dashboard.verifyTxItemInPendingTx(txaddOwner) dashboard.verifyTxItemInPendingTx(txMultiSendCall2) }) - - it('[SMOKE] Verify clicking on any tx takes the user to Transactions > Queue tab', () => { - dashboard.clickOnTxByIndex(0) - dashboard.verifySingleTxItem(txData) - }) }) diff --git a/apps/web/cypress/e2e/smoke/import_export_data_2.cy.js b/apps/web/cypress/e2e/smoke/import_export_data_2.cy.js index b712f3c549..33e7a29753 100644 --- a/apps/web/cypress/e2e/smoke/import_export_data_2.cy.js +++ b/apps/web/cypress/e2e/smoke/import_export_data_2.cy.js @@ -1,18 +1,10 @@ import 'cypress-file-upload' import * as file from '../pages/import_export.pages.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' -const invalidJsonPath_2 = 'cypress/fixtures/balances.json' -const invalidJsonPath_3 = 'cypress/fixtures/test-empty-batch.json' - -const appNames = ['Transaction Builder'] - describe('[SMOKE] Import Export Data tests 2', { defaultCommandTimeout: 20000 }, () => { before(async () => { staticSafes = await getSafes(CATEGORIES.static) @@ -22,50 +14,12 @@ describe('[SMOKE] Import Export Data tests 2', { defaultCommandTimeout: 20000 }, cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_13) }) - it('[SMOKE] Verify that the Sidebar Import button opens an import modal', () => { - sidebar.openSidebar() - sidebar.clickOnSidebarImportBtn() - }) - - it('[SMOKE] Verify that correctly formatted json file can be uploaded and shows data', () => { - sidebar.openSidebar() - sidebar.clickOnSidebarImportBtn() - file.dragAndDropFile(validJsonPath) - file.verifyImportMessages() - file.verifyImportBtnStatus(constants.enabledStates.enabled) - file.clickOnImportBtn() - cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_13) - file.verifyImportedAddressBookData() - cy.visit(constants.appsUrlGeneral + staticSafes.SEP_STATIC_SAFE_13) - file.verifyPinnedApps(appNames) - }) - - it('[SMOKE] Verify that only json files can be imported', () => { - sidebar.openSidebar() - sidebar.clickOnSidebarImportBtn() - file.dragAndDropFile(invalidJsonPath) - file.verifyErrorOnUpload() - file.verifyImportBtnStatus(constants.enabledStates.disabled) - }) - it('[SMOKE] Verify the Import section is on the Global settings', () => { cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_13) file.verifyImportSectionVisible() file.verifyValidImportInputExists() }) - it('[SMOKE] Verify that json files with wrong information are rejected', () => { - sidebar.openSidebar() - sidebar.clickOnSidebarImportBtn() - file.dragAndDropFile(invalidJsonPath_3) - file.verifyUploadErrorMessage(file.importErrorMessages.noImportableData) - file.clickOnCancelBtn() - sidebar.clickOnSidebarImportBtn() - file.dragAndDropFile(invalidJsonPath_2) - file.verifyUploadErrorMessage(file.importErrorMessages.noImportableData) - file.clickOnCancelBtn() - }) - it('[SMOKE] Verify that the Export section is present in the safe settings', () => { cy.visit(constants.dataSettingsUrl + staticSafes.SEP_STATIC_SAFE_13) file.verifyExportFileSectionIsVisible() diff --git a/apps/web/cypress/e2e/smoke/load_safe.cy.js b/apps/web/cypress/e2e/smoke/load_safe.cy.js index b2665cc2ad..e8c90813df 100644 --- a/apps/web/cypress/e2e/smoke/load_safe.cy.js +++ b/apps/web/cypress/e2e/smoke/load_safe.cy.js @@ -8,7 +8,6 @@ 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 () => { @@ -19,14 +18,6 @@ describe('[SMOKE] Load Safe tests', () => { cy.visit(constants.loadNewSafeSepoliaUrl) }) - it('[SMOKE] Verify a network can be selected in the Safe', () => { - safe.clickNetworkSelector(constants.networks.sepolia) - safe.selectPolygon() - cy.wait(2000) - safe.clickNetworkSelector(constants.networks.polygon) - safe.selectSepolia() - }) - it('[SMOKE] Verify only valid Safe name can be accepted', () => { // alias the address input label cy.get('input[name="address"]').parent().prev('label').as('addressLabel') @@ -37,7 +28,6 @@ describe('[SMOKE] Load Safe tests', () => { safe.verifyAddressInputValue(staticSafes.SEP_STATIC_SAFE_4) safe.verifyNextButtonStatus('be.enabled') - safe.clickOnNextBtn() }) it('[SMOKE] Verify names cannot have more than 50 characters', () => { @@ -50,25 +40,6 @@ describe('[SMOKE] Load Safe tests', () => { safe.inputAddress(constants.ENS_TEST_SEPOLIA) 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, staticSafes.SEP_STATIC_SAFE_3) - safe.clickOnNextBtn() - createwallet.typeOwnerName(testOwnerName, 0) - safe.clickOnNextBtn() - safe.verifyDataInReviewSection( - testSafeName, - testOwnerName, - constants.commonThresholds.oneOfOne, - constants.networks.sepolia, - constants.SEPOLIA_OWNER_2, - ) - safe.clickOnAddBtn() - main.verifyHomeSafeUrl(staticSafes.SEP_STATIC_SAFE_3) - safe.veriySidebarSafeNameIsVisible(testSafeName) - safe.verifyOwnerNamePresentInSettings(testOwnerName) }) it('[SMOKE] Verify safe name has a default name', () => { @@ -77,19 +48,6 @@ describe('[SMOKE] Load Safe tests', () => { createwallet.verifyDefaultWalletName(createwallet.defaultSepoliaPlaceholder) }) - it('[SMOKE] Verify that after loading existing Safe, its name input is not empty', () => { - safe.inputNameAndAddress(testSafeName, staticSafes.SEP_STATIC_SAFE_4) - safe.clickOnNextBtn() - safe.verifyOnwerInputIsNotEmpty(0) - }) - - it('[SMOKE] Verify that when changing a network in dropdown, the same network is displayed in right top corner', () => { - safe.clickNetworkSelector(constants.networks.sepolia) - safe.selectPolygon() - cy.wait(1000) - safe.checkMainNetworkSelected(constants.networks.polygon) - }) - it('[SMOKE] Verify there are mandatory networks in dropdown: Eth, Polygon, Sepolia', () => { safe.clickNetworkSelector(constants.networks.sepolia) safe.verifyMandatoryNetworksExist() diff --git a/apps/web/cypress/e2e/smoke/messages_offchain.cy.js b/apps/web/cypress/e2e/smoke/messages_offchain.cy.js index 7b997e0771..9d99016a5b 100644 --- a/apps/web/cypress/e2e/smoke/messages_offchain.cy.js +++ b/apps/web/cypress/e2e/smoke/messages_offchain.cy.js @@ -3,21 +3,12 @@ import * as main from '../pages/main.page.js' import * as createTx from '../pages/create_tx.pages.js' import * as msg_data from '../../fixtures/txmessages_data.json' import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' -import * as modal from '../pages/modals.page' -import * as messages from '../pages/messages.pages.js' -import * as msg_confirmation_modal from '../pages/modals/message_confirmation.pages.js' -import * as wallet from '../../support/utils/wallet.js' let staticSafes = [] -const offchainMessage = 'Test message 2 off-chain' const typeMessagesGeneral = msg_data.type.general const typeMessagesOffchain = msg_data.type.offChain -const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) -const signer = walletCredentials.OWNER_4_PRIVATE_KEY -const signer2 = walletCredentials.OWNER_1_PRIVATE_KEY - describe('[SMOKE] Offchain Messages tests', () => { before(async () => { staticSafes = await getSafes(CATEGORIES.static) @@ -78,16 +69,4 @@ describe('[SMOKE] Offchain Messages tests', () => { main.verifyTextVisibility(values) }) - - it('[SMOKE] Verify confirmation window is displayed for unsigned message', () => { - cy.visit(constants.transactionsMessagesUrl + staticSafes.SEP_STATIC_SAFE_26) - wallet.connectSigner(signer2) - messages.clickOnMessageSignBtn(0) - msg_confirmation_modal.verifyConfirmationWindowTitle(modal.modalTitiles.confirmMsg) - msg_confirmation_modal.verifyMessagePresent(offchainMessage) - msg_confirmation_modal.clickOnMessageDetails() - msg_confirmation_modal.verifyOffchainMessageHash(0) - msg_confirmation_modal.verifyOffchainMessageHash(1) - msg_confirmation_modal.checkMessageInfobox() - }) }) diff --git a/apps/web/cypress/e2e/smoke/tx_history.cy.js b/apps/web/cypress/e2e/smoke/tx_history.cy.js index a7495a5e12..e058e37fb5 100644 --- a/apps/web/cypress/e2e/smoke/tx_history.cy.js +++ b/apps/web/cypress/e2e/smoke/tx_history.cy.js @@ -88,11 +88,4 @@ describe('[SMOKE] Tx history tests', () => { ) createTx.verifySpamIconIsDisplayed(typeUntrustedToken.title, typeUntrustedToken.summaryTxInfo) }) - - it('[SMOKE] Verify that copying sender address of untrusted token shows warning popup', () => { - createTx.toggleUntrustedTxs() - createTx.clickOnTransactionItemByName(typeUntrustedToken.summaryTitle, typeUntrustedToken.summaryTxInfo) - createTx.clickOnCopyBtn(0) - createTx.verifyWarningModalVisible() - }) }) From 988e941952de2404e5f84f129be8fdae9aae29af Mon Sep 17 00:00:00 2001 From: mike10ca Date: Mon, 20 Jan 2025 16:33:02 +0100 Subject: [PATCH 2/3] Add reload action to trigger local storage changes in ci --- apps/web/cypress/e2e/smoke/batch_tx.cy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/cypress/e2e/smoke/batch_tx.cy.js b/apps/web/cypress/e2e/smoke/batch_tx.cy.js index a48706b49d..12e455ecdf 100644 --- a/apps/web/cypress/e2e/smoke/batch_tx.cy.js +++ b/apps/web/cypress/e2e/smoke/batch_tx.cy.js @@ -32,6 +32,7 @@ describe('[SMOKE] Batch transaction tests', { defaultCommandTimeout: 30000 }, () cy.wrap(null) .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry1)) .then(() => { + cy.reload() batch.verifyBatchIconCount(1) batch.clickOnBatchCounter() batch.verifyAmountTransactionsInBatch(1) @@ -43,6 +44,7 @@ describe('[SMOKE] Batch transaction tests', { defaultCommandTimeout: 30000 }, () .then(() => main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) .then(() => main.isItemInLocalstorage(constants.localStorageKeys.SAFE_v2__batch, ls.batchData.entry0)) .then(() => { + cy.reload() wallet.connectSigner(signer) batch.clickOnBatchCounter() batch.clickOnConfirmBatchBtn() From 62a548ea1db71ef8fd9f5ba44795138d3dcd0658 Mon Sep 17 00:00:00 2001 From: mike10ca Date: Mon, 20 Jan 2025 17:27:55 +0100 Subject: [PATCH 3/3] Update swap string --- apps/web/cypress/e2e/pages/create_tx.pages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/cypress/e2e/pages/create_tx.pages.js b/apps/web/cypress/e2e/pages/create_tx.pages.js index 0e4769fd61..4567c9c8e7 100644 --- a/apps/web/cypress/e2e/pages/create_tx.pages.js +++ b/apps/web/cypress/e2e/pages/create_tx.pages.js @@ -86,7 +86,7 @@ const enabledBulkExecuteBtnTooltip = 'All highlighted transactions will be inclu const bulkExecuteBtnStr = 'Bulk execute' const batchModalTitle = 'Batch' -const swapOrder = 'Swap order settlement' +const swapOrder = 'Bulk transactions' export const filterTypes = { incoming: 'Incoming',