-
Notifications
You must be signed in to change notification settings - Fork 289
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
use puppeteer-core replace pupp #153
Comments
Hello @superwf, I think it is a good idea to let the choice to the user. I have to check if it is possible to modify the code in order to accept both. |
This is a really good idea, and will speed up tests on CI environments that obtain the browser by other methods (Docker container in our case). I think it's important to mention in the documentation for this config option, that Puppeteer is not guatanteed to work with any particular version of Chrome or Chromium other than the one shipped with it. They should use this option at own risk. See https://github.com/GoogleChrome/puppeteer/#q-why-doesnt-puppeteer-vxxx-work-with-chromium-vyyy |
Yes you are right, we have to mention it. |
Hello, Any news on this one? A suggestion would be to have something like: const puppeteer = require('puppeteer')
module.exports = {
puppeteerInstance: puppeteer
} const puppeteer = require('puppeteer-core')
module.exports = {
puppeteerInstance: puppeteer
} Then in the config.puppeteerInstance.connect({
// ...
}) |
@WilliamDASILVA not for now, it is complicated to have this kind of behaviour with npm package system. |
@neoziro So, no plans to support this? |
In fact, we should support it. It is the same issue as #171 for me. We have to remove peer dependencies and investigate which module is available during runtime. So to answer, yes we plan to support it. |
One issue I see with switching to puppeteer-core is that the with this package, the environment variables I just completed a spike whereby I have chrome running in a container and have my local puppeteer (i.e., the puppeteer in my project) connecting to it and executing tests. The main, required dependency will be getting the websocket URL from chrome in the running container PRIOR to the Jest tests executing (not difficult, but needs to be done) so you can do something like:
But, clearly, without the hardcoded URL. But if I'm being honest, after doing this spike, I'm not really seeing any huge advantage jest-puppeteer could provide in this scenario. Do please feel free to chime in if you disagree or see advantages that I've missed. |
@icfantv The method you describe is what I use with jest-puppeteer-docker. It fetches a container from Docker hub which has the Chromium version linked to your local Puppeteer version dependency, and then I connect using the WebSocket. In order to prevent downloading Chromium when installing the Puppeteer dependency in CI, it just requires user to set It looks like there's an open PR for supporting FireFox by dynamically importing the module based on config. If my understanding is correct, none of the Puppeteer dependencies are needed in The above also means the environmental variables should work fine for those who use the |
@gidztech yep, I saw/tried your solution last week and it was a bit too heavy for our use case. Since our Jenkins drones are not exposed to the Internet, we just need a way to host binaries and having Puppeteer connecting to chrome running in a container whose image we can store in Artifactory is a perfect solution for us. For proper credit, I got that solution working from this project. |
You can also use npm alias to workaround it as we did it for WordPress reusable scripts: However, the ideal approach would be to make it work with |
🚀 Feature Proposal
Add option to use puppeteer-core for replacement of puppeteer.
Motivation
In most cases users already have chrome installed in there system, and download puppeteer will also download a large Chromium bin file, each time the downloading cost some time.
Use puppeteer-core is lighter choice.
Example
https://github.com/superwf/jest-with-puppeteer-core
This exmple use module-alias to make puppeteer-core as an alias to puppeteer.
The text was updated successfully, but these errors were encountered: