Socket
Socket
Sign inDemoInstall

digdug

Package Overview
Dependencies
37
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    digdug

Dig Dug. A simple abstraction library for downloading and launching WebDriver service tunnels.


Version published
Weekly downloads
3.7K
decreased by-5.04%
Maintainers
1
Install size
2.69 MB
Created
Weekly downloads
 

Readme

Source

ディグダグ

Dig Dug is a simple abstraction library for downloading and launching WebDriver service tunnels and interacting with the REST APIs of these services.

The following services are currently supported:

  • BrowserStack
  • Sauce Labs
  • TestingBot

Configuration

In many cases, the only configuration you'll need to do to create a tunnel is provide authentication data. This can be provided by setting properties on tunnels or via environment variables. The tunnels use the following environment variables:

Tunnel classEnvironment variables
BrowserStackTunnelBROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY
SauceLabsTunnelSAUCE_USERNAME, SAUCE_ACCESS_KEY
TestingBotTunnelTESTINGBOT_KEY, TESTINGBOT_SECRET

Other properties, such as the local port the tunnel should serve on or the URL of a proxy server the tunnel should go through, can be passed to a tunnel constructor or set on a tunnel instance. See the pages for Tunnel and the tunnel subclasses for available properties.

Usage

To create a new tunnel, import the desired tunnel class, create a new instance, and call its start method. start returns a Promise that resolves when the tunnel has successfully started. For example, to create a new Sauce Labs tunnel:

var SauceLabsTunnel = require('digdug/SauceLabsTunnel');
var tunnel = new SauceLabsTunnel();
tunnel.start().then(function () {
	// interact with the WebDriver server at tunnel.clientUrl
});

Once a tunnel has been started, a test runner interacts with it as described in the service's documentation. The Sauce Labs and TestingBot executables start a WebDriver server on localhost that the test client communicates with. To interact with BrowserStack, a test client will connect to hub.browserstack.com after the tunnel has started.

The tunnel classes also provide a sendJobState convenience method to let the remote service know whether a test session passed or failed. This method accepts a session ID and an object containing service-specific data, and it returns a Promise that resolves if the job state was successfully updated.

tunnel.sendJobState(sessionId, { success: true });

When testing is finished, call the tunnel's stop method to cleanly shut it down. This method returns a Promise that is resolved when the service tunnel executable has exited.

tunnel.stop().then(function () {
	// the tunnel has been shut down
});

License

Dig Dug is available under the terms of the New BSD License. All code is developed under the terms of the Dojo Foundation CLA.

© 2013–2014 SitePen, Inc. http://sitepen.com

Keywords

FAQs

Last updated on 23 Apr 2015

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