question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

puppeteer is closing the browser before running all the jest tests

See original GitHub issue

Steps to reproduce

  • git clone https://github.com/anikethsaha/docsify
  • git checkoute2e-test-puppeteer`
  • npm i
  • npm run test:e2e
  • check the tests for sideBar.spec.js

It will fail are running 31 tests out of 122 tests

Tell us about your environment:

What steps will reproduce the problem? npm run test:e2e

Please include code that reproduces the issue.

  1. https://github.com/anikethsaha/docsify/blob/e2e-test-puppeteer/e2e/__tests__/sideBar.spec.js

What is the expected result? It should run all the test cases 122

What happens instead? But instead, its running only 31 tests and the browser is closing after that and then remaining 91 tests are not running

Context

I am using live-server to run a server that will serve my files and it is being done in a custom jest environment. I have a sideBar.spec.js file which tests all the sidebar links by clicking them and then taking a snapshot using jest-image-snapshot. In this test, I am clicking every possible anchor links using the page.click method. it is not running the remaining 91 tests. I increased the timeout to 300 sec but still, it’s stopping before that.

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. check the tests for sideBar.spec.js You can find the behavior of the test here https://travis-ci.org/docsifyjs/docsify/jobs/631003978?utm_medium=notification&utm_source=github_status

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
trusktrcommented, Jul 5, 2020

No reply here from anyone at Google in half a year, which isn’t a good sign. This is normal for personal projects by individuals, but not for projects backed by big companies.

1reaction
Kradirhamikcommented, Jan 14, 2020

Unfortunately, I have not.

Is puppeteer being actively maintained by someone from Google Chrome? Seems like the updates and fixes have slowed down.

Read more comments on GitHub >

github_iconTop Results From Across the Web

puppeteer is closing the browser before running all the jest tests
In this test, I am clicking every possible anchor links using the page.click method. it is not running the remaining 91 tests. I...
Read more >
Using with puppeteer - Jest
Jest Puppeteer provides all required configuration to run your tests using Puppeteer. First, install jest-puppeteer. npm; Yarn. npm ...
Read more >
How To Write End-to-End Tests in Node.js Using Puppeteer ...
This is to ensure that the dialog event accepts the dialog before jest-puppeteer closes the page. The page is closed once there are...
Read more >
Using with puppeteer - Jest - w3resource
Jest Puppeteer will provide all required configuration to run your tests using Puppeteer. 1. First you need to install jest-puppeteer
Read more >
End-to-End testing with Puppeteer and Jest - Medium
How to Integrate Puppeteer with Jest; Testing forms; Testing ... before our tests run and which will be accessible to all our test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found