npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

banoffee

v0.0.3

Published

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

Downloads

5

Readme

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