-
Notifications
You must be signed in to change notification settings - Fork 57
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
Support Puppeteer for Firefox #198
Comments
Mochify is structured relatively modular now. I’m developing towards the goal of having every feature being a thing that is added to the Browserify pipeline. Eventually projects like min-wd and consolify should be plugins that can be optionally installed. The Firefox integration could also be a plugin. I’m dreaming of creating an org for these projects. In reality, I don’t have the time to realize this. I’m glad to assist and review if you want to help :) |
So puppeteer/puppeteer#3652 got closed and it seems that it should now be possible to run tests against Firefox too (I also think ™️ I just got a test passing on my machine using Firefox following the instructions here: https://github.com/puppeteer/puppeteer/blob/v5.2.1/docs/api.md#puppeteerlaunchoptions). The nice thing is that this can be achieved by passing a Parts that worry me about it though are:
|
I looked into this a little further. Upgrading to Puppeteer 5 seems to work with two caveats:
As for running the tests in Firefox, this seems to work mostly, but sometimes Firefox will log unexpected things in addition, sometimes it times out and other times tests fail for reasons I don't understand. It also seems to be pretty slow. I'll look into it further when I find the time to do so. |
Thank you for investigating. I'm currently too busy with other things. It would be great to support Firefox. But if it's too brittle, it can wait, I think. I'm not too keen having issues in Mochify that arn't related to the project itself. My thoughts on your points:
|
I totally share that sentiment. I can keep an eye on how the Firefox integration in Puppeteer evolves and whenever it seems to be mature enough, we can pull it into Mochify. It'd be especially important that you can install both Chromium and Firefox side by side without jumping through too many hoops (right now it's a lot of hoops still).
|
I just looked into this again and it seems the issue we are seeing with Firefox <-> Puppeteer has not been resolved yet. Looking for alternatives I tried swapping out Puppeteer with Playwright and this seems to bring us much closer to supporting Firefox. The APIs of the two libraries are mostly identical (18d9123#diff-8aa031d8dc1e01f5f5af954cda92a1e567897406df81a442fb1a494cdb9f3648) and most tests already pass when using Firefox (albeit it's much slower than chromium). There are some Chromium specific things (e.g. Since you've been talking about a revamped Mochify @mantoni recently I am not sure however if the effort is worth it (especially considering this will likely bring some breaking changes for consumers in some cases). I'd be happy to spend some time looking into this further in the next few weeks, but I also don't have to. |
Puppeteer now has experimental support for Firefox which would enable Mochify to run tests in Node, Chrome and Firefox (which is pretty great).
Looking at the table of already supported APIs everything that Mochify uses should already be implemented and theoretically the modules could just be hotswapped depending on which browser is targeted.
One big question I don't know an answer for: does this mean Mochify would include both
puppeteer
as well aspuppeteer-firefox
as a dependency (which would result in an even heftier install, probably too hefty) or shouldpuppeteer-firefox
live as anoptionalDependency
orpeerDependency
, or as something completely different? (Caveat: I don't know ifpuppeteer-firefox
is even supposed to stay a dedicated package once it is mature, although I would be surprised if it wouldn't).NB: As of March 2019
puppeteer-firefox
has a bug where pages run in the context offile://
will not triggerconsole
events, thus preventing usage with Mochify right now.The text was updated successfully, but these errors were encountered: