mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* fix: copilot tests: remove overlapping element * fix: tx_history_4 tests: adjust tests to the latest UI * fix: tx_history and tx_history_2 tests adjusted to the new ui * refactor: replace the data-fragile Cypress E2E with unit tests for the "Safe App tx shows icon + name" behavior * refactor: adjust Proposers test to the latest UI changes * refactor: adjust batch_tx tests to the latest ui changes * refactor: adjust safe creation tests to the latest ui changes * refactor: adjust tx creation tests to the latest ui changes * refactor: adjust multichain setup tests to the latest ui changes * fix: correct string text in the Proposers test * fix: swap link as per FF * fix: multichain creation (add a login step; block overlapping beamer) * chore: bring back the swap prod link * fix: relay test: use sepolia instead of polygon * fix: proposers test assertion * feat: harden the CF tests assertions to distinct newly created safes from existing in the space * fix: add missing login step to the Multichain Create Safe Flow tests * feat: add a page function to use the old UI * chore: remove obsolete healthcheck Cypress tests; adjust comments * fix: harden the token tests (get token name + value separately from a cell instead of full row); compare both * fix: adjust swap test with a blocked recipient to the cow widget changes * refactor: replace browser permission e2e tests with unit / component tests * fix: recovery tests: bypass Spaces login by setting a classic UI session storage key * fix: bring back the Custom Recipient logic for swap tests * fix: flaky multichain network tests
154 lines
5.6 KiB
JavaScript
154 lines
5.6 KiB
JavaScript
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
|
|
const typeSend = data.type.send
|
|
const typeSpendingLimits = data.type.spendingLimits
|
|
const typeDeleteAllowance = data.type.deleteSpendingLimit
|
|
const typeSideActions = data.type.sideActions
|
|
const typeGeneral = data.type.general
|
|
|
|
describe('Tx history tests 1', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
beforeEach(() => {
|
|
cy.intercept(
|
|
'GET',
|
|
`**${constants.stagingCGWChains}${constants.networkKeys.sepolia}/${
|
|
constants.stagingCGWSafes
|
|
}${staticSafes.SEP_STATIC_SAFE_7.substring(4)}/transactions/history**`,
|
|
(req) => {
|
|
req.url = `https://safe-client.staging.5afe.dev/v1/chains/11155111/safes/0x5912f6616c84024cD1aff0D5b55bb36F5180fFdb/transactions/history?timezone=Europe/Berlin&trusted=false&cursor=limit=100&offset=1`
|
|
req.continue()
|
|
},
|
|
).as('allTransactions')
|
|
|
|
cy.visit(constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7)
|
|
cy.wait('@allTransactions')
|
|
})
|
|
|
|
// Added to prod
|
|
// Account creation
|
|
it('Verify summary for account creation', () => {
|
|
createTx.verifySummaryByName(
|
|
typeCreateAccount.title,
|
|
null,
|
|
[typeCreateAccount.actionsSummary, typeGeneral.statusOk],
|
|
typeCreateAccount.altTmage,
|
|
null,
|
|
)
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify exapanded details for account creation', () => {
|
|
createTx.clickOnTransactionItemByName(typeCreateAccount.title)
|
|
createTx.verifyExpandedDetails([
|
|
typeCreateAccount.creator.actionTitle,
|
|
typeCreateAccount.creator.address,
|
|
typeCreateAccount.factory.actionTitle,
|
|
typeCreateAccount.factory.name,
|
|
typeCreateAccount.factory.address,
|
|
typeCreateAccount.masterCopy.actionTitle,
|
|
typeCreateAccount.masterCopy.name,
|
|
typeCreateAccount.masterCopy.address,
|
|
])
|
|
})
|
|
|
|
it('Verify external links exist for account creation', () => {
|
|
createTx.clickOnTransactionItemByName(typeCreateAccount.title)
|
|
createTx.verifyNumberOfExternalLinks(4)
|
|
})
|
|
|
|
// Added to prod
|
|
// Token send
|
|
it('Verify expanded details for token send', () => {
|
|
createTx.scrollToBottom()
|
|
createTx.clickOnTransactionItemByName(typeSend.title, typeSend.summaryTxInfo)
|
|
createTx.verifyExpandedDetails([typeSend.sentTo])
|
|
createTx.verifyActionListExists([typeSideActions.created, typeSideActions.executedBy])
|
|
})
|
|
|
|
// Added to prod
|
|
// Spending limits
|
|
it('Verify summary for setting spend limits', () => {
|
|
// name, token, data, alt, altToken
|
|
createTx.verifySummaryByName(
|
|
typeSpendingLimits.title,
|
|
typeSpendingLimits.summaryTxInfo,
|
|
[typeGeneral.statusOk],
|
|
typeSpendingLimits.altImage,
|
|
)
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify exapanded details for initial spending limits setup', () => {
|
|
createTx.clickOnTransactionItemByName(typeSpendingLimits.title, typeSpendingLimits.summaryTxInfo)
|
|
createTx.verifyExpandedDetails(
|
|
[typeSpendingLimits.contractTitle, typeSpendingLimits.call_multiSend],
|
|
createTx.delegateCallWarning,
|
|
)
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify that 3 actions exist in initial spending limits setup', () => {
|
|
createTx.clickOnTransactionItemByName(typeSpendingLimits.title, typeSpendingLimits.summaryTxInfo)
|
|
createTx.verifyActions([
|
|
typeSpendingLimits.enableModule.title,
|
|
typeSpendingLimits.addDelegate.title,
|
|
typeSpendingLimits.setAllowance.title,
|
|
])
|
|
})
|
|
|
|
it('Verify that all 3 actions can be expanded and collapsed in initial spending limits setup', () => {
|
|
createTx.clickOnTransactionItemByName(typeSpendingLimits.title, typeSpendingLimits.summaryTxInfo)
|
|
createTx.expandAllActions([
|
|
typeSpendingLimits.enableModule.title,
|
|
typeSpendingLimits.addDelegate.title,
|
|
typeSpendingLimits.setAllowance.title,
|
|
])
|
|
createTx.collapseAllActions([
|
|
typeSpendingLimits.enableModule.moduleAddressTitle,
|
|
typeSpendingLimits.addDelegate.delegateAddressTitle,
|
|
typeSpendingLimits.setAllowance.delegateAddressTitle,
|
|
])
|
|
})
|
|
|
|
it('Verify that addDelegate action can be expanded and collapsed in spending limits', () => {
|
|
createTx.clickOnTransactionItemByName(typeSpendingLimits.title, typeSpendingLimits.summaryTxInfo)
|
|
createTx.clickOnExpandableAction(typeSpendingLimits.addDelegate.title)
|
|
createTx.verifyActions([typeSpendingLimits.addDelegate.delegateAddressTitle])
|
|
createTx.collapseAllActions([typeSpendingLimits.addDelegate.delegateAddressTitle])
|
|
})
|
|
|
|
// Spending limit deletion
|
|
it('Verify exapanded details for allowance deletion', () => {
|
|
createTx.clickOnTransactionItemByName(typeDeleteAllowance.title, typeDeleteAllowance.summaryTxInfo)
|
|
createTx.verifyExpandedDetails([
|
|
typeDeleteAllowance.description,
|
|
typeDeleteAllowance.beneficiary,
|
|
typeDeleteAllowance.beneficiaryAddress,
|
|
typeDeleteAllowance.token,
|
|
typeDeleteAllowance.tokenName,
|
|
])
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify advanced details displayed in exapanded details for allowance deletion', () => {
|
|
createTx.clickOnTransactionItemByName(typeDeleteAllowance.title, typeDeleteAllowance.summaryTxInfo)
|
|
createTx.expandAdvancedDetails([
|
|
typeDeleteAllowance.baseGas,
|
|
typeDeleteAllowance.operation,
|
|
typeDeleteAllowance.zero_call,
|
|
])
|
|
createTx.collapseAdvancedDetails([typeDeleteAllowance.baseGas])
|
|
})
|
|
})
|