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 🙏

© 2025 – Pkg Stats / Ryan Hefner

grunt-sauce-driver

v0.1.1

Published

Grunt task for running Selenium WebDriver tests on SauceLabs.

Downloads

4

Readme

grunt-sauce-driver

A Grunt task for running WebDriver scripts in the Sauce Labs cloud.

In addition to supporting custom scripts, standard scripts are provided for running javascript unit tests in Jasmine and Siesta Lite.

Inspired by the grunt-saucelabs plugin, this project aims to provide greater flexibility and support for custom WebDriver scripts, as well as the option to run tests locally.

Local Tests

Local tests are currently only supported for Google Chrome. To run tests locally, ensure you have download the ChromeDriver server and made it available on your PATH environment variable.

Usage

Example

var saucedriver = require('grunt-sauce-driver');

grunt.initConfig({
	saucedriver: {
		options: {
			username: 'saucelabs-user-name',
			key: 'saucelabs-key',
			tunneled: true,
			tags: ['example', 'sample'],
			browsers: [{
				browserName: 'opera'
			}]
		},
		
		jasmine: {
			url: 'http://example.com/test/jasmine.html',
			script: saucedriver.jasmine
		},
		
		siesta: {
			url: 'http://example.com/test/siesta.html',
			script: saucedriver.siesta
		},
		
		custom: {
			url: 'http://example.com/test/siesta.html',
			script: function(browser, chain) {
				chain
					.waitForElementByClassName('some-class')
					.elementByXPath(
						'//input[type=button]',
						function(err, el) {
							browser.next('clickElement', el);
						}
					)
					.log('Test complete');
			}
		}
	}
});

Options

Basic Options

  • url : String Required

    The URL of the page to be tested.

  • script : Function Required

    The WebDriver script to run, either a custom function or one provided by grunt-sauce-driver. The function should accept the following parameters:

    • browser: The WebDriver browser object.
    • chain: The WebDriver chain object.
    • options: The Grunt options object.
  • browsers : Object[] Optional

    An array of objects representing the browsers on which this test should run.

  • concurrency : Number Optional

    Number of concurrent browsers to test against. When running on Sauce Labs, check your account info for your maximum allowed concurrency. Defaults to 1.

  • slow : Boolean Optional

    If enabled, adds a small delay (0.5 seconds) between each WebDriver action, to make tests easier to watch and debug. Defaults to false.

  • logging : Boolean Optional

    If enabled, logs information about the running script to the console. Defaults to true.

  • testTimeout : Number Optional

    Number of milliseconds to wait for javascript tests to complete on each page before timeout and failing the test. Default to 180000.

  • testInterval : Number Optional

    Number of milliseconds between each poll to see if a javascript test is complete. Defaults to 2000.

  • testReadyTimeout : Number Optional

    Number of milliseconds to wait for the test page to load. Defaults to 10000.

SauceLabs Options

  • username : String Optional

    The username that will be used to connect to Sauce Labs. Defaults to process.env.SAUCE_USERNAME.

  • key : String Optional

    The access key to provide when connecting Sauce Labs. For security purposes, don't hard-code this value in your Gruntfile. Instead, load it via local config file or environment variable. Defaults to process.env.SAUCE_ACCESS_KEY.

  • tunneled : Boolean Optional

    If enabled, uses a Sauce Connect tunnel when running tests on Sauce Labs. Defaults to true.

  • tunnelTimeout : Number Optional

    The connection timeout to use when initializing Sauce Connect, in seconds. Defaults to 120.

  • testname : String Optional

    The name of the test, to be displayed on the Sauce Labs dashboard. Defaults to "".

  • tags : String[] Optional

    An array of tags for this test, used when filtering the Sauce Labs dashboard. Defaults to [].

  • build : String Optional

    The build identifier to be associated with this test. Defaults to null.

Local Options

  • local : Boolean Optional

    If enabled, will run the current test on the local machine rather than Sauce Labs. Defaults to false.

  • autoclose : Boolean Optional

    When running local tests, determines whether the browser under test will be automatically closed after the test completes. Defaults to true.

  • driverPort : Number Optional

    The port number to use for communicating with the local WebDriver server. Defaults to 9515.

License

This project is published under the terms of the MIT License.

Copyright © 2013 by Nat Burns.