I am working in cypress. Steps to repro
I just visit the login page by cy.visit()-spinner is loading passed the credentials using type-spinner is still loading click on submit.-spinner is still loading its throwing error .. why because the login page XHR calls didnt get completed thats why still we can see spinner loading in top and i tried to click the submit button before it gets loaded,may be because of poor network-telling invalid credentials.
You check if the button is present and then click on the button.If
I believe you have to wait for the XHR request to get completed and validate the page load or perform other actions.
Here is a sample,
Here is a similar solution which I have previously given - Cypress:Is there any way to check invisibility of an element