This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Whether or not we could run this tool in headless mode #315
Labels
help wanted
Extra attention is needed
Comments
We use xvfb to run it in headless mode true on a docker container. You can look at this tutorial from puppeteer: https://pptr.dev/guides/docker <- The docker file they use doesn't include the virtual frame buffer we need to run dappeteer on CI/CD. We modify this docker file by adding xvfb and other things we need to run dappeteer in headless mode. Here is our Dockerfile: FROM node:16-slim
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& 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 fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 xvfb xauth dbus dbus-x11 tightvncserver xfonts-base procps x11vnc python3 build-essential tini\
--no-install-recommends \
&& groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser \
&& chown -R pptruser:pptruser /home/pptruser \
&& rm -rf /var/lib/apt/lists/*
# RUN mkdir -p /home/pptruser
# RUN chown pptruser /home/pptruser
WORKDIR /home/pptruser
ADD package.json .
ADD yarn.lock .
RUN yarn install
WORKDIR /home/pptruser/node_modules/puppeteer
USER pptruser
RUN yarn run postinstall
WORKDIR /home/pptruser
ADD . .
USER root
RUN mkdir -p report
RUN chown -R pptruser /home/pptruser
USER pptruser
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/bin/xvfb-run", "yarn", "The name of your test case"] To run it uses # 1)
docker build -t { name } .
# 2)
docker run --rm -it --init { name } |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the problem
Whether or not we could run this tool in headless mode? How would we be able to integrate this application to a CI/CD system.
System:
The text was updated successfully, but these errors were encountered: