Live data from Hacker News

Chrome 59 has cross-platform headless support

chromestatus.com

41–50 of 161 posts

Re: Chrome 59 has cross-platform headless support

#42
post #41

Have people found many issues that come up in Chrome but aren't found in PhantomJS? We used to use a headless browser but switched to PhantomJS and haven't had any real issues. (We should probably run under the real IE but jut haven't been bothered.)

I've run into some problems with some of the more ... creative jasmine tests I've done. Mostly, it's been around object mocks. I've found places where I can do things with Object.defineProperty() in Chrome that throw exceptions in PhantomJS :(

Re: Chrome 59 has cross-platform headless support

#43
post #6

Any way of scripting this to automate button clicks etc? I use PhantomJS for this now but found it to be incredibly unstable for complex pages.

There is an excellent library called nightmare (based on electron). If you need print-screens you can use xvfb or wait for this issue: https://github.com/segmentio/nightmare/issues/224

it should be noted that nightmare isn't safe for untrusted websites: https://github.com/segmentio/nightmare/issues/1060

Re: Chrome 59 has cross-platform headless support

#44
A lot of phantom js talk here makes me want to recommend http://ghostinspector.com

It's a phantom js (and other headless browser) web service. Using the site, you can quickly create different tests, scheduled tests, chained tests, keep screen shots, create videos of multi step tests, and have historical information of it all.

Can't say enough good things about the site.

Edit: also there's a great chrome extension that will record your mouse clicks and keyboard commands to make creating a test that much simpler.

Re: Chrome 59 has cross-platform headless support

#45
post #41

Have people found many issues that come up in Chrome but aren't found in PhantomJS? We used to use a headless browser but switched to PhantomJS and haven't had any real issues. (We should probably run under the real IE but jut haven't been bothered.)

Phantom does not support more recent JS syntax/tweaks. We have an app that is aimed at more recent browsers only so can use latest ES6 features, and had to move from Phantom to in-browser tests (the alternative would be to use babel for transpilation, but then we wouldn't be testing the code that is actually released to users)

Re: Chrome 59 has cross-platform headless support

#46
Oh my goodness I have been waiting for this day for a while - we ran into PhantomJS problems with keyboard/mouse eventing and the HTMLVideoElement for testing, this sounds like it should be the cure for our woes of having to hack around PhantomJS's deficiencies.

Re: Chrome 59 has cross-platform headless support

#47
post #3

Earlier quoted context omitted.

FWIW, you can do that now, using phantomjs (which is chrome) http://phantomjs.org/screen-capture.html

Also with https://wkhtmltopdf.org/ and http://pandoc.org/

And, if you need much higher fidelity and control of HTML/CSS -> PDF, there's the fantastic Prince library, http://princexml.com/ (nonfree)

(I've been using Prince for over a decade, rendering everything from prescription labels, packing slips, receipts, resumes, books, and more. It's great.)

Post reply on HN