Skip to content

Commit

Permalink
tests: handle deletion of multiple recoverers (#3545)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca authored Apr 10, 2024
1 parent 7c6a7f7 commit 9e14398
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
12 changes: 9 additions & 3 deletions cypress/e2e/happypath/recovery_hp_1.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ describe('Recovery happy path tests 1', () => {
// Check that recovery can be setup and removed
it('Recovery setup happy path 1', () => {
owner.waitForConnectionStatus()
cy.reload()
recovery.clearRecoverers()
recovery.clickOnSetupRecoveryBtn()
recovery.clickOnSetupRecoveryModalBtn()
recovery.clickOnNextBtn()
Expand All @@ -22,9 +24,13 @@ describe('Recovery happy path tests 1', () => {
recovery.clickOnNextBtn()
tx.executeFlow_1()
recovery.verifyRecovererAdded([constants.SEPOLIA_OWNER_2_SHORT])
recovery.removeRecoverer(0, constants.SEPOLIA_OWNER_2)
recovery.clickOnNextBtn()
tx.executeFlow_1()

recovery.clearRecoverers()

// recovery.removeRecoverer(0, constants.SEPOLIA_OWNER_2)
// recovery.clickOnNextBtn()
// tx.executeFlow_1()

recovery.getSetupRecoveryBtn()
})
})
16 changes: 12 additions & 4 deletions cypress/e2e/pages/recovery.pages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as constants from '../../support/constants'
import * as main from './main.page'
import * as safe from '../pages/load_safe.pages'
import * as tx from '../pages/transactions.page'
import { tableContainer } from '../pages/address_book.page'
import { txDate } from '../pages/create_tx.pages'

Expand Down Expand Up @@ -46,7 +47,7 @@ export function setRecoveryDelay(option) {
}

export function getSetupRecoveryBtn() {
return cy.get(setupRecoveryBtn).should('be.visible')
return cy.get(setupRecoveryBtn)
}

export function clickOnSetupRecoveryBtn() {
Expand Down Expand Up @@ -83,9 +84,16 @@ export function verifyRecovererAdded(address) {
main.verifyValuesExist(tableContainer, address)
}

export function removeRecoverer(index, recoverer) {
cy.get(removeRecovererBtn).eq(index).click()
cy.get(removeRecovererSection).contains(recoverer)
export function clearRecoverers() {
cy.get('body').then(($body) => {
if ($body.find(removeRecovererBtn).length) {
cy.get(removeRecovererBtn).each(($btn) => {
cy.wrap($btn).click()
clickOnNextBtn()
tx.executeFlow_1()
})
}
})
}

export function clickOnStartRecoveryBtn() {
Expand Down

0 comments on commit 9e14398

Please sign in to comment.