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

burnout

v0.0.2

Published

Burnout is a asynchronous, chainable Selenium 2 WebDriver interface.

Downloads

9

Readme

Burnout

Burnout is an asynchronous, chainable and DRY interface for building Selenium 2 WebDriver scripts in Node. It was written primarily for interfacing with Sauce Labs, but it should work with most Selenium 2 setups. Burnout builds on top of the excellent Selenium 2 WebDriver library wd.

Installing

npm install burnout

Using

Burnout's API strives to map as closely as possible to the interface exposed by wd, which in turn maps closely to the Selenium JSON Wire Protocol.

An example test:

var burnout = require('burnout'),
    assert = require('assert'); // Your assertion utility of choice here

burnout
    .initialize({ 
        name: "CloudFlare - Rocket Loader Optimization" // Test name
    })
    // Start chaining commands..
    .eval("document.title", function(title) {
    
        assert(title == '');
    })
    // Chained commands are guaranteed to run synchronously
    .elementByCss("#NextPageLink", function(link) {

        // The context of callbacks can be used to promise sub-commands
        return this.moveTo(link, 2, 2, function() {

            return this.click(link)
        });
    })
    // End the test. Status automatically posted to Sauce Labs.
    .quit();

API

These are the methods currently exposed by Burnout:

var seleniumMethods = [
    'init',
    'get',
    'eval',
    'element',
    'elementById',
    'elementByName',
    'elementByCss',
    'getAttribute',
    'execute',
    'executeAsync',
    'click',
    'doubleClick',
    'close',
    'setImplicitWaitTimeout',
    'setAsyncScriptTimeout',
    'moveTo',
    'scroll',
    'text',
    'buttonDown',
    'buttonUp',
    'active',
    'keyToggle'
];

Browsers

Burnout uses a hardcoded selection of browsers when running tests. Exclusions to this selection are currently supported, but not additions. This will change as I get a feel for how people are using the library, but for my immediate purposes I wanted tests to be inclusive by default.

These are the browsers that Burnout tests by default:

var seleniumBrowsers = [
    {
        browserName: "googlechrome"
    },
    {
        browserName: "firefox",
        version: "11",
        platform: "XP"
    },
    {
        browserName: "firefox",
        version: "3.6",
        platform: "XP"
    },
    {
        browserName: "iexplore",
        version: "6",
        platform: "XP"
    },
    {
        browserName: "iexplore",
        version: "7",
        platform: "XP"
    },
    {
        browserName: "iexplore",
        version: "8",
        platform: "XP"
    },
    {
        browserName: "iexplore",
        version: "9"
    },
    {
        browserName: "opera",
        version: "11",
        platform: "LINUX"
    }
];

If you want to exclude specific browsers from you test, you can specify them when you initialize Burnout:

burnout
    .initialize({
        name: "Foo test.",
        exclude: [
            "iexplore 6",
            "firefox 3.6"
        ]
    })
    // etc..

If you just want to sanity check your code, you can set an environment variable when running your tests:

# If $ENV is set to test, only Google Chrome will be tested
ENV=test node ./path/to/selenium-suite.js

Alternatively, you can set 'debug' to true when initializing Burnout:

burnout
    .initialize({ 
        name: "Foo test.", 
        debug: true 
    })
    // etc..

Sauce Labs

Burnout accepts Sauce Labs account information as environment variables:

SAUCE_USER=foo SAUCE_KEY=123-456-789 node ./path/to/selenium-suite.js

Or as options in the call to initialize:

burnout
    .initialize({
        name: "Foo test.",
        sauceUser: "foo",
        sauceKey: "123-456-789"
    })
    // etc..

Non-Sauce Labs Environments

Burnout also accepts

burnout
    .initialize({
        name: "Foo test.",
        remoteHost: "ondemand.saucelabs.com",
        remotePort: 80
    })
    // etc..