banoffee
E2E testing for your node.js web app, using Selenium, ChromeDriver, Mocha, SauceLabs, ...
Last updated 6 years ago by lupomontero .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install banoffee 
SYNC missed versions from official npm registry.

banoffee

NPM

Build Status Dependency Status devDependency Status

banoffee is a test framework that allows you to test your site's behaviour on different browsers. banoffee uses WebDriver to allow you to programmatically control the browser in your tests.

banoffee heavily relies on wd, Mocha, selenium-server-standalone, chromedriver and Sauce-Connect.


Dependencies

  • node
  • java

Not tested on Windows at all :-(

Installation

npm install -g banoffee

Configuration (banoffee.conf.js)

Before you start running your tests you will need a configuration file where you can tell banoffee where to find the files with your tests, what Selenium server to connect to, what browsers to test on and so on.

Create a file called banoffee.conf.js in your project's root. In this example we only specify the directory where banoffee should look for tests, so everything else will use a default value:

module.exports = {

  testDir: 'test'

};

An example banoffee.conf.js file using SauceLabs Sauce Connect:

module.exports = {

  testDir: 'test',

  remote: {
    hostname: 'ondemand.saucelabs.com',
    port: 80,
    user: '<YOUR-SAUCELABS-USERNAME>',
    pwd: '<YOUR-SAUCELABS-PASSWORD>'
  },

  platforms: [
    {
      browserName: 'chrome',
      version: '32',
      platform: 'Linux',
      tags: [ 'example' ],
      name: 'myapp e2e'
    },
    {
      browserName: 'firefox',
      version: '27',
      platform: 'Linux',
      tags: [ 'example' ],
      name: 'myapp e2e'
    }
  ]

};

Configuration options

testDir

testFilePattern

remote

platforms

Writing your tests

Lets say you put your tests in a test/ directory inside your project. An example file test/index.spec.js could look something like this:

describe('homepage', function () {

  var url = 'http://localhost:3000/';

  beforeEach(function () {
    return browser.get(url);
  });

  it('should retrieve the page title', function () {
    return browser.title().should.become('The page title!');
  });

});

Running your tests

Ok, so now you have a test and a config file, so lets get cracking!

You can run your tests from the command line. Assuming you are in the root directory of your project and that your banoffee.conf.js is in the current directory, you can simply run:

$ banoffee

Without any arguments, banoffee looks for a banoffee.conf.js file in the current working directory.

We can also specify the config file to use as an argument, so if we wanted to have separate configs for develepment and continuous integration for example, you could have two config files and run:

$ banoffee --conf banoffee.dev.js

and

$ banoffee --conf banoffee.continuous.js

Using banoffee programmatically

var banoffee = require('banoffee');

banoffee({ testDir: 'test' }, function (err, failures) {
  // ...
});

Notes

Current Tags

  • 0.0.3                                ...           latest (6 years ago)

4 Versions

  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (16)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |