Add Chromedriver as a JavaScript dependency

Created on 9 October 2023, 11 months ago
Updated 11 October 2023, 11 months ago

In Drupal 9.5, Chromedriver was removed as a dependency. However, this is still required when running the Functional Javascript tests with PHPUNIT and should probably be in line with the version of Chrome used for testing. e.g.

image: drupalci/chromedriver:production

At the time of creating this patch, version was 106.0.5249.103

See https://www.drupal.org/project/drupal/issues/3317879 📌 Remove Chromedriver as a JavaScript dependency Fixed

I am creating a new issue as tests do not appear to be running there.

Feature request
Status

Closed: works as designed

Version

10.1

Component
PHPUnit 

Last updated about 1 hour ago

Created by

🇬🇧United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @2dareis2do
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MariaDB 10.3.22
    last update 11 months ago
    29,653 pass
  • 🇬🇧United Kingdom longwave UK

    This was deliberately removed, because some people are not using the drupalci/chromedriver container and run tests with other versions of Chrome, so it is left up to you to install the correct version of chromedriver now for local development. See https://www.drupal.org/node/3319135

  • 🇬🇧United Kingdom 2dareis2do

    Thanks @longwave

    Yes, you are right about running Nightwatch, but this is also used for running PHPUnit's Functional Javascript Tests, and the current (recommended) image for this is chrome=106.0.5249.103)

    e.g.

    image: drupalci/chromedriver:production

  • 🇬🇧United Kingdom longwave UK

    As the name implies, that container includes chromedriver (as well as Chrome); configure Mink to connect to the container on port 9515 where chromedriver runs, you don't need to run it separately.

    See https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-... for an example based on Docker Compose.

  • 🇬🇧United Kingdom 2dareis2do

    Thanks @longwave.

    You are right. I have updated my docker-compose.chromedriver.yaml file as per the instructions on the link you gave when running with ddev. e.g.

    version: '3.6'
    services:
      chromedriver:
        container_name: ddev-${DDEV_SITENAME}-chromedriver
        image: drupalci/chromedriver:production
        shm_size: '1gb'
        ulimits:
          core:
            soft: -1
            hard: -1
        ports:
          - "4444:4444"
          - "9515:9515"
        entrypoint:
          - chromedriver
          - "--log-path=/tmp/chromedriver.log"
          - "--verbose"
          - "--allowed-ips="
          - "--allowed-origins=*"
        labels:
        # These labels ensure this service is discoverable by ddev
          com.ddev.site-name: ${DDEV_SITENAME}
          com.ddev.approot: $DDEV_APPROOT
          com.ddev.app-url: ${DDEV_PRIMARY_URL}
          
      # This links the Chromedriver service to the web service defined
      # in the main docker-compose.yml, allowing applications running
      # in the web service to access the driver at `chromedriver`.
      web:
        links:
          - chromedriver:$DDEV_HOSTNAME

    Also removed chromedriver from core/package.json and re-ran yarn.

    Tests also appear to be running a bit quicker now.

  • Status changed to Closed: works as designed 11 months ago
Production build 0.71.5 2024