diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3cc28b08b4..9c43a1d901 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -175,3 +175,5 @@ jobs: browser: chrome record: false config: baseUrl=https://pr${{ github.event.number }}--safereact.review-safe.gnosisdev.com/app/ + env: + CYPRESS_ENV: ${{ env.REACT_APP_ENV}} diff --git a/cypress/integration/smoke/dashboard.spec.js b/cypress/integration/smoke/dashboard.spec.js index dd1646cd23..f82e1e4d96 100644 --- a/cypress/integration/smoke/dashboard.spec.js +++ b/cypress/integration/smoke/dashboard.spec.js @@ -9,7 +9,7 @@ describe('Dashboard', () => { it('should display the dashboard title', () => { cy.contains('main h1', 'Dashboard') - }) + }) it('should display the overview widget', () => { cy.contains('main p', SAFE).should('exist') @@ -20,9 +20,10 @@ describe('Dashboard', () => { }) it('should display the mobile banner', () => { - const appStoreLink = 'https://apps.apple.com/app/apple-store/id1515759131?pt=119497694&ct=Web%20App%20Dashboard&mt=8' + const appStoreLink = + 'https://apps.apple.com/app/apple-store/id1515759131?pt=119497694&ct=Web%20App%20Dashboard&mt=8' cy.get(`a[href="${appStoreLink}"]`).should('exist') - + cy.get('button[aria-label="Close mobile banner"]').click() cy.contains('button', 'Already use it!') cy.contains('button', 'Not interested').click() @@ -34,16 +35,10 @@ describe('Dashboard', () => { cy.contains('main', 'This Safe has no queued transactions').should('not.exist') // Queued txns - cy.contains( - `main a[href="/app/${SAFE}/transactions/queue"]`, - '0' + 'addOwnerWithThreshold' + '1/1' - ).should('exist') - - cy.contains( - `main a[href="/app/${SAFE}/transactions/queue"]`, - '2' + 'Send' + '-0.001 USDC' + '1/1' - ).should('exist') - + cy.contains(`main a[href="/app/${SAFE}/transactions/queue"]`, '0' + 'addOwnerWithThreshold' + '1/1').should('exist') + + cy.contains(`main a[href="/app/${SAFE}/transactions/queue"]`, '2' + 'Send' + '-0.001 USDC' + '1/1').should('exist') + cy.contains(`a[href="/app/${SAFE}/transactions/queue"]`, 'View All') }) @@ -52,13 +47,11 @@ describe('Dashboard', () => { // Tx Builder app cy.contains('main p', 'Use Transaction Builder') - cy.get(`a[href="/app/${SAFE}/apps?appUrl=https://safe-apps.dev.gnosisdev.com/tx-builder"]`) - .should('exist') + cy.get(`a[href*='/tx-builder']`).should('exist') // WalletConnect app cy.contains('main p', 'Use WalletConnect') - cy.get(`a[href="/app/${SAFE}/apps?appUrl=https://safe-apps.dev.gnosisdev.com/wallet-connect"]`) - .should('exist') + cy.get(`a[href*='/wallet-connect']`).should('exist') // Featured apps have a Safe-specific link cy.get(`main a[href^="/app/${SAFE}/apps?appUrl=http"]`).should('have.length', 2) diff --git a/scripts/cypress.js b/scripts/cypress.js index 7be8b1f0a0..56ee315307 100644 --- a/scripts/cypress.js +++ b/scripts/cypress.js @@ -8,6 +8,7 @@ const DEPLOYMENTS = { } const command = `cypress ${process.argv[2]}` -const env = process.argv?.[3] +// To accept 'prod' or 'production' as an argument +let env = process.argv?.[3] === 'production' ? 'prod' : process.argv?.[3] -exec(env ? `${command} --config baseUrl=${DEPLOYMENTS[env]}` : command) +exec(env ? `${command} --config baseUrl=${DEPLOYMENTS[env]} --env CYPRESS_ENV=${env}` : command)