node package manager



Satisfy is a minimalistic browser testing utility designed to work with any test framework, oriented only around CSS selectors, designed for speed both of test writing and test execution.

For development, run the tests in a headless WebKit browser. For deployments, run them in the cloud in all browsers with Selenium.

It's the expect.js of browser / acceptance testing.

How to use

  .click('li#home a')
  .click('li#test a')


With the mocha test framework:

var satisfy = require('satisfy');
describe('learnboost homepage', function () {
  it('should work', function (done) {
      .expect('a:contains(For Schools)')

Then run it:

$ mocha -t 0 test.js


  • Fast. The default adaptor is the fastest available.
  • Test-framework agnostic, but best with the wonderful mocha
  • No APIs to learn. Only based on CSS selectors.
  • Extended CSS selectors thanks to Sizzle like :contains for text matching.
  • Adaptor based
    • webkit-server (headless webkit)
    • soda (selenium)


Following a link

  .click('li#home a')

Filling a form

  .expect('#add-classroom-dialog', 7000) // override expect timeout 
  .fill('input[name=classroom-name]', 'My classroom')
  .fill({ 'textarea': 'Something' })
  .click('#add-classroom input[type=submit]')


You can pass options to specific satisfy instances:

satisfy('', { options })
  • adaptor String
    • webkit-server or soda (selenium/sauce labs).
    • Defaults to webkit-server
  • timeout Number
    • Timeout after which we considered the test failed if a CSS selector expectation is not met.
    • Strings like '2m' or '10s' are supported.
    • Defaults to 10000
  • webkit-server Object
    • Hash of options for the webkit-server adaptor.
    • Options
    • poll Number|String
      • How often we poll the DOM for a certain selector match.
      • Only applies for the webkit-server mode.
      • Strings like '2m' or '10s' are supported.
      • Defaults to 50
  • soda Object
    • Hash of options for the soda adaptor.
    • Options
      • sauce Boolean
        • Whether to use sauce labs.
        • Defaults to false
      • host String
        • Selenium host.
        • Defaults to localhost
      • port Number
        • Selenium port
        • Defaults to 4444
      • browser String
        • Browser to test on.
        • Defaults to firefox.
  • autorun Boolean
    • If run is not called, it calls it automatically for you
    • Defaults to true

Global options

If you wanted to pass options to all instances, you can implement that in userland easily by defining your own helper method:

function mytest (url) {
  return satisfy(url, { default options });