Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including derby-webdriverio with all npm packages installed. Try it out:

require("webdriverio/package.json"); // webdriverio is a peer dependency. require("mocha/package.json"); // mocha is a peer dependency. require("chai/package.json"); // chai is a peer dependency. var derbyWebdriverio = require("derby-webdriverio")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

derby-webdriverio v5.0.0 for Derby.js

derby-webdriverio for Derby.js


npm i --save derby-webdriverio


In your derby app index file:

# app/

app = require('derby').createApp 'foobar', __filename = app if window? # app must be accessible from the client
app.use require('derby-webdriverio/renderReady')

Create wdio.conf.js in project's root folder:

// wdio.conf.js
exports.config = require('derby-webdriverio')({
  // Specify multiple browsers to run.
  // If it's 1 then will be created a single 'remote' instance.
  // If it's >=2 then 'multiremote' will be created; the whole group will be
  // called with the specified name; and each browser in this group will
  // have a singular form of that name + number, i.e. 'student0', 'student1', ...
  browsers: {
    browser: 1,
    prof: 1,
    students: 10
  // selenium settings to use for each browser specified above
  desiredCapabilities: {
    browserName: 'chrome'
  // base url which will be used for .url() methods
  baseUrl: 'http://localhost:3003',
  // timeout to wait until test fails
  waitforTimeout: 30000,
  // path to save screenshots (by default it's /test/screenshots/, don't forget
  // to add it to your .gitignore)
  screenshotPath: __dirname + '/test/screenshots/',
  // files with tests
  specs: [
  // files to ignore
  exclude: [

To run your tests:


If you want to run it as npm test you can add the following script to your package.json:

"scripts": {
  "test": "wdio",


These methods accept the same arguments as the original methods. They do the same action and wait for derby page to fully load after that.



All racer get- and set- methods are available.

Couple of examples:

.modelGet '_session.userId'
.then (userId) ->
  @urlAndWait '/profile/' + userId
it 'check title', ->
  newTitle = 'New Title'
  prevTitle = yield browser.modelSet '_page.title', newTitle
  .then (title) ->
    title.should.not.equal prevTitle
    title.should.equal newTitle
all other get/set methods are supported -- .modelAdd, .modelPop, etc.



Do app.history.push on the client and wait for the page to fully load.

.historyPush '/profile'
.should.eventually.equal 'My Profile'

Refresh the page using app.history.refresh on the client.

Chai shorthands

A bunch of useful shorthand methods to test things. All of them accept the arguments which will be passed to X() function.

# Note that the arguments passed here are `X()` function arguments
.shouldExist 'form.main button *= Submit'
.shouldExist '*= Welcome to my Website'

Accepts the same arguments as .execute() and checks that its return value equals true

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free