Socket
Socket
Sign inDemoInstall

banoffee

Package Overview
Dependencies
176
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    banoffee

E2E testing for your node.js web app, using Selenium, ChromeDriver, Mocha, SauceLabs, ...


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 14 Nov 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc