Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add ability to connect to an already existing instance of Chrome #99

Closed
gidztech opened this issue Jul 30, 2018 · 2 comments

Comments

@gidztech
Copy link
Contributor

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:

  1. Look for a connect object config in the jest-puppeteer.config.js file, which has a reference to browserWSEndpoint.
  2. 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.

@gregberge
Copy link
Member

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.

@gregberge
Copy link
Member

Solved in #100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants