Coder Social home page Coder Social logo

daggerok / e2e Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 126 KB

Docker base image for end-to-end selenium webdriver testing in docker: ubuntu, xvfb, java, firefox

Home Page: https://hub.docker.com/r/daggerok/e2e

License: MIT License

Dockerfile 56.01% Java 41.02% HTML 2.96%
docker docker-image dockerhub dockerhub-image chrome firefox selenium selenium-webdriver webdriver selenium-java

e2e's Introduction

E2E image Build Status Firefox e2e tests Chrome e2e tests

Automated e2e base image build for Docker Hub

  • Docker Ubuntu Bionic 18.04 / Trusty 14.04
  • Java Development Kit 8 OpenJDK / AdoptOpenJDK
  • Chrome with chrome driver version: 80.0.3987.106
  • Firefox with gecko driver version: 0.26.0
  • X Virtual Frame Buffer (xvfb)

v4 tags ww

images

  • Docker Ubuntu Trusty 14.04 base image including XVFB and JDK8
  • Docker Ubuntu Trusty 14.04 image including Chrome browser, chrome driver, XVFB and JDK8
  • Docker Ubuntu Trusty 14.04 image including Firefox browser, gecko driver, XVFB and JDK8
  • Docker Ubuntu Trusty 14.04 image including Firefox and Chrome browsers, theirs web-drivers, XVFB and JDK8

web drivers sources

Usage

just create your test Dockerfile

FROM daggerok/e2e:ubuntu-xvfb-jdk8
#/home/e2e/project-directory/
WORKDIR 'project-directory/'
ENTRYPOINT start-xvfb && ./gradlew test
COPY . .
FROM daggerok/e2e:bionic-xvfb-jdk8-v4
WORKDIR 'some-directory/'
ENTRYPOINT start-xvfb && ./gradlew test chrome
COPY . .
FROM daggerok/e2e:trusty-xvfb-jdk8
WORKDIR 'e2e-tests/'
ENTRYPOINT start-xvfb && ./gradlew test firefox
COPY . .
FROM daggerok/e2e:trusty-xvfb-jdk8-base-v4
#FROM daggerok/e2e:bionic-xvfb-jdk8-base-v4
RUN echo 'install browser, webdriver and use already installed and configured jdk8 + Xvfb based on Ubuntu 14.04'

build test image

# prepare tests/Dockerfile.firefox and build e2e test image  as usual...
docker build -f ./tests/Dockerfile.firefox -t daggerok/e2e-tests:`date +%Y-%m-%d` ./tests

run tests

docker run --rm --name run-`date +%Y-%m-%d`-e2e-tests daggerok/e2e-tests:`date +%Y-%m-%d`

reduce build time by using data volume

# build e2e test image  as usual...
docker build -f ./tests/Dockerfile.firefox -t daggerok/e2e-tests:`date +%Y-%m-%d` ./tests

# create re-usable e2e data volume
docker volume create e2e-data || echo 'oops, volume exists...'

# run e2e tests
docker run --rm --name run-`date +%Y-%m-%d`-e2e-tests \
  -v e2e-data:/home/e2e/.gradle/caches/modules-2/files-2.1 \
  -v e2e-data:/home/e2e/.m2/repository \
  daggerok/e2e-tests:`date +%Y-%m-%d`

fix chrome

To make it possible run e2e tests in chrome, you have to in addition configure --no-sandbox ChromeOptions argument in your tests, like so:

// ./mvnw test -Dselenide.browser=chrome -Dselenide.headless=true
if ("chrome".equals(Configuration.browser)) && Configuration.headless) {
  ChromeOptions chromeOptions = new ChromeOptions().addArguments("--no-sandbox");
  WebDriverRunner.setWebDriver(new ChromeDriver(chromeOptions));
}

e2e's People

Contributors

daggerok avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dariano

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.