Commit 95eafbab authored by eddie's avatar eddie Committed by GitHub

fix: wait for page to load in e2e tests (#5983)

* fix: make FoR announcement click optional in e2e tests

* fix: optional chaining

* fix: build error

* fix: wait for page to load
parent 639fe2f7
......@@ -5,8 +5,9 @@ const BONSAI_COLLECTION_ADDRESS = '0xec9c519d49856fd2f8133a0741b4dbe002ce211b'
describe('Testing nfts', () => {
beforeEach(() => {
cy.visit('/')
cy.get(getTestSelector('FiatOnrampAnnouncement-close')).first().click()
cy.visit('/').then(() => {
cy.get(getTestSelector('FiatOnrampAnnouncement-close')).first().click()
})
})
it('should load nft leaderboard', () => {
......
import { getTestSelector } from '../utils'
describe('Pool', () => {
beforeEach(() => cy.visit('/pool'))
beforeEach(() => {
cy.visit('/pool').then(() => {
cy.wait('@eth_blockNumber')
})
})
it('add liquidity links to /add/ETH', () => {
cy.get(getTestSelector('FiatOnrampAnnouncement-close')).first().click()
cy.get('#join-pool-button').click()
cy.url().should('contain', '/add/ETH')
cy.get('body')
.then((body) => {
if (body.find(getTestSelector('FiatOnrampAnnouncement-close')).length > 0) {
cy.get(getTestSelector('FiatOnrampAnnouncement-close')).click()
}
})
.then(() => {
cy.get('#join-pool-button')
.click()
.then(() => {
cy.url().should('contain', '/add/ETH')
})
})
})
})
......@@ -70,6 +70,7 @@ beforeEach(() => {
// These are stripped by cypress because chromeWebSecurity === false; this adds them back in.
cy.intercept(/infura.io/, (res) => {
res.headers['origin'] = 'http://localhost:3000'
res.alias = res.body.method
res.continue()
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment