I was recently on The Cognicast with Craig Andera where we discussed using Generative Testing on a large non-Clojure(script) codebase, in particular Ruby on Rails and Backbonejs. If you haven’t listened to the show yet I highly recommend it first.
- Compile JS into one file (just like prod).
- Compile tests into a single file.
- Combine them in a PhantomJS process.
- Let the tests do their thing.
Here are the challenges that lie between us and Generative Testing bliss.
- Picking the right library
- Setting up Leiningen & Cljsbuild
- Dodge PhantomJS issues
- Avoid mangling your app, and defeating dueling dependencies
via baudehlo/node-phantom-simple · GitHub.
A bridge between PhantomJS / SlimerJS and Node.js.
This module is API-compatible with node-phantom but doesn’t rely on
socket.io. In essence the communication between Node and Phantom / Slimer has been simplified significantly. It has the following advantages over
- Fewer dependencies/layers.
- Doesn’t use the unreliable and huge socket.io.
- Works under
cluster (node-phantom does not, due to how it works)
server.listen(0) works in cluster.
- Supports SlimerJS.
via Choosing Automated Testing Frameworks – PhantomJS / CasperJS vs Selenium.
“When developing our test strategy, we must minimize the impact caused by changes in the applications we are testing, and changes in the tools we use to test them.”
–Carl J. Nagle
Now what are headless browsers? Executed using command line interfaces or network communications, headless browsers provide automated control of a web page in an environment similar to popular web browsers. Now let’s cut to the chase:
We have wrote an article on screen capture using a library which is paid with free version it makes screenshots with for 3 days only. So today I am going to write this tutorial to move a free library PhantomJS using PHP and PhantomJS you can easily capture website screenshots for free so let’s start with installation.
via v3.0 API Developer Guide.
In this video we install casperjs. You need to have PhantomJS installed as well. We will add these to our system path.
via CSS Testing with PhantomCSS, PhantomJS, CasperJS and Grunt | Phase2.
A new and exciting area of Front-end Development is regression testing. I know, I know… Testing is exciting? Well in a field that has had no formal testing practices, and is constantly plagued by unexpected regressions, the opportunity to write effective tests is incredibly welcome!