diff --git a/cypress/e2e/pages/create_tx.pages.js b/cypress/e2e/pages/create_tx.pages.js index 426b45d86f..84888d03ce 100644 --- a/cypress/e2e/pages/create_tx.pages.js +++ b/cypress/e2e/pages/create_tx.pages.js @@ -313,7 +313,7 @@ export function verifyNativeTokenTransfer() { } export function changeNonce(value) { - cy.get(nonceInput).clear().type(value, { force: true }).blur() + cy.get(nonceInput).clear().type(value, { force: true }) } export function verifyConfirmTransactionData() { diff --git a/cypress/e2e/pages/spending_limits.pages.js b/cypress/e2e/pages/spending_limits.pages.js index 544d1d000f..8cf1c1aca8 100644 --- a/cypress/e2e/pages/spending_limits.pages.js +++ b/cypress/e2e/pages/spending_limits.pages.js @@ -2,6 +2,7 @@ import * as constants from '../../support/constants' import * as main from './main.page' import * as addressBook from '../pages/address_book.page' import { invalidAddressFormatErrorMsg } from '../pages/load_safe.pages' +import * as ls from '../../support/localstorage_data.js' import 'cypress-file-upload' export const spendingLimitsSection = '[data-testid="spending-limit-section"]' @@ -31,7 +32,10 @@ const oldTokenAmount = '[data-testid="old-token-amount"]' const oldResetTime = '[data-testid="old-reset-time"]' const slimitReplacementWarning = '[data-testid="limit-replacement-warning"]' const addressItem = '[data-testid="address-item"]' -import * as ls from '../../support/localstorage_data.js' + +const actionSectionItem = () => { + return cy.get('[data-testid="CodeIcon"]').parent() +} export const timePeriodOptions = { oneTime: 'One time', @@ -43,7 +47,7 @@ export const timePeriodOptions = { const getBeneficiaryInput = () => cy.get(beneficiarySection).find('input').should('be.enabled') const automationOwner = ls.addressBookData.sepoliaAddress2[11155111]['0xC16Db0251654C0a72E91B190d81eAD367d2C6fED'] -const expectedSpendOptions = ['0 of 0.17 ETH', '0 of 0.05 ETH', '0 of 0.01 ETH'] +const expectedSpendOptions = ['0 of 0.17 ETH', '0.00001 of 0.05 ETH', '0 of 0.01 ETH'] const expectedResetOptions = new Array(3).fill('One-time') const newTransactionStr = 'New transaction' @@ -59,6 +63,11 @@ export function selectRecipient(recipient) { export function verifyOldValuesAreDisplayed() { main.verifyElementsIsVisible([oldTokenAmount, oldResetTime, slimitReplacementWarning]) } + +export function verifyActionNamesAreDisplayed(names) { + main.verifyValuesExist(actionSectionItem, names) +} + export function verifySpendingLimitBtnIsDisabled() { cy.get(newSpendingLimitBtn).should('be.disabled') } diff --git a/cypress/e2e/regression/spending_limits.cy.js b/cypress/e2e/regression/spending_limits.cy.js index 77f5c172b0..be906829ab 100644 --- a/cypress/e2e/regression/spending_limits.cy.js +++ b/cypress/e2e/regression/spending_limits.cy.js @@ -78,6 +78,19 @@ describe('Spending limits tests', () => { spendinglimit.verifyOldValuesAreDisplayed() }) + it('Verify that when editing spending limit for owner who used some of it, relevant actions are displayed', () => { + spendinglimit.clickOnNewSpendingLimitBtn() + spendinglimit.enterBeneficiaryAddress(constants.SPENDING_LIMIT_ADDRESS_2) + spendinglimit.enterSpendingLimitAmount(newTokenAmount) + spendinglimit.clickOnTimePeriodDropdown() + spendinglimit.selectTimePeriod(spendinglimit.timePeriodOptions.oneTime) + tx.clickOnNextBtn() + spendinglimit.verifyActionNamesAreDisplayed([ + constants.TXActionNames.resetAllowance, + constants.TXActionNames.setAllowance, + ]) + }) + it('Verify that when multiple assets are available, they are displayed in token dropdown', () => { main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__settings, ls.safeSettings.slimitSettings).then(() => { main diff --git a/cypress/e2e/safe-apps/drain_account.spec.cy.js b/cypress/e2e/safe-apps/drain_account.spec.cy.js index 773559d748..3c2f2a14fa 100644 --- a/cypress/e2e/safe-apps/drain_account.spec.cy.js +++ b/cypress/e2e/safe-apps/drain_account.spec.cy.js @@ -6,10 +6,10 @@ import * as safeapps from '../pages/safeapps.pages' describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { const appUrl = constants.drainAccount_url const iframeSelector = `iframe[id="iframe-${appUrl}"]` - const visitUrl = `/apps/open?safe=${constants.GOERLI_SAFE_APPS_SAFE}&appUrl=${encodeURIComponent(appUrl)}` + const visitUrl = `/apps/open?safe=${constants.SEPOLIA_TEST_SAFE_5}&appUrl=${encodeURIComponent(appUrl)}` beforeEach(() => { - cy.intercept(`**//v1/chains/5/safes/${constants.GOERLI_SAFE_APPS_SAFE.substring(4)}/balances/**`, { + cy.intercept(`**//v1/chains/5/safes/${constants.SEPOLIA_TEST_SAFE_5.substring(4)}/balances/**`, { fixture: 'balances.json', }) @@ -19,7 +19,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { safeapps.clickOnContinueBtn() }) - it('Verify drain can be created', () => { + it.skip('Verify drain can be created', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.recipientStr).type(constants.SAFE_APP_ADDRESS_2) getBody().findAllByText(safeapps.transferEverythingStr).click() @@ -28,7 +28,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { cy.findByRole('button', { name: safeapps.testNativeTransfer2 }) }) - it('Verify partial drain can be created', () => { + it.skip('Verify partial drain can be created', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click() getBody().findAllByLabelText(safeapps.selectRowChbxStr).eq(1).click() @@ -40,7 +40,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { cy.findByRole('button', { name: safeapps.testNativeTransfer1 }) }) - it('Verify a drain can be created when a ENS is specified', () => { + it.skip('Verify a drain can be created when a ENS is specified', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.recipientStr).type('goerli-test-safe.eth').wait(2000) getBody().findAllByText(safeapps.transferEverythingStr).click() @@ -61,14 +61,14 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { }) }) - it('Verify a drain cannot be created with no recipient selected', () => { + it.skip('Verify a drain cannot be created with no recipient selected', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findAllByText(safeapps.transferEverythingStr).click() getBody().findByText(safeapps.validRecipientAddressStr) }) }) - it('Verify a drain cannot be created with invalid recipient selected', () => { + it.skip('Verify a drain cannot be created with invalid recipient selected', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.recipientStr).type(constants.SAFE_APP_ADDRESS_2.substring(1)) getBody().findAllByText(safeapps.transferEverythingStr).click() @@ -76,7 +76,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { }) }) - it('Verify a drain cannot be created when no assets are selected', () => { + it.skip('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.SAFE_APP_ADDRESS_2) @@ -84,7 +84,7 @@ describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => { }) }) - it('Verify a drain cannot be created when no assets and recipient are selected', () => { + it.skip('Verify a drain cannot be created when no assets and recipient are selected', () => { cy.enter(iframeSelector).then((getBody) => { getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click() getBody().findAllByText(safeapps.noTokensSelectedStr).should('be.visible') diff --git a/cypress/e2e/smoke/create_tx.cy.js b/cypress/e2e/smoke/create_tx.cy.js index d5fa633939..81c1aa0a74 100644 --- a/cypress/e2e/smoke/create_tx.cy.js +++ b/cypress/e2e/smoke/create_tx.cy.js @@ -3,7 +3,7 @@ import * as main from '../../e2e/pages/main.page' import * as createtx from '../../e2e/pages/create_tx.pages' const sendValue = 0.00002 -const currentNonce = 0 +const currentNonce = 1 function happyPathToStepTwo() { createtx.typeRecipientAddress(constants.EOA) @@ -42,6 +42,8 @@ describe('[SMOKE] Create transactions tests', () => { }) it('[SMOKE] Verify nonce tooltip warning messages', () => { + createtx.changeNonce(0) + createtx.verifyTooltipMessage(constants.nonceTooltipMsg.lowerThanCurrent + currentNonce.toString()) createtx.changeNonce(currentNonce + 50) createtx.verifyTooltipMessage(constants.nonceTooltipMsg.higherThanRecommended) createtx.changeNonce(currentNonce + 150) diff --git a/cypress/support/constants.js b/cypress/support/constants.js index 032ea59783..51212cc766 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -32,6 +32,7 @@ export const SAFE_APP_ADDRESS = '0x11AB70A4564C62F567B92868Cb5e69b50c5434aF' export const SAFE_APP_ADDRESS_2 = '0x49d4450977E2c95362C13D3a31a09311E0Ea26A6' export const SAFE_APP_ADDRESS_3 = '0xc6b82bA149CFA113f8f48d5E3b1F78e933e16DfD' export const DEFAULT_OWNER_ADDRESS = '0xC16Db0251654C0a72E91B190d81eAD367d2C6fED' +export const SPENDING_LIMIT_ADDRESS_2 = '0x52835f11E348605E9D791Ec09380a3224526d538' export const SEPOLIA_OWNER_2 = '0x96D4c6fFC338912322813a77655fCC926b9A5aC5' export const TEST_SAFE_2 = 'gor:0xE96C43C54B08eC528e9e815fC3D02Ea94A320505' export const SIDEBAR_ADDRESS = '0x04f8...1a91' @@ -85,6 +86,11 @@ export const safeListEndpoint = '**/safes' export const VALID_QR_CODE_PATH = '../fixtures/sepolia_test_safe_QR.png' export const INVALID_QR_CODE_PATH = '../fixtures/invalid_image_QR_test.png' +export const TXActionNames = { + resetAllowance: 'resetAllowance', + setAllowance: 'setAllowance', +} + export const networkKeys = { sepolia: '11155111', }