DailyJS

WebSpecter, cerebral.js, Mobify.js

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

frameworks libraries testing mobile backbone.js

WebSpecter, cerebral.js, Mobify.js

Posted by Alex R. Young on .
Featured

frameworks libraries testing mobile backbone.js

WebSpecter, cerebral.js, Mobify.js

Posted by Alex R. Young on .

WebSpecter

WebSpecter (License: MIT) by Juliusz Gonera is an acceptance test framework built using PhantomJS. The author's examples are written with CoffeeScript, but it can be used with JavaScript as well.

The tests use a BDD-style syntax, based around "features" and CSS selectors:

feature "GitHub search", (context, browser, $) ->  
  before (done) -> browser.visit 'https://github.com/search', done

  it "finds WebSpecter", (done) ->
    $('input[name=q]').fill 'webspecter'
    $(button: 'Search').click ->
      $(link: "jgonera / webspecter").present.should.be.true
      done()

  it "looks only for users when asked to", (done) ->
    $('input[name=q]').fill 'webspecter'
    $(field: 'Search for').select 'Users'
    $(button: 'Search').click ->
      $(link: "jgonera / webspecter").present.should.be.false
      done()

The browser object is a wrapper around Phantom's WebPage. A $ function is also present which is jQuery-like but not implemented using jQuery.

cerebral.js

cerebral.js (GitHub: gorillatron / cerebral) by Andre Tangen extends Backbone.js to provide a module system and a publish/subscribe application core. It uses RequireJS for modules and module loading, and modules are restricted to a "sandbox" designed to limit the elements the module has access to.

The main motivation behind cerebral.js is to encourage loosely coupled applications. When I'm working on my own Backbone.js applications I usually adopt a similar approach, so it's reassuring to see the same ideas in a framework.

Mobify.js

Mobify.js (GitHub: mobify / mobifyjs, License: MIT, npm: mobify-client) is a new client-side web framework that aims to make it easier to adapt sites to any device. This includes responsive design techniques, but it can also be backed by a cloud service called Mobify Cloud that includes automatic image resizing, JavaScript concatenation, and a CDN. Mobify.js projects are built with Zepto and Dust.js.

The Mobify.js authors have also been building MIT-licensed Mobify.js modules, at the moment there's a carousel and an accordion.