Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The password is "secret"

The Grid

The standard selenium docker containers provide an easy to setup selenium grid. The selenium grid consists of multiple nodes with same or different browser setups which are all hidden behind a hub. This means for test executions nothing changes but the selenium server is able to provide multiple sessions with different capabilities.


Start up the HUB

Code Block
languagebash
$ docker run -d -p 4444:4444 --name selenium-hub selenium/hub:2.53.1-beryllium

Start up and register the nodes

Code Block
languagebash
$ docker run -d -e SCREEN_WIDTH=1280 -e SCREEN_HEIGHT=1024 -e SCREEN_DEPTH=24 --link selenium-hub:hub selenium/node-firefox:2.53.1-beryllium

If you want to debug, you have to use the -debug image for the nodes and map the VNC ports.

Execute UI tests in parallel

By default the selenium test are executed in sequence. We have to explicitly configure maven/surefire to execute our tests in parallel.

Code Block
languagebash
$ cd magnolia-bundle
$ mvn clean install -Pui-tests,jetty9-standalone -DseleniumServerHostName=localhost -DcontainerHostName=192.168.10.40 -Dparallel=classes -DreuseForks=false -DforkCount=4

As the tests still operate on the same magnolia instance it might be a good idea to not execute test methods of the same class in parallel.


Monitor the grid

Code Block
languagebash
$ open http://localhost:4444/