Nightmare - A high level wrapper for Phantomjs

added by JavaScript Kicks
10/7/2014 12:20:41 PM

856 Views

Every method is a simple English command: goto, refresh, click, type... you can check out Nightmare's full API here. Nightmare lets you simplify deeply nested callbacks into a few sequential statements.


6 comments

Paul Wheeler
10/7/2014 12:31:18 PM
I love the fluent syntax in the Nightmare examples, I can't wait to try this out on some of our javascript projects!

Robert Greyling
10/7/2014 12:34:01 PM
Yeah, the guys at Segment.io have a reputation for building good stuff. Looking forward to trying this out. I wonder if it's any good at tackling some of the memory leak issues that plague Phantom at the moment ofr if it's just purely syntactic sugar on top?

Peter Reinhardt
10/7/2014 3:45:30 PM
Thanks man! It's mostly syntactic sugar, but recently changed the way phantomjs instance creation/teardown works which may help a bit: https://github.com/segmentio/nightmare/issues/26 https://github.com/segmentio/nightmare/issues/22

Robert Greyling
10/7/2014 3:56:57 PM
Great! Will definitely have a play, love the look of the API, goodness knows how many callbacks I've carved out for my sins with Phantom :) Great work!

JavaScript Kicks
10/7/2014 12:37:24 PM
We'll see if we can get the authors to answer the questions

Drew Peterson
10/9/2014 1:55:20 AM
I really like the simplicity here, I've looked at using other layers on top of phantom for unit testing such as webspecter and casper, but this just feels better. Have you considered bolting on an assertion library and spinning up a small headless testing suite using nightmare?

JavaScript Kicks
10/9/2014 8:44:55 AM
I've only just started looking at it for one of our projects that currently outsources the Phantom bits but haven't got that far yet. I'm sure @reinpk would probably have a better idea of how that would pan out but I'm not sure. Until I can reliably get rid of the PhantomJS lockups that we experience natively, I'm not sure any solution will be robust enough for production use.