Alternative to CasperJS for use with Cucumber.js-open source projects n1k0/casperjs
After lots of research and trial and error I have chosen the following stack for Frontend BDD testing:
- Cucumber.js
- CasperJS (through SpookyJS)
- PhantomJS
I would like to avoid CasperJS run queues and use PhantomJS directly (through phantom-proxy) with callbacks in each step:
@World = (cb) ->
@phantom = require "phantom-proxy"
cb()
@Before (cb) ->
self = this
@phantom.create {}, (proxy) ->
self.proxy = proxy
self.page = proxy.page
cb()
@After (cb) ->
@proxy.end ->
cb()
@When /^I go to url "([^"]*)"$/, (url, cb) ->
@page.open url, ->
cb()
making the whole more logical and BDD-like.
Additionally, SpookyJS doesn’t provide a full API for CasperJS.
The PhantomJS API, however, is quite low-level. Is there any other tool that provides CasperJS-like functionality (clicking, waiting for elements, etc) for Node.js without using run queues?