title: puppeteer is closing the browser before running all the jest tests
body: <h3>Steps to reproduce</h3>
  
  <ul>
  <li><code>git clone https://github.com/anikethsaha/docsify</code></li>
  <li><code>git checkout</code>e2e-test-puppeteer`</li>
  <li><code>npm i</code></li>
  <li><code>npm run test:e2e</code></li>
  <li><strong>check the tests for <code>sideBar.spec.js</code></strong></li>
  </ul>
  
  <p>It will fail are running 31 tests out of 122 tests</p>
  
  <p><strong>Tell us about your environment:</strong></p>
  
  <ul>
  <li>Puppeteer version: ^2.0.0</li>
  <li>Platform / OS version: windows 10</li>
  <li>URLs (if applicable): <a href="https://travis-ci.org/docsifyjs/docsify/jobs/631003978?utm_medium=notification&amp;utm_source=github_status" rel="nofollow noreferrer">https://travis-ci.org/docsifyjs/docsify/jobs/631003978?utm_medium=notification&amp;utm_source=github_status</a></li>
  <li>Node.js version: v10.15.3</li>
  </ul>
  
  <p><strong>What steps will reproduce the problem?</strong>
  <code>npm run test:e2e</code></p>
  
  <p><em>Please include code that reproduces the issue.</em></p>
  
  <ol>
  <li><a href="https://github.com/anikethsaha/docsify/blob/e2e-test-puppeteer/e2e/__tests__/sideBar.spec.js" rel="nofollow noreferrer">https://github.com/anikethsaha/docsify/blob/e2e-test-puppeteer/e2e/<strong>tests</strong>/sideBar.spec.js</a>
  2.
  3.</li>
  </ol>
  
  <p><strong>What is the expected result?</strong>
  It should run all the test cases 122</p>
  
  <p><strong>What happens instead?</strong>
  But instead, its running only 31 tests and the browser is closing after that and then remaining 91 tests are not running</p>
  
  <p><strong>Context</strong></p>
  
  <p>I am using <a href="https://github.com/tapio/live-server" rel="nofollow noreferrer"><code>live-server</code></a> to run a server that will serve my files and it is being done in a custom jest environment.
  I have a <code>sideBar.spec.js</code> file which tests all the sidebar links by clicking them and then taking a snapshot using <a href="https://github.com/americanexpress/jest-image-snapshot#readme" rel="nofollow noreferrer"><code>jest-image-snapshot</code></a>.
  In this test, I am clicking every possible anchor links using the <code>page.click</code> method.
  it is not running the remaining 91 tests.
  <strong>I increased the timeout to 300 sec</strong> but still, it's stopping before that.</p>
  
  <p>I saw a weird behavior that is, the sidebar comes with a toggle button. So by default that sidebar is open. But before exiting of closing the browser, IDK but it's toggling the sidebar to close it and then closing the browser.
  <strong>check the tests for <code>sideBar.spec.js</code></strong>
  You can find the behavior of the test here <a href="https://travis-ci.org/docsifyjs/docsify/jobs/631003978?utm_medium=notification&amp;utm_source=github_status" rel="nofollow noreferrer">https://travis-ci.org/docsifyjs/docsify/jobs/631003978?utm_medium=notification&amp;utm_source=github_status</a></p>