I'm writing a cypress test that tests a map application. When I click on a specific button, I want to wait for all resources to load on the map.
Currently, the button is making a request to a url: someurl.com/myData/** Where the ** represents dynamic data.
This is what I currently have:
describe('Map Data', () => {
beforeEach(()=> {
cy.intercept('GET', 'http://someurl.com/myData/**').as('loadData')
cy.visit('/')
})
it('checks for all resources to be loaded', () => {
cy.get('#loadButton').click()
cy.wait('@loadData')
})
})
This waits until the first resource was loaded. However, there are many resources from the url and I was wondering if it's possible to wait for at least a certain number of them to load?