![Gitter](https://badges.gitter.im/Join Chat.svg)
Find us on Gitter
These images build on the Selenium docker images here https://github.com/SeleniumHQ/docker-selenium
Images included here:
- selion/base: Base image which includes Java runtime, Selenium + SeLion JAR files
- selion/hub: Image for running a Selion Grid Hub
- selion/node-base: Base image for the SeLion node images
- selion/node-chrome: SeLion node with Chrome installed, needs to be connected to a SeLion Grid Hub
- selion/node-firefox: SeLion node with Firefox installed, needs to be connected to a SeLion Grid Hub
- selion/node-phantomjs: SeLion node with Phantomjs installed, needs to be connected to a SeLion Grid Hub
- selion/standalone-chrome: SeLion standalone with Chrome installed
- selion/standalone-firefox: SeLion standalone with Firefox installed
- selion/standalone-phantomjs: SeLion standalone with Phantomjs installed
When executing docker run for an image with chrome browser please add volume mount -v /dev/shm:/dev/shm
to use the host's shared memory.
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selion/node_chrome:1.1.0
This is a workaround to node-chrome crash in docker container issue: https://code.google.com/p/chromium/issues/detail?id=519952
$ docker run -d -p 4444:4444 --name selion-hub selion/hub:1.1.0
You can pass SELION_OPTS
variable with additional commandline parameters for starting a hub or a node. So to run a SeLion sauce hub.
$ docker run -d -p 4444:4444 -e SELION_OPTS="-type sauce" --name selion-hub selion/hub:1.1.0
$ docker run -d --link selion-hub:hub selion/node-chrome:1.1.0
$ docker run -d --link selion-hub:hub selion/node-firefox:1.1.0
You can pass JAVA_OPTS environment variable to selenium java processes.
$ docker run -d -p 4444:4444 -e JAVA_OPTS=-Xmx512m --name selion-hub selion/hub:1.1.0
Ensure you have the ubuntu:15.04
base image downloaded, this step is optional since Docker takes care of downloading the parent base image automatically.
$ docker pull ubuntu:15.04
Clone the repo and from the project directory root you can build everything by running:
$ VERSION=local make build
Note: Omitting VERSION=local
will build the images with the develop version number thus overwriting the images downloaded from Docker Hub.
$ docker run -d --name selion-hub -p 4444:4444 selion/hub:1.1.0
$ CH=$(docker run --rm --name=ch \
--link selion-hub:hub -v /e2e/uploads:/e2e/uploads \
selion/node-chrome:1.1.0)
Note: -v /e2e/uploads:/e2e/uploads
is optional in case you are testing browser uploads on your web app you will probably need to share a directory for this.
This command line is the same as for Chrome. Remember that the Selenium running container is able to launch either Chrome or Firefox, the idea around having 2 separate containers, one for each browser is for convenience plus avoiding certain :focus
issues your web app may encounter during end-to-end test automation.
$ docker run -d --name selion-hub -p 4444:4444 selion/hub:1.1.0
$ FF=$(docker run --rm --name=fx \
--link selion-hub:hub -v /e2e/uploads:/e2e/uploads \
selion/node-firefox:1.1.0)
Note: Since a Docker container is not meant to preserve state and spawning a new one takes less than 3 seconds you will likely want to remove containers after each end-to-end test with --rm
command. You need to think of your Docker containers as single processes, not as running virtual machines, in case you are familiar with Vagrant.
All output is sent to stdout so it can be inspected by running:
$ docker logs -f <container-id|container-name>