title: cypress scripts are failing in circleci with the error "Timed out waiting for the browser to connect. Retrying..."
body: <p>I am getting an error in circle ci "Timed out waiting for the browser to connect. Retrying..." while running a cypress script. So each script needs to visit a webpage. Apparently the first two script are connecting to the chrome browser but the third script onwards I am getting the error</p>
  
  <h2>Script that is failing</h2>
  
  <pre><code>describe('Visual regression for elements in homepage', () =&gt; {
              beforeEach(() =&gt; {
              cy.viewport("macbook-15")
              })
              it('Take the screenshots of the entire Homepage of Thequint beta env', () =&gt; {       
              cy.visit('/elections')
              cy.get('sa[href="/"][data-reactid="7"]').click()
              cy.get("#container").matchImageSnapshot('Homepage',{coverage: "fullpage"})
              })
              it('Take the screenshots of the entire Homepage of Thequint beta env', () =&gt; {   
              cy.visit(Cypress.env("thequintbeta"))
              cy.get("#container").matchImageSnapshot('Homepage',{coverage: "fullpage2"})
              })
              })
  </code></pre>
  
  <p>So the cypress should be able to connect to browser headlessly but it is not able to connect . <a href="https://i.stack.imgur.com/eC4Qv.png" rel="nofollow noreferrer">error screenshot</a></p>