Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Fix tests #4586

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cypress/e2e/happypath/recovery_hp_1.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ describe('Recovery happy path tests 1', () => {
recovery.clickOnNextBtn()
tx.executeFlow_1()
recovery.verifyRecovererAdded([constants.SEPOLIA_OWNER_2_SHORT])

recovery.clearRecoverers()

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

recovery.getSetupRecoveryBtn()
})
})
10 changes: 10 additions & 0 deletions cypress/e2e/pages/main.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ export function acceptCookies(index = 0) {
})
}

export function acceptCookies2() {
cy.wait(2000)
cy.get('body').then(($body) => {
if ($body.find('button:contains(' + acceptSelection + ')').length > 0) {
cy.contains('button', acceptSelection).click()
cy.wait(500)
}
})
}

export function verifyOwnerConnected(prefix = 'sep:') {
cy.get(connectedOwnerBlock).should('contain', prefix)
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/pages/nfts.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const txDetailsSummary = '[data-testid="decoded-tx-summary"]'
const txAccordionDetails = '[data-testid="decoded-tx-details"]'
const accordionActionItem = '[data-testid="action-item"]'

const noneNFTSelected = '0 NFTs selected'
const noneNFTSelected = /0 NFT[s]? selected/
const sendNFTStr = 'Send NFTs'
const recipientAddressStr = 'Recipient address or ENS'
const selectedNFTStr = 'Selected NFTs'
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/pages/recovery.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export function getSetupRecoveryBtn() {

export function clickOnSetupRecoveryBtn() {
getSetupRecoveryBtn().click()
cy.get(setupRecoveryModalBtn).should('be.visible')
}

export function clickOnSetupRecoveryModalBtn() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/pages/sidebar.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export function checkSafeGroupBalance(index) {
.find(groupBalance)
.invoke('text')
.should('include', '$')
.and('match', /\d+\.\d{2}/)
.and('match', /\$?\s?\d+(\.\d{1,3})?/)
}

export function checkSafeGroupAddress(index, address) {
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/smoke/load_safe.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('[SMOKE] Load Safe tests', () => {

beforeEach(() => {
cy.visit(constants.loadNewSafeSepoliaUrl)
cy.wait(2000)
})

it('[SMOKE] Verify a network can be selected in the Safe', () => {
Expand Down
5 changes: 5 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import './commands'
import './safe-apps-commands'
import * as constants from './constants'
import * as ls from './localstorage_data'
import { acceptCookies2 } from '../e2e/pages/main.page'

// Alternatively you can use CommonJS syntax:
// require('./commands')

Expand Down Expand Up @@ -73,5 +75,8 @@ beforeEach(() => {
constants.localStorageKeys.SAFE_v2__SafeApps__infoModal,
ls.appPermissions(constants.safeTestAppurl).infoModalAccepted,
)
cy.wrap(window.localStorage).invoke('getItem', cookiesKey).should('equal', ls.cookies.acceptedCookies)
})
cy.visit(constants.setupUrl + 'sep:0xBb26E3717172d5000F87DeFd391994f789D80aEB')
acceptCookies2()
})
Loading