Sign inSign up

srsp/testdriver-chrome

By srsp

Updated about 7 years ago

Chrome, chromedriver, xvfb and mvn in one container. Ready to test your java projects.

Image
2

3.6K

srsp/testdriver-chrome repository overview

What?

The idea is to run end-to-end tests in a Docker container, that contains Chrome, the chromedriver, mvn and the source for the tests. The tests run against an instance of your application outside of the container. This can be done on a CI server like Jenkins, so you do not need to hassle with the installation of these tools on the CI server itself.

Published on Docker Hub.

How?

docker pull srsp/testdriver-chrome

You can run this image with

docker run -v "$(pwd)":/home/tester/code -v"$HOME"/.m2:/home/tester/.m2 -w /home/tester/code/someOtherDir srsp/testdriver-chrome ./execute-mvn-test.sh

where

  • -v "$(pwd)":/home/tester/code mounts your source code into the container
  • -v"$HOME"/.m2:/home/tester/.m2 mounts a directory (empty or containing your mvn .m2 folder) into the container
  • ./execute-mvn-test.sh is the script that runs your tests.

A typical execute-mvn-test.sh could look like this:

#!/usr/bin/env bash
xvfb-run mvn verify

The important thing here is the xvfb-run, which will wrap the mvn execution into the virtual framebuffer, so Selenium or Serenity tests can use the provided chromedriver to start the provided Chrome browser.

Versions

testdriver-chromeChromeChromedriverOpenJDKmvn
74.0.0-jdk1174.0.3729.10874.0.3729.611.0.33.6.1
74.0.074.0.3729.10874.0.3729.61.8.0_2123.6.1
73.0.0-jdk1173.0.3683.8673.0.3683.6811.0.2.93.6.0
73.0.073.0.3683.8673.0.3683.681.8.0_2123.6.0
2.46.0-jdk1172.0.3626.1092.4611.0.2.93.6.0
2.46.072.0.3626.1092.461.8.0_2023.6.0
2.45.071.0.3578.982.451.8.0_1913.6.0
2.43.170.0.3538.772.431.8.0_1813.6.0
2.43.070.0.3538.772.431.8.0_1813.5.4
2.42.069.0.3497.922.421.8.0_1813.5.4
2.41.069.0.3497.922.411.8.0_1813.5.4

Acknowledgments

Big thanks to Hronom for the Chrome, Chromedriver and Xvfb stuff.

Development

Find out Chrome version
docker run srsp/testdriver-chrome /opt/google/chrome/chrome --no-sandbox --version
Find out Java and mvn version
docker run srsp/testdriver-chrome mvn --version

Tag summary

Content type

Image

Digest

Size

549.6 MB

Last updated

about 7 years ago

docker pull srsp/testdriver-chrome