Files
dshandGitHub 5ea5a9bf7a chore: tx-builder E2E fix (#8495)
* fix: e2e tests for tx-builder (#8492)

* fix: e2e tests for tx-builder

* chore: address AI comments

* fix: post migration
2026-08-11 14:13:43 +02:00

44 lines
2.1 KiB
JavaScript

import * as constants from '../../support/constants.js'
import * as safeapps from '../pages/safeapps.pages.js'
import * as main from '../pages/main.page.js'
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
import { txAccordionDetails } from '../pages/create_tx.pages'
import * as ls from '../../support/localstorage_data.js'
let staticSafes = []
let iframeSelector
describe('Transaction Builder 3 tests', { defaultCommandTimeout: 20000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
beforeEach(() => {
const appUrl = constants.TX_Builder_url
iframeSelector = safeapps.getSafeAppIframeSelector(appUrl)
const visitUrl = `/apps/open?safe=${staticSafes.SEP_STATIC_SAFE_43}&appUrl=${encodeURIComponent(appUrl)}`
// tx-builder keeps its form disabled until the address book permission prompt is answered:
// pre-grant it before the visit
main.addToLocalStorage(constants.SAFE_PERMISSIONS_KEY, ls.safeAppSafePermissions(appUrl))
cy.visit(visitUrl)
safeapps.verifySafeAppIframeVisible(appUrl)
})
it('Verify that no error for the COWSwap fallbackhandler on confirm tx screen', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.enterAddressStr).type(staticSafes.SEP_STATIC_SAFE_43)
getBody().findByRole('button', { name: safeapps.useImplementationABI }).click()
getBody().find(safeapps.contractMethodSelector).click()
getBody().find(safeapps.contractMethodIndex).parent().click()
getBody().findByRole('option', { name: safeapps.cowFallback }).click()
getBody().find(safeapps.handlerInput).type(safeapps.cowFallbackHandler)
getBody().findByText(safeapps.addTransactionStr).click()
getBody().findByText(safeapps.createBatchStr).click()
getBody().findByText(safeapps.sendBatchStr).click()
})
safeapps.clickOnAdvancedDetails()
//Commented for now because decoder service doesn't index contracts if the "to" is the safe
//main.verifyElementsIsVisible([`${txAccordionDetails} ${safeapps.cowFallBackHandlerTitle}`])
safeapps.verifyUntrustedHandllerWarningDoesNotExist()
})
})