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

Switch from PhantomJS to Chrome launcher #208

Closed
wants to merge 1 commit into from

Conversation

dmitriz
Copy link

@dmitriz dmitriz commented May 11, 2017

Reasons against Phantom:

  • Most serious: Tests passing in Phantom does not guarantee them passing in real browsers
  • PhantomJS downloads its huge file into the node_module directory every time
  • The installation breaks down on slow connections, and is not resumable without manual fixing
  • Both npm and yarn do not clearly report the reason for delay is the PhantomJS installation, the user is left wondering what is going on
  • The overhead is painful and inappropriate for quickly trying example like here
  • The project does not seem to be as actively maintained with almost 2000K open issues
  • There are more modern alternatives such as NightmareJS

Reasons for the Chrome launcher:

  • No massive download needed, the locally installed browser is used
  • Installation is quick and painless, no broken pipes
  • 100% reliable: your tests run exactly in the same browser as used by your users

Need I say more? :)

@bendrucker
Copy link
Collaborator

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

karma-runner/karma-chrome-launcher#111

@bendrucker
Copy link
Collaborator

@bendrucker
Copy link
Collaborator

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
Copy link
Owner

nikku commented May 11, 2017

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

PhantomJS is dead, no big arguments required 😉.

@nikku
Copy link
Owner

nikku commented May 11, 2017

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

@nikku nikku closed this May 11, 2017
@dmitriz
Copy link
Author

dmitriz commented May 11, 2017

@nikku

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

@bendrucker
Copy link
Collaborator

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

@nikku
Copy link
Owner

nikku commented May 11, 2017

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

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

@dmitriz
Copy link
Author

dmitriz commented May 12, 2017

@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:

  • Can I use it locally with my older OSX?
  • Can I do with without any additional installation or downloads?
  • Does it reliably mirror the complete modern browser functionality? In other words, is it guaranteed that all tests passed there will also pass in real users browsers, and vice versa.

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
Copy link
Contributor

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
Copy link
Owner

nikku commented Jun 14, 2019

Please create the PR!

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

Successfully merging this pull request may close these issues.

4 participants