title: Cypress foolishly waits for the new page to load after the button has been clicked and even the new page's core actionable resource is ready
body: <p>I know this has been asked on SO and Github already, but none of the solutions are suitable for the scenario I have because, I am looking for successful SSO login by doing keypress/button-click actions on Google Auth and Identity Auth SSO options.</p>
  <p>In these options the final Login page URL is too long and unknown(in it's entirety) so not fully and reliably verifiable by Cypress URL match methods, so I want Cypress to just click the button and wait for the next page to load until certain core-actionable element is found/present on the new page and then not stupidly wait any further and type required credentials(username) on that long-URL login page and press enter to go to password page and fill the password and press enter and let the rest of the steps continue &quot;naturally&quot;.</p>
  <p>Below is the code that I have and as I mentioned in the comment in the code, after the button click, it waits for new page to fully load, even after the new page already has actionable item, and increasing the <code>defaultCommandTimeout</code> to <code>20000</code> also doesn't help:</p>
  <pre><code>describe('Test if &lt;ProjectName&gt; Search page is reachable', () =&gt; {
      it('Visits the &lt;ProjectName&gt; Search page', () =&gt; {
          cy.visit('/')
          cy.window().then(w =&gt; w.beforeReload = true)
           // Sign in with Google button, cypress timeouts after this button has been clicked, 
           // even if the new page has actionable item(&quot;identifier&quot; field) ready for use
          cy.get('button.&lt;sso-class&gt;').first().click()
          cy.window().should('not.have.prop', 'beforeReload')
          cy.get('input[name=identifier]').type('&lt;GoogleUsername&gt;').type('{enter}')
          cy.get('input[name=password]', {timeout: 4000}).type('&lt;GooglePassword&gt;').type('{enter}')
          cy.url().should('eq', '/search')
      })
  })
  </code></pre>
  <p>And after waiting, times out throwing the below error:</p>
  <pre><code>(page load)
  --waiting for new page to load--
  CypressError
  Cypress command timeout of 20000ms exceeded.
  
  Because this error occurred during a after all hook we are skipping all of the remaining tests.
  </code></pre>
  <p>As you can see in the code, I have already tried one fix mentioned in this <a href="https://github.com/cypress-io/cypress/issues/1805" rel="nofollow noreferrer">GH(Github) post</a> and the other fix is not suitable, as I said, I don't know the final Login page URL of Google/Identity server, and also it's too long with too many querystrings which makes it unreliable for Login page-load checks...</p>
  <p>Anyone has any better suggestions ?</p>