Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca committed Sep 19, 2023
1 parent c105c23 commit 1e31579
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions cypress/e2e/pages/batches.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const tokenAddressInput = 'input[name="tokenAddress"]'
const listBox = 'ul[role="listbox"]'
const amountInput = '[name="amount"]'
const nonceInput = 'input[name="nonce"]'
const executeOptionsContainer = 'div[role="radiogroup"]'

export function addToBatch(EOA, currentNonce, amount, verify = false) {
fillTransactionData(EOA, amount)
Expand All @@ -49,8 +50,12 @@ function setNonceAndProceed(currentNonce) {
}

function executeTransaction() {
cy.contains(yesExecuteString, { timeout: 4000 }).click()
cy.contains(addToBatchBtn).should('not.exist')
cy.waitForSelector(() => {
return cy.get(executeOptionsContainer).then(() => {
cy.contains(yesExecuteString, { timeout: 4000 }).click()
cy.contains(addToBatchBtn).should('not.exist')
})
})
}

function addToBatchButton() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/apps_list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as safeapps from '../pages/safeapps.pages'

const myCustomAppTitle = /my custom app/i
const myCustomAppDescrAdded = /my custom app description/i
const myCustomAppTitle = 'Cypress Test App'
const myCustomAppDescrAdded = 'Cypress Test App Description'

describe('The Safe Apps list', () => {
before(() => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/browser_permissions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('The Browser permissions system', () => {
describe('When the safe app requires permissions', () => {
beforeEach(() => {
cy.fixture('safe-app').then((html) => {
cy.intercept('GET', `${constants.appUrlProd}/*`, html)
cy.intercept('GET', `${constants.testAppUrl}/*`, html)
cy.intercept('GET', `*/manifest.json`, {
name: constants.testAppData.name,
description: constants.testAppData.descr,
Expand All @@ -17,7 +17,7 @@ describe('The Browser permissions system', () => {
})

it('should show a permissions slide to the user', () => {
cy.visitSafeApp(`${constants.appUrlProd}/app`)
cy.visitSafeApp(`${constants.testAppUrl}/app`)
safeapps.verifyCameraCheckBoxExists()
safeapps.verifyMicrofoneCheckBoxExists()
})
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/tx_modal.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const testAppDescr = 'Cypress Test App Description'
describe('The transaction modal', () => {
beforeEach(() => {
cy.fixture('safe-app').then((html) => {
cy.intercept('GET', `${constants.appUrlProd}/*`, html)
cy.intercept('GET', `${constants.testAppUrl}/*`, html)
cy.intercept('GET', `*/manifest.json`, {
name: testAppName,
description: testAppDescr,
Expand All @@ -18,7 +18,7 @@ describe('The transaction modal', () => {

describe('When sending a transaction from an app', () => {
it('should show the transaction popup', { defaultCommandTimeout: 12000 }, () => {
cy.visitSafeApp(`${constants.appUrlProd}/dummy`)
cy.visitSafeApp(`${constants.testAppUrl}/dummy`)

main.acceptCookies()
cy.findByRole('dialog').within(() => {
Expand Down

0 comments on commit 1e31579

Please sign in to comment.