Ghostbuster: Easier headless testing with PhantomJS (and CoffeeScript)(thechangelog.com)
thechangelog.com
Ghostbuster: Easier headless testing with PhantomJS (and CoffeeScript)
http://thechangelog.com/post/9412707640/ghostbuster-headless-testing-with-phantomjs-and-coffeesc
7 comments
The UTF-8 test results with ✓ for success and ✗ for failure are just adorable.
Those (and similar symbols) have actually been used in several Node testing frameworks. See e.g. nodeunit (https://github.com/masylum/testosterone), Vows (http://vowsjs.org/), and Testosterone (https://github.com/masylum/testosterone).
I wanted to use "CIRCLE WITH LEFT HALF BLACK" for pending tests (see: http://en.wikipedia.org/wiki/Geometric_Shapes) .. alas, not supported in my terminal .. maybe I was doing it wrong.
PhantomJS seems like something I should pay more attention to.
PhantomJS is one of the better "headless" browsers out there. Webkit-based, Minimal src codebase (Python), and easy to compile (with QT tools).
IMO The API is a little weird though: when evaluating js within a PhantomJS "WebPage" context, it is _completely_ sandboxed. i.e. you can't use closures or otherwise reference any variables outside the scope of your "WebPage" (without work-arounds). This is odd, when you consider that the page is just another var in your script. IMO it kind of breaks some JS paradigms. Not a big deal, but an annoyance none-the-less.
IMO The API is a little weird though: when evaluating js within a PhantomJS "WebPage" context, it is _completely_ sandboxed. i.e. you can't use closures or otherwise reference any variables outside the scope of your "WebPage" (without work-arounds). This is odd, when you consider that the page is just another var in your script. IMO it kind of breaks some JS paradigms. Not a big deal, but an annoyance none-the-less.
PhantomJS is pretty cool. There are some super rough areas I had to deal with to get this working, but I hope they can improve it and make it more awesome. I've gotta file some bugs actually..
I was just happy to get the link traversal test passing. So many tears to get that reliable.
I was just happy to get the link traversal test passing. So many tears to get that reliable.
This is my PhantomJS experience as well!
What mitigated this a bit though, is the actual Phantom codebase on-top of Webkit is really small. So when you need to figure out exactly what it's doing, it's super easy to just dig into the src.
I'm hoping more visibility as CLI JS (and/or Coffescript) testing becomes more mainstream, it will bump up the # of contributors.
What mitigated this a bit though, is the actual Phantom codebase on-top of Webkit is really small. So when you need to figure out exactly what it's doing, it's super easy to just dig into the src.
I'm hoping more visibility as CLI JS (and/or Coffescript) testing becomes more mainstream, it will bump up the # of contributors.