Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wdio-docker-service

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wdio-docker-service

WebdriverIO service to start and stop docker container (for Selenium and more)

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

WDIO Docker Service Maintainability Build Status

This service is intended for use with WebdriverIO and it helps run functional/integration tests against/using containerized applications. It uses popular Docker service (installed separately) to run containers.

Why use it?

Ideally your tests would run in some variety of CI/CD pipeline where often there are no "real" browsers and other resources your application depends on. With advent of Docker practically all necessary application dependencies can be containerized. With this service you may run your application container or a docker-selenium in your CI and in complete isolation (assuming CI can have Docker installed as a dependency). Same may apply to local development if your application needs to have a level of isolation from your main OS.

How it works

Service will run an existing docker image and once its ready, will initiate WebdriverIO tests that should run against your containerized application.

Installation

Run:

npm install wdio-docker-service --save-dev

Instructions on how to install WebdriverIO can be found here.

Configuration

By default, Google Chrome, Firefox and PhantomJS are available when installed on the host system. In order to use the service you need to add docker to your service array:

 // wdio.conf.js
 export.config = {
   // ...
   services: ['docker'],
   // ...
 };

Options

dockerOptions

Various options required to run docker container

Type: Object

Default: { options: { rm: true } }

Example:

dockerOptions: {
    image: 'selenium/standalone-chrome',
    healthCheck: 'http://localhost:4444',
    options: {
        p: ['4444:4444'],
        shmSize: '2g'
    }
}

dockerOptions.image

Docker container name tag. Could be local or from Docker HUB.

Type: String

Required: true

dockerOptions.healthCheck

Url to an app exposed by your container. Normally this is a localhost url. If healthCheck is not provided, Webdriver will start running tests immediately after Docker container is executed, which maybe too early considering that it takes time for web service to start inside a Docker container.

Type: String

Example: http://localhost:4444

dockerOptions.options

Map of options used by docker run command. For more details on run command click here.

Any single-letter option will be converted to -[option] (i.e. d: true -> -d).

Any option of two-character or more will be converted to --[option] (i.e. rm: true -> --rm).

For options that may be used more than once (i.e. -e,-add-host, --expose, etc.), please use array notation (i.e. e: ["NODE_ENV=development", "FOO=bar"]).

Type: Object

Example:

options: {
    e: ['NODE_ENV=development', 'PROXY=http://myproxy:80']
    p: ['4444:4444', '5900:5900'],
    shmSize: '2g'
}

dockerOptions.args

Any arguments you may want to pass into container. Corresponds to [ARG...] in Docker run CLI.

Type: String

dockerOptions.command

Any command you may want to pass into container. Corresponds to [COMMAND] in Docker run CLI.

Type: String

dockerLogs

Path to where logs from docker container should be stored

Type: String

Testing Scenarios and Use Cases

Please refer to our WIKI section for detailed information and examples.

Keywords

FAQs

Package last updated on 12 Jan 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc