From 52e736c9f89c081a2140a7ab3b964e5bbdfc576e Mon Sep 17 00:00:00 2001 From: Oscar Calderin Date: Wed, 26 Apr 2017 10:33:17 -0300 Subject: [PATCH 1/2] adding dockerfile --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..66152c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# +# Abstracta AutomationFramework Dockerfile +# +# https://github.com/abstracta/SeleniumAutomationFW +# + +# Pull base image +FROM ubuntu:16.04 + +# Update repos +RUN apt-get update +RUN apt-get -y upgrade + +# Install java and maven +RUN apt-get install -y default-jdk +RUN apt-get install -y maven + +# Set environment variables. +ENV HOME /root + +# Define working directory. +WORKDIR /root/automationFramework + +# Define default command. +CMD ["bash"] + +# Prepare by downloading dependencies +ADD pom.xml /root/automationFramework/pom.xml +RUN ["mvn", "dependency:resolve"] +RUN ["mvn", "verify"] + +# Adding source +ADD src /root/automationFramework/src From 56a20ee2ff0f38ec17dd61bd6815287aecee2c4a Mon Sep 17 00:00:00 2001 From: Oscar Calderin Date: Wed, 26 Apr 2017 17:30:30 -0300 Subject: [PATCH 2/2] modifyng Dockerfile --- Dockerfile | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66152c5..e8f89af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # # Abstracta AutomationFramework Dockerfile +# Based on Ubuntu # # https://github.com/abstracta/SeleniumAutomationFW # @@ -7,13 +8,27 @@ # Pull base image FROM ubuntu:16.04 -# Update repos +# File Author / Maintainer +MAINTAINER Abstracta Inc. + +# Update and upgrade repository sources list RUN apt-get update -RUN apt-get -y upgrade +#RUN apt-get -y upgrade # Install java and maven -RUN apt-get install -y default-jdk -RUN apt-get install -y maven +RUN apt-get install -y default-jdk maven + +# Install curl and wget +RUN apt-get install -y curl wget + +# Install browsers +RUN apt-get install -y firefox +RUN apt install -y libappindicator1 libdbusmenu-glib4 libdbusmenu-gtk4 libindicator7 libpango1.0-0 libxss1 xdg-utils fonts-liberation +RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /root/google-chrome-stable_current_amd64.deb +RUN dpkg -i /root/google-chrome-stable_current_amd64.deb + +# Install tar and unzip +RUN apt-get install -y tar unzip # Set environment variables. ENV HOME /root @@ -21,13 +36,33 @@ ENV HOME /root # Define working directory. WORKDIR /root/automationFramework +# Create folder for drivers +RUN mkdir -p /root/drivers + +# Download drivers +RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-linux64.tar.gz -O /root/drivers/geckodriver-v0.16.1.tar.gz +RUN wget http://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip -O /root/drivers/chromedriver.zip + +# Unzip drivers +RUN tar xvzf /root/drivers/geckodriver-v0.16.1.tar.gz +RUN unzip /root/drivers/chromedriver.zip + +# Delete files +RUN rm -rf /root/drivers/geckodriver-v0.16.1.tar.gz +RUN rm -rf /root/drivers/chromedriver.zip + +# Add driver folder to PATH +ENV PATH="/root/drivers:${PATH}" + # Define default command. CMD ["bash"] # Prepare by downloading dependencies ADD pom.xml /root/automationFramework/pom.xml RUN ["mvn", "dependency:resolve"] -RUN ["mvn", "verify"] # Adding source ADD src /root/automationFramework/src + +# Execute tests +#RUN mvn clean test -Dsuite="SMOKE_TEST" -Denvironment="QA" \ No newline at end of file