You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, jest-puppeteer launches an instance of Chrome via the puppeteer.launch function. It then holds onto that instance by writing the web socket to disk, and connects to it via the puppeteer.connect function for subsequent tests.
It would be beneficial to be able to tell jest-puppeteer to connect to an already existing instance of Chrome from the start. For example, you may want to connect to a cloud based instance rather than a local copy. The changes involved here are quite small:
Look for a connect object config in the jest-puppeteer.config.js file, which has a reference to browserWSEndpoint.
Allow the config to be exported as a function as well as static config (as per now), so that the web socket can be retrieved at runtime.
I'm going to submit a PR with those changes in the meantime for review. I'm happy to discuss further.
In addition, I'm writing a plugin that allows you to launch an instance of Chrome running in a Docker container, and then run Jest tests against it via jest-puppeteer (provided that the connect feature gets added). See: jest-puppeteer-docker. The main goal there is to support Visual Regression Testing.
The text was updated successfully, but these errors were encountered:
Hello @gidztech, I think it is a good idea to add this feature and to be able to connect to a Puppeteer running in Docker or in the cloud. I would be happy to work with you on a PR.
About visual regression testing, this is the way I want to take. I created Argos two years ago, so I know this problematic very well. We should talk about it and work together if you are OK, feel free to contact me on my Twitter.
Currently,
jest-puppeteer
launches an instance of Chrome via the puppeteer.launch function. It then holds onto that instance by writing the web socket to disk, and connects to it via the puppeteer.connect function for subsequent tests.It would be beneficial to be able to tell
jest-puppeteer
to connect to an already existing instance of Chrome from the start. For example, you may want to connect to a cloud based instance rather than a local copy. The changes involved here are quite small:connect
object config in thejest-puppeteer.config.js
file, which has a reference tobrowserWSEndpoint
.I'm going to submit a PR with those changes in the meantime for review. I'm happy to discuss further.
In addition, I'm writing a plugin that allows you to launch an instance of Chrome running in a Docker container, and then run Jest tests against it via
jest-puppeteer
(provided that theconnect
feature gets added). See: jest-puppeteer-docker. The main goal there is to support Visual Regression Testing.The text was updated successfully, but these errors were encountered: