PageObject implementation (CoffeeScript, CasperJS)
Do we need to attach a casper reference to the PO class?
By using the module pattern you inject the dependency anyway.
Here is the P0 class with a tiny refactoring:

module.exports = (casper) -&gt;

  class PO      
    constructor: (@name, @selector, mixin={}) -&gt;
      if PO[@name]?
        throw new Error "Failed creating PO #{@name}: ..."
      PO[@name] = @
      @[key] ?= val for own key,val of mixin

    waitUntilVisible: (cb) -&gt;
      casper.waitUntilVisible @selector, cb
      @

    next: (po, cb) -&gt;
      t0 = Date.now()
      msg = "Switching to PO #{po.name}"
      casper.log msg, 'debug'
      po.waitUntilVisible (err) -&gt;
        casper.log "#{msg}: done in #{Date.now() - t0}ms", 'debug'
        cb err, po


Then you would use it like this:

casper = require 'casper'
PO     = require('MyModuleName') casper

new PO 'navbar', '',
  tabs: {}
  logout: (cb) -&gt;
    casper.click '#logout'
    casper.waitFor (=&gt; not @haveLogin()), (err) -&gt; cb err, PO.login

  haveLogin: (cb) -&gt;
    result = nick is casper.evaluate -&gt; ($ '#current-user-nick').text()
    cb? result
    result

  addTab: ({name, switchSelector, readySelector, po}) -&gt;
    @tabs[name] = arguments[0]

  toTab: (name, cb) -&gt;
    cb new Error "Navbar tab #{name} not known" unless name of @tabs
    tab = @tabs[name]
    casper.click tab.switchSelector
    casper.waitUntilVisible tab.readySelector, (err)-&gt; cb err, PO[tab.po]


On extending the class you can skip the constructor (as long as it's the same like the one of the superclass) and attach the PO['navbar'] to the prototype.

class PON extends PO
  navbar: PO.navbar