Created
May 14, 2020 04:57
-
-
Save pako88/6eb8e48068ed14f333bebf943e866b16 to your computer and use it in GitHub Desktop.
Dockerize WDIO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:lts | |
| RUN apt-get update \ | |
| && apt-get install -y python-pip jq \ | |
| #add google repository to apt source list to install google-chrome-unstable | |
| && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |
| && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |
| && apt-get update \ | |
| && apt-get install -y google-chrome-stable --no-install-recommends \ | |
| && pip install yq \ | |
| #clean python-pip | |
| && apt-get --purge autoremove -y python-pip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN node --version \ | |
| && npm --version \ | |
| && google-chrome --version | |
| ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=0 | |
| ENV CHROME_PATH="/opt/google/chrome/chrome" | |
| ENV PUPPETEER_EXECUTABLE_PATH="/opt/google/chrome/chrome" | |
| ENV PATH="/usr/local/lib/node_modules/global/node_modules/.bin/:$PATH" | |
| ADD . /wdio | |
| WORKDIR /wdio | |
| RUN npm i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run --rm -ti containername ./node_modules/.bin/wdio config.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment