When I run Cypress, the page of my application shows the loading spinner spinning indefinitely. While it is spinning the other components of the page are not displayed, so I need this spinner to disappear.
What I did
it('should wait spinner dissapears', function () {
cy.waitUntil(function () {
return cy.get('im-loader.hydrated')
.shadow()
.find('im-spinner.hydrated')
.should('not.be.visible');
})
})
but Cypress times out retrying im-spinner.hydrated
not to be visible
when I replace .should(not.be.visible)
to should('not.exist')
Cypress also times out: Expected <im-spinner.hydrated> not to exist in the DOM, but it was continuously found.
This is the HTML code
Is there any way to wait for the spinner to disappear and load correctly the page?
This is the Test runner log
cy.visit('myURL/customer/companies')
``` cy.wait('@getCompanies') ``` The test passed but the spinner is still spinning