/docker-webdriverio

Using selenium hub to organize other nodes

MIT LicenseMIT

Docker WebdriverIO

Using selenium hub to organize other nodes

Configuration

docker-compose.yml

version: '2'
services:
  e2e:
    image: casperlai/docker-webdriverio:latest
    depends_on:
      - chrome
      - firefox

  hub:
    image: selenium/hub
    ports:
      - 4444:4444
    container_name: hub

  firefox:
    image: selenium/node-firefox
    ports:
      - 5900:5900 # if you want to debug
    environment:
      - HUB_PORT_4444_TCP_ADDR=hub
      - HUB_PORT_4444_TCP_PORT=4444
    depends_on:
      - hub

  chrome:
    image: selenium/node-chrome
    ports:
      - 5901:5900  # if you want to debug
    environment:
      - HUB_PORT_4444_TCP_ADDR=hub
      - HUB_PORT_4444_TCP_PORT=4444
    depends_on:
      - hub

  # Add another service

wdio.conf.js

exports.config = {
    host: 'YOUR-DOCKER-MACHINE-IP',
    port: 4444,
    ...
}

Run

docker-compose up