Problem/Motivation

Currently we are pinned to Nightwatch 2.4.2 because upgrading further broke CI, but maybe other infrastructure changes we have made mean we can upgrade now? Let's find out.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3494570

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

spokje’s picture

I tried this but also got shipwrecked on the Selenium session bit, probably some new config option we have to pass somewhere?

Oh, and all the resolutions we all love to hate in the package.json are there because of Nightwatch holding at 2.4.2.
If we get it higher, we can drop all of them AFAICT.

spokje’s picture

And as a side-note: This MR also seems to bump cspell from version "8.16.1" to version "8.17.1".
Perhaps by deleting the yarn.lock before doing a yarn install?

cpierce42’s picture

I've been experimenting with this in lando (wsl2, drupal 10.4) tying to upgrade nightwatchjs to version 3.11.0.
This ticket https://www.drupal.org/project/drupal/issues/3371963#comment-15134159 said it would be ported into D10.3+ but it did not get rolled in.

I am attempting to re-work the merge reqeust that was submitted and making it work but there is something missing.

I got it pretty close where it starts a selenium server but hangs:

Starting Selenium Server [selenium-server-4.20.0.jar] on port 9515...

Nothing else happens and the log file is blank.

Specifically to get to this point I preformed the following steps:
write a patch to allow changes from the above mentioned ticket to apply in composer
Install linux current chromium driver on both wsl and in the lando build_as_root apt install libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev

In my lando file I have a lot of changes:

  appserver:
    webroot: docroot
    xdebug: 'develop,debug'
    ssl: true
    config:
      php: .lando.php.ini
    build_as_root:
      # Nightwatch config
      - curl -sL https://deb.nodesource.com/setup_18.x | bash -
      - apt install libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev
      - apt-get install -y nodejs
      - npm install -g yarn
    run:
      - mkdir -p private/browsertest_output
      - yarn add @nightwatch/vrt --cwd /app/docroot/core
      - yarn add @nightwatch/selenium-server --cwd /app/docroot/core
      - yarn install --non-interactive --cwd /app/docroot/core
      # Override nightwatch config to our custom config that includes vrt
      # This will break on upgrade to drupal 11. Nightwatch tests will need to be upgraded to api v3
# copy my saved .env and config file into the core folder to ease of setup and testing
      - cp /app/Nightwatch/nightwatch.conf.js /app/docroot/core/tests/Drupal/Nightwatch/nightwatch.conf.js
      - cp /app/Nightwatch/.env /app/docroot/core/.env
    overrides:
      environment:
        # Support debugging CLI with Xdebug.
        PHP_IDE_CONFIG: "serverName=appserver"
        # nightwatch config, probably not needed as we have the .env file
        SIMPLETEST_BASE_URL: "https://mytest.lndo.site"
        SIMPLETEST_DB: "mariadb://drupal10:drupal10@database:3306/drupal10"
        BROWSERTEST_OUTPUT_DIRECTORY: '/app/docroot/sites/simpletest/browser_output'
        BROWSERTEST_OUTPUT_BASE_URL: 'https://mytest.lndo.site'
        MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless","--no-sandbox"]}}, "http://chrome:9515"]'        # Nightwatch
        DRUPAL_TEST_BASE_URL: 'https://mytest.lndo.site'
        DRUPAL_TEST_DOCKER: TRUE
        DRUPAL_TEST_DB_URL: 'mariadb://drupal10:drupal10@database:3306/drupal10'
        DRUPAL_TEST_WEBDRIVER_HOSTNAME: chrome
        DRUPAL_TEST_WEBDRIVER_PORT: 9515
        DRUPAL_TEST_CHROMEDRIVER_AUTOSTART: 'false'
        DRUPAL_TEST_WEBDRIVER_CHROME_ARGS: "--disable-gpu --headless --no-sandbox"
        DRUPAL_NIGHTWATCH_OUTPUT: ./reports/nightwatch
        DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
  chrome:
    type: compose
    scanner: false
    app_mount: false
    services:
      image: drupalci/chromedriver:production
      expose:
        - "9515"
        - "4444"
      volumes:
        - /dev/shm:/dev/shm
      security_opt:
        - seccomp:unconfined
      command: ["chromedriver",  "--log-path=/tmp/chromedriver.log", "--verbose", "--allowed-ips=", "--allowed-origins=*", "--whitelisted-ips="]
      external_links:
      - appserver:mytest.lndo.site

In the nightwatch.config.js file I changed the selenium start_process to true, added plugins:['@nightwatch/vrt']

quietone made their first commit to this issue’s fork.

longwave’s picture

At this stage in Drupal 10's life to me this is won't fix, I don't think it's worth spending any more effort on.

quietone’s picture

Status: Active » Closed (won't fix)

Yea, I was just checking if anything changed so that tests would pass. I neglected to come back and close this.

longwave and I agree that this is now a won't fix.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.