title: cypress wait for redirection after login
body: <p>I am testing a web app with cypress.</p>
  <p>I sign in in my <code>beforeEach</code> function. Then, in my different tests, I begin with <code>cy.visit('mysite.com/url')</code>.</p>
  <p>My problem is that after sign in, the website redirects to a specific page of the website. This redirection happens after the <code>cy.visit</code> of my tests. Therefore, my tests run on the redirection page, they fail.</p>
  <p>The redirection seems to be not linked with any request I could wait for.</p>
  <p>I end up with <code>cy.wait(3000)</code> but it is not very satisfying. My tests failed sometimes because the redirection might take more than 3 seconds. I do not want to increase that time because it would take too long to run my tests.</p>
  <p>Is there a way to do something like:</p>
  <pre><code>while (!cy.url().eq('mysite.com/redirection-url')) {
    cy.wait(300);
  }
  </code></pre>