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
155 lines
5.8 KiB
JavaScript
155 lines
5.8 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'
|
|
import * as batches from '../pages/batches.pages'
|
|
|
|
let staticSafes = []
|
|
|
|
const typeOnchainRejection = data.type.onchainRejection
|
|
const typeBatch = data.type.batchNativeTransfer
|
|
const typeAddOwner = data.type.addOwner
|
|
const typeChangeOwner = data.type.swapOwner
|
|
const typeRemoveOwner = data.type.removeOwner
|
|
const typeDisableOwner = data.type.disableModule
|
|
const typeChangeThreshold = data.type.changeThreshold
|
|
const typeSideActions = data.type.sideActions
|
|
const typeGeneral = data.type.general
|
|
const typeUntrustedToken = data.type.untrustedReceivedToken
|
|
|
|
describe('Tx history tests 2', () => {
|
|
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)
|
|
})
|
|
|
|
it('Verify number of transactions is correct', () => {
|
|
createTx.verifyNumberOfTransactions(20)
|
|
})
|
|
|
|
// Added to prod
|
|
// On-chain rejection
|
|
it('Verify expanded details for on-chain rejection', () => {
|
|
createTx.clickOnTransactionItemByName(typeOnchainRejection.title)
|
|
createTx.verifyExpandedDetails([typeOnchainRejection.description])
|
|
createTx.verifyActionListExists([
|
|
typeSideActions.created,
|
|
typeSideActions.signedOneOfTwo,
|
|
typeSideActions.signedTwoOfTwo,
|
|
typeSideActions.executedBy,
|
|
])
|
|
})
|
|
|
|
// Added to prod
|
|
// Batch transaction
|
|
it('Verify expanded details for batch', () => {
|
|
createTx.clickOnTransactionItemByName(typeBatch.title, typeBatch.summaryTxInfo)
|
|
createTx.verifyExpandedDetails([typeBatch.contractTitle], createTx.delegateCallWarning)
|
|
cy.get(batches.allActionsSection).should('exist')
|
|
batches.verifyCountOfActions(2)
|
|
})
|
|
|
|
// Added to prod
|
|
// Add owner
|
|
it('Verify summary for adding owner', () => {
|
|
createTx.verifySummaryByName(typeAddOwner.title, null, [typeGeneral.statusOk], typeAddOwner.altImage)
|
|
})
|
|
|
|
it('Verify expanded details for adding owner', () => {
|
|
createTx.clickOnTransactionItemByName(typeAddOwner.title)
|
|
createTx.verifyExpandedDetails(
|
|
[typeAddOwner.description, typeAddOwner.requiredConfirmationsTitle, typeAddOwner.ownerAddress],
|
|
createTx.policyChangeWarning,
|
|
)
|
|
})
|
|
|
|
// Added to prod
|
|
// Change owner
|
|
it('Verify summary for changing owner', () => {
|
|
createTx.verifySummaryByName(typeChangeOwner.title, null, [typeGeneral.statusOk], typeChangeOwner.altImage)
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify expanded details for changing owner', () => {
|
|
createTx.clickOnTransactionItemByName(typeChangeOwner.title)
|
|
createTx.verifyExpandedDetails([
|
|
typeChangeOwner.description,
|
|
typeChangeOwner.newOwner.actionTitile,
|
|
typeChangeOwner.newOwner.ownerAddress,
|
|
typeChangeOwner.oldOwner.actionTitile,
|
|
typeChangeOwner.oldOwner.ownerAddress,
|
|
])
|
|
})
|
|
|
|
// Added to prod
|
|
// Remove owner
|
|
it('Verify summary for removing owner', () => {
|
|
createTx.verifySummaryByName(typeRemoveOwner.title, null, [typeGeneral.statusOk], typeRemoveOwner.altImage)
|
|
})
|
|
|
|
it('Verify expanded details for removing owner', () => {
|
|
createTx.clickOnTransactionItemByName(typeRemoveOwner.title)
|
|
createTx.verifyExpandedDetails(
|
|
[typeRemoveOwner.description, typeRemoveOwner.requiredConfirmationsTitle, typeRemoveOwner.ownerAddress],
|
|
createTx.policyChangeWarning,
|
|
)
|
|
createTx.checkRequiredThreshold(1)
|
|
})
|
|
|
|
// Added to prod
|
|
// Disbale module
|
|
it('Verify summary for disable module', () => {
|
|
createTx.verifySummaryByName(typeDisableOwner.title, null, [typeGeneral.statusOk], typeDisableOwner.altImage)
|
|
})
|
|
|
|
it('Verify expanded details for disable module', () => {
|
|
createTx.clickOnTransactionItemByName(typeDisableOwner.title)
|
|
createTx.verifyExpandedDetails([typeDisableOwner.description, typeDisableOwner.address])
|
|
})
|
|
|
|
// Added to prod
|
|
// Change threshold
|
|
it('Verify summary for changing threshold', () => {
|
|
createTx.verifySummaryByName(typeChangeThreshold.title, null, [typeGeneral.statusOk], typeChangeThreshold.altImage)
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify expanded details for changing threshold', () => {
|
|
createTx.clickOnTransactionItemByName(typeChangeThreshold.title)
|
|
createTx.verifyExpandedDetails([typeChangeThreshold.requiredConfirmationsTitle], createTx.policyChangeWarning)
|
|
createTx.checkRequiredThreshold(2)
|
|
})
|
|
|
|
// Added to prod
|
|
it('Verify that sender address of untrusted token will not be copied until agreed in warning popup', () => {
|
|
createTx.clickOnTransactionItemByName(typeUntrustedToken.summaryTitle, typeUntrustedToken.summaryTxInfo)
|
|
createTx.verifyAddressNotCopied(0, typeUntrustedToken.senderAddress)
|
|
})
|
|
|
|
it('Verify tx hashes are grouped in advanced details', () => {
|
|
createTx.clickOnTransactionItemByName(typeDisableOwner.title)
|
|
createTx.verifyExpandedDetails([typeDisableOwner.description, typeDisableOwner.address])
|
|
createTx.clickOnAdvancedDetails()
|
|
createTx.clickOnHashes()
|
|
main.verifyElementByTextExists('Domain hash')
|
|
main.verifyElementByTextExists('Message hash')
|
|
main.verifyElementByTextExists('safeTxHash')
|
|
//TBD - add check for the hash format - createTx.checkHashesExist(3)?
|
|
})
|
|
})
|