nikku / karma-browserify

A fast Browserify integration for Karma that handles large projects with ease
MIT License
321 stars 50 forks source link

Switch from PhantomJS to Chrome launcher #208

Closed dmitriz closed 7 years ago

dmitriz commented 7 years ago

Reasons against Phantom:

Reasons for the Chrome launcher:

Need I say more? :)

bendrucker commented 7 years ago

If we're going to change the example I think it's worth going straight to recommending headless Chrome:

https://github.com/karma-runner/karma-chrome-launcher/pull/111

bendrucker commented 7 years ago

https://developers.google.com/web/updates/2017/04/headless-chrome

bendrucker commented 7 years ago

Perhaps it's a bit premature for this to be the documented example but a link would be a start. Otherwise this is a change from headless to windowed testing.

nikku commented 7 years ago

We'll do the switch as soon as headless Chrome is available on all platforms.

PhantomJS is dead, no big arguments required :wink:.

nikku commented 7 years ago

Closing this PR for now. We are happy to accept a headless Chrome PR, once it runs stable on all platforms (Mac, Windows, Linux).

dmitriz commented 7 years ago

@nikku

Why not a real browser that is already there and stable?

bendrucker commented 7 years ago

Well for one your example won't run in CI without xvfb

nikku commented 7 years ago

I'd say headless Chrome is a real browser :wink:.

In addition to Ben's comment headless browsers have the benefit of an improved, distraction free experience for the developer.

dmitriz commented 7 years ago

@bendrucker

Well for one your example won't run in CI without xvfb

Setting CI is a different story, with other issues to solve.

So indeed, more examples specifically targeted at CI integration would be great! But I would put them separately.

For instance, I am using the Firefox runner instead in my project here: https://github.com/dmitriz/min-karma/blob/master/.travis.yml

Which is also a real browser ;) And is perhaps even better for this and other reasons?


@nikku

I'd say headless Chrome is a real browser 😉.

I have no experience with it, but this does not sound good at all:

Caution: Headless mode is available on Mac and Linux in Chrome 59. Windows support is coming soon! To check what version of Chrome you have, open chrome://version.

So the questions to consider:

If all of these questions are positively answered, I will be happy to switch today :)

If not, then using the current working runners supporting real user's browsers might be a better fit for the people coming to try this example?

PhantomJS is dead, no big arguments required 😉.

In that case, perhaps, it would be better to replace it, at least temporarily?

ossdev07 commented 5 years ago

Ping @bendrucker @nikku

Since Chrome Headless is now available I have checked on my local machine by modifying the following files, to replace phantomjs with Chrome Headless:

  1. Package.json
  2. example/Package.json
  3. example/karma.conf.js
  4. test/integration/Karma.conf.js
  5. test/spec/pluginSpec.js

It will be a delight to see phantomjs removed from the package If you agree I can raise a new PR with the changes for Chrome Headless support.

nikku commented 5 years ago

Please create the PR!