-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
196 additions
and
200 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,18 @@ | ||
FROM node:20 | ||
FROM ghcr.io/puppeteer/puppeteer:23 | ||
|
||
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) | ||
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer | ||
# installs, work. | ||
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 \ | ||
--no-install-recommends \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise | ||
# uncomment the following lines to have `dumb-init` as PID 1 | ||
# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init | ||
# RUN chmod +x /usr/local/bin/dumb-init | ||
# ENTRYPOINT ["dumb-init", "--"] | ||
|
||
# Uncomment to skip the chromium download when installing puppeteer. If you do, | ||
# you'll need to launch puppeteer with: | ||
# browser.launch({executablePath: 'google-chrome-stable'}) | ||
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
USER root | ||
RUN mkdir -p /home/test | ||
RUN groupadd -r test && useradd -r -g test -G audio,video test \ | ||
&& chown -R test:test /home/test | ||
RUN chown -R pptruser /home/test | ||
WORKDIR /home/test | ||
USER test | ||
# Install Chrome for the root user: Codefresh runs the container as root | ||
RUN npx puppeteer browsers install chrome | ||
|
||
USER pptruser | ||
COPY package.json . | ||
COPY yarn.lock . | ||
RUN yarn install --timeout 99999999 | ||
|
||
COPY --chown=pptruser . . | ||
ENV APP_URL=https://github.com | ||
|
||
# Run everything after as non-privileged user. | ||
|
||
|
||
COPY --chown=test . . | ||
USER test | ||
CMD ["yarn", "test"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3" | ||
services: | ||
tests: | ||
image: test-e2e | ||
environment: | ||
- APP_URL=https://samples.test-ch.dev.metacell.us | ||
- [email protected] | ||
- PASSWORD=test | ||
volumes: | ||
- ../../applications/samples/test/e2e:/home/test/__tests__/samples' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"author": "Filippo Ledda <[email protected]>", | ||
"dependencies": { | ||
"jest": "^28.1.0", | ||
"puppeteer": "22.14.0", | ||
"puppeteer": "^23.0.0", | ||
"ts-jest": "^28.0.2", | ||
"typescript": "^4.6.4" | ||
}, | ||
|
Oops, something went wrong.