title: How to anbale cookies for gitlab OAuth when running cypress test
body: <p>I have an angular app which has to authorize to gitlab and signIn the user with userName and pass in order to fetch some data/information from gitlab and display it in the UI.</p>
  <p>The first test case fails before the browser can redirect to the gitlab login-form (<a href="https://gitlab.com/users/sign_in" rel="nofollow noreferrer">https://gitlab.com/users/sign_in</a>):</p>
  <p>Spec Code:</p>
  <pre><code>it('Visits the home page', () =&gt; {
    cy.visit('/', {
      onBeforeLoad(win) {
          cy.stub(win.navigator, 'cookieEnabled', false).as('cookieEnabled');
      },
    })
  })
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>Checking your browser before accessing gitlab.com.
  <strong>Please enable Cookies and reload the page.</strong>
  This process is automatic. Your browser will redirect to your requested content shortly.
  Please allow up to 5 seconds…</p>
  </blockquote>
  <p>I have been searching and trying couple of other options/implementation based on cypress official doc etc., but still facing the same issue. Some kind of similar questions here in SO, but none for the hints/answers provide the fix.</p>
  <p>Also I am not 100% sure that it's really an issue related to cypress test implementation. Could it be an issue affecting <a href="https://forum.gitlab.com/t/cant-open-the-signin-page-it-keeps-showing-checking-your-browser-before-accessing-gitlab-com/45857" rel="nofollow noreferrer">gitlab itself</a>?</p>
  <p>Any ideas how to fix such issue?</p>
  <ul>
  <li>Cypress: 10.7.0</li>
  <li>Angular: 14.x</li>
  <li>Node: v16.13.1</li>
  </ul>