Giter Club home page Giter Club logo

docker-selion's Introduction

docker-selion

Docker images for SeLion (grid) server Hub and Node configurations with Chrome and Firefox.

Build Status ![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

Running the images

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.0.0

This is a workaround to node-chrome crash in docker container issue: https://code.google.com/p/chromium/issues/detail?id=519952

Selion Grid Hub

$ docker run -d -p 4444:4444 --name selion-hub selion/hub:1.0.0

SELION_OPTS options

You can pass SELION_OPTS variable with additional commandline parameters for starting a hub or a node. So to run a SeLion sauce hub.

Selion Grid Sauce Hub

$ docker run -d -p 4444:4444 -e SELION_OPTS="-type sauce" --name selion-hub selion/hub:1.0.0

Chrome and Firefox Grid Nodes

$ docker run -d --link selion-hub:hub selion/node-chrome:1.0.0
$ docker run -d --link selion-hub:hub selion/node-firefox:1.0.0

Java Environment Options

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.0.0

Building the images

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 current version number thus overwriting the images downloaded from Docker Hub.

Using the images

Example: Spawn a container for testing in Chrome:
$ docker run -d --name selion-hub -p 4444:4444 selion/hub:1.0.0
$ CH=$(docker run --rm --name=ch \
    --link selion-hub:hub -v /e2e/uploads:/e2e/uploads \
    selion/node-chrome:1.0.0-SNAPSHOT)

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.

Example: Spawn a container for testing in Firefox:

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.0.0
$ FF=$(docker run --rm --name=fx \
    --link selion-hub:hub -v /e2e/uploads:/e2e/uploads \
    selion/node-firefox:1.0.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.

Troubleshooting

All output is sent to stdout so it can be inspected by running:

$ docker logs -f <container-id|container-name>

License

The Apache Software License, Version 2.0

docker-selion's People

Watchers

ysecaran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.