diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e09ca426..b1f545cd7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,14 +5,14 @@ orbs: defaults: &defaults machine: - image: ubuntu-2204:2022.10.1 + image: ubuntu-2204:2023.07.2 docker_layer_caching: false steps: - checkout - run: .circleci/build.sh - browser-tools/install-chrome: + chrome-version: 116.0.5845.96 replace-existing: true - - browser-tools/install-chromedriver - run: command: docker-compose run --rm test-acceptance.puppeteer working_directory: test diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9b3119d16..511f459da 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,7 +12,7 @@ jobs: push_to_registry: name: Build and push Docker image to Docker Hub runs-on: ubuntu-latest - + steps: - name: Check out the repo with latest code uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index 6f395ad96..d9f2a6be5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Download Playwright and its dependencies FROM mcr.microsoft.com/playwright:v1.35.1 +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # Installing the pre-required packages and libraries RUN apt-get update && \ @@ -9,14 +10,12 @@ RUN apt-get update && \ # 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/* +RUN apt-get update && apt-get install -y gnupg wget && \ + wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \ + echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \ + apt-get update && \ + apt-get install -y google-chrome-stable --no-install-recommends && \ + rm -rf /var/lib/apt/lists/* # Add pptr user. @@ -36,7 +35,8 @@ RUN ln -s /codecept/bin/codecept.js /usr/local/bin/codeceptjs RUN mkdir /tests WORKDIR /tests # Install puppeteer so it's available in the container. -RUN npm i puppeteer +RUN npm i puppeteer@21.1.1 +RUN google-chrome --version # Allow to pass argument to codecept run via env variable ENV CODECEPT_ARGS="" diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 0ff57bdd3..2f9893f69 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -56,15 +56,6 @@ services: - ..:/codecept - node_modules:/codecept/node_modules - test-runner: - build: .. - entrypoint: /codecept/node_modules/.bin/mocha - command: test/runner - working_dir: /codecept - volumes: - - ..:/codecept - - node_modules:/codecept/node_modules - test-acceptance.webdriverio: build: .. env_file: .env @@ -86,6 +77,7 @@ services: - CODECEPT_ARGS=-c codecept.Puppeteer.js --grep @Puppeteer depends_on: - php + - puppeteer-image volumes: - ./acceptance:/tests - ./data:/data @@ -153,5 +145,8 @@ services: - ..:/codecept - node_modules:/codecept/node_modules + puppeteer-image: + image: ghcr.io/puppeteer/puppeteer:21.1.1 + volumes: node_modules: