Skip to content

Commit bf2b204

Browse files
committed
e2e tests fix
1 parent ee44ca7 commit bf2b204

4 files changed

Lines changed: 196 additions & 200 deletions

File tree

test/test-e2e/Dockerfile

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,18 @@
1-
FROM node:20
1+
FROM ghcr.io/puppeteer/puppeteer:23
22

3-
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
4-
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
5-
# installs, work.
6-
RUN apt-get update \
7-
&& apt-get install -y wget gnupg \
8-
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
9-
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
10-
&& apt-get update \
11-
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
12-
--no-install-recommends \
13-
&& rm -rf /var/lib/apt/lists/*
14-
15-
# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
16-
# uncomment the following lines to have `dumb-init` as PID 1
17-
# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init
18-
# RUN chmod +x /usr/local/bin/dumb-init
19-
# ENTRYPOINT ["dumb-init", "--"]
20-
21-
# Uncomment to skip the chromium download when installing puppeteer. If you do,
22-
# you'll need to launch puppeteer with:
23-
# browser.launch({executablePath: 'google-chrome-stable'})
24-
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
3+
USER root
254
RUN mkdir -p /home/test
26-
RUN groupadd -r test && useradd -r -g test -G audio,video test \
27-
&& chown -R test:test /home/test
5+
RUN chown -R pptruser /home/test
286
WORKDIR /home/test
29-
USER test
7+
# Install Chrome for the root user: Codefresh runs the container as root
8+
RUN npx puppeteer browsers install chrome
9+
10+
USER pptruser
3011
COPY package.json .
3112
COPY yarn.lock .
3213
RUN yarn install --timeout 99999999
3314

15+
COPY --chown=pptruser . .
16+
ENV APP_URL=https://github.com
3417

35-
# Run everything after as non-privileged user.
36-
37-
38-
COPY --chown=test . .
39-
USER test
4018
CMD ["yarn", "test"]

test/test-e2e/docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "3"
2+
services:
3+
tests:
4+
image: test-e2e
5+
environment:
6+
- APP_URL=https://samples.test-ch.dev.metacell.us
7+
- USERNAME=sample@testuser.com
8+
- PASSWORD=test
9+
volumes:
10+
- ../../applications/samples/test/e2e:/home/test/__tests__/samples'

test/test-e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Filippo Ledda <filippo@metacell.us>",
33
"dependencies": {
44
"jest": "^28.1.0",
5-
"puppeteer": "22.14.0",
5+
"puppeteer": "^23.0.0",
66
"ts-jest": "^28.0.2",
77
"typescript": "^4.6.4"
88
},

0 commit comments

Comments
 (0)