Here is my code to perform login and then visit users.
cy.visit('http://localhost:3000/')
cy.get("#username").clear().invoke('val', "admin")
cy.get("#password").clear().invoke('val',"password")
cy.get("button[type='submit']").click()
//cy.wait(500)-> If I un-comment this line, it works fine
cy.visit('/users/new')
Now it happens so fast that if I don't put wait of 500ms in between, it gives me an error of "failed xhr request". See the screenshot below.
Can anyone suggest me how to wait dynamically until the request is resolved?
