Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

How about using PhantomJS instead of Chrome? #53

Closed
adityamenon opened this issue May 21, 2013 · 3 comments
Closed

How about using PhantomJS instead of Chrome? #53

adityamenon opened this issue May 21, 2013 · 3 comments

Comments

@adityamenon
Copy link

I develop on Windows and test on a Vagrant virtual machine. I tried installing Chrome with xvfb but ran into various issues (at least one seemingly intractable).

I suggest it would be very flexible for everyone (people with just a console available, as well as those that have a full GUI) if Karma was configured to use PhantomJS by default instead, as it is super comfortable to use in the command line, and quite trivial to install.

@IgorMinar
Copy link
Contributor

What's the problem with using Chrome in your setup? If it's available, Karma should be able to use it.

PhantomJS is not a browser. It is not compatible with Firefox or Chrome. Your users do not use phantomjs to run your app. So it makes no sense to run tests in PhantomJS.

Also debugging test failures in PhantomJS is a PITA.

@IgorMinar
Copy link
Contributor

We should really just address the issue of using chrome or other modern browser in your environment. Karma can launch Chrome on windows, so I don't quite understand what's the problem.

@adityamenon
Copy link
Author

Sorry to have created an issue of no real consequence. After a little fiddling to resolve the ENOENT error in Windows (also, I should have just RTFM), Karma works great from cmd. I'm not really particular that it should work in Vagrant alone, and maybe it is foolhardy to try now when Chrome doesn't know how to work without GTK & X11 initialized. Hopefully in the future this will be frictionless...

The issue with using Chrome is, I realized, myself. There is a guide to run Chrome with xvfb, but I could not replicate the results. I just got varying errors with issue I tried to fix (yesterday it was missing fonts today it is something else) and keep getting output like:

[0521/213125:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[0521/213125:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
Xlib:  extension "RANDR" missing on display ":99".
[2207:2234:0521/213125:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[2207:2230:0521/213125:ERROR:object_proxy.cc(624)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.Mtpd'
: no such name
[2207:2230:0521/213125:ERROR:object_proxy.cc(624)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.Mtpd'
: no such name
[2207:2207:0521/213126:ERROR:object_proxy.cc(529)] Failed to call method: org.chromium.Mtpd.EnumerateStorages: object_path= /org/chromium/Mtpd: org.freedesktop.DBus.Error.
ServiceUnknown: The name org.chromium.Mtpd was not provided by any .service files
[0521/213126:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[0521/213126:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[0521/213126:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[0521/213126:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[0521/213126:ERROR:nss_util.cc(90)] Failed to create /home/vagrant/.pki/nssdb directory.
[2207:2207:0521/213126:ERROR:extension_prefs.cc(1520)] Bad or missing pref 'version' for extension 'aohghmighlieiainnegkcijnfilokake'
[2207:2207:0521/213126:ERROR:extension_prefs.cc(1520)] Bad or missing pref 'version' for extension 'apdfllckaahabafndbhieahigkjlhalf'
[2207:2207:0521/213126:ERROR:extension_prefs.cc(1520)] Bad or missing pref 'version' for extension 'coobgpohoikkiipiblmjeljniedjpjpf'
[2207:2207:0521/213126:ERROR:extension_prefs.cc(1520)] Bad or missing pref 'version' for extension 'blpcfgokakmgnkcojhhkbfbldkacnbeo'
[2207:2207:0521/213126:ERROR:extension_prefs.cc(1520)] Bad or missing pref 'version' for extension 'pjkljhegncpnkpknbcohdijeoejaedia'

I don't know if this is just permissions but trying to run as root failed because Chrome would 'refuse' to do so...

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

No branches or pull requests

2 participants