Skip to content

Instantly share code, notes, and snippets.

@MikaelSoderstrom
Created February 10, 2018 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikaelSoderstrom/3fdcb4635af4fc67ba0f8071163ab6e8 to your computer and use it in GitHub Desktop.
Save MikaelSoderstrom/3fdcb4635af4fc67ba0f8071163ab6e8 to your computer and use it in GitHub Desktop.
FROM selenium/standalone-chrome
# TODO: Use volume shared with host instead
ADD . /protractor/project
USER root
# Installera some tools
RUN apt-get update -qqy \
&& apt-get -qqy install \
apt-utils \
wget \
sudo \
curl
# Install Node.js
RUN apt-get update -qqy \
&& apt-get -qqy install \
software-properties-common \
python-software-properties
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
RUN apt-get update -qqy \
&& apt-get -qqy install \
nodejs \
build-essential
# TODO: Should only be used outside of docker. Remove when sharing volume.
RUN cd /protractor/project && node_modules/.bin/webdriver-manager update
WORKDIR /protractor/project
# Use bash to be able to login directly to bash on docker image. To just run tests, execute npm test directly.
ENTRYPOINT ["npm", "test"]
# ENTRYPOINT [ "bash" ]
@MikaelSoderstrom
Copy link
Author

Build
docker build . -t tests

Run
docker run -it -v c:\temp:/testresults tests

The volume is currently used by JUnitXmlReporter to create test results used by VSTS. I am going to make some changes so I can use a volume for the test files as well so I don´t need to build the image everytime I need to run the tests.

I am using headless Chrome and Firefox for the test runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment