Run TAP tests in the browser with WebDriver
Last updated 6 years ago by conradz .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install wd-tap 
SYNC missed versions from official npm registry.


NPM Build Status

Run TAP tests in the browser with WebDriver.

This is a simple utility to run TAP tests in a browser that is automated using WebDriver, driven using Node.js.


You must first have a test page that has a <pre> element with an ID of output that will contain the TAP test output. You will also need a web browser that is automated using WebDriver; you can run one yourself locally or you could use a service like Sauce Labs that will run them for you. For attaching to a WebDriver-automated browser, use wd that allows Node to interface to WebDriver.

The test results are parsed using tap-parser.


This example assumes that you have a WebDriver server running locally, see the wd docs for how to connect to a browser. It also assumes that you have an HTTP server accessible from the browser serving the test page at http://localhost:8000/test.html.

var wd = require('wd'),
    wdTap = require('wd-tap');

var browser = wd.remote(),
    url = 'http://localhost:8000/test.html';

browser.init(function(err) {
    if (err) { return; }

    wdTap(url, browser, function(err, results) {
        // results is the parsed TAP results
        if (!results.ok) {
            console.log('Tests failed');



wdTap(url, browser, [options], callback)

Runs the tests in the browser.

url is the URL of the web page that contains the tests. The test TAP output must be written to a <pre> element with an ID of output.

browser is the browser (connected with wd) that will run the tests. It must be able to access the test URL.

options is an optional object that may contain a timeout property specifying the maximum time (in seconds) to wait for the TAP output to be completed. If the TAP output is not completed in that time, an error will be passed to callback. The default timeout is 30 seconds.

callback will be called after the tests are finished. If an error occured (for example if the connection to the browser was disconnected), it will be passed to the callback. If no error occurred, the TAP results (parsed with tap-parser) will be passed to the callback as the second argument. Note that if a test fails, it will not be considered an error, the results will indicate which tests passed or failed.

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

8 Versions

  • 1.0.0                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.5                                ...           7 years ago
  • 0.0.4                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Today 0
This Week 8
This Month 8
Last Day 8
Last Week 0
Last Month 17
Dependencies (1)
Dev Dependencies (4)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |