Problem

When running chromedriver without arguments there is some environments that will fail to bind to a local port unless the --allowed-ips flag is passed.

Steps to reproduce

I attempted to run nightwatch tests inside a docker environment and chromedriver was not binding to the default port.
This can be reproduced running
docker run -it --rm selenium/standalone-chrome:97.0 chromedriver
and
docker run -it --rm selenium/standalone-chrome:97.0 chromedriver --allowed-ips
The later won't display
[1642762419.323][SEVERE]: bind() failed: Cannot assign requested address (99)
And will bind the proper port.

Proposed resolution

Allow the environment to be configured to specify this arguments

Remaining tasks

Add new enviroment variable DRUPAL_TEST_WEBDRIVER_CLI_ARG

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Added new DRUPAL_TEST_WEBDRIVER_CLI_ARG env variable to pass arguments to chromedriver

Issue fork drupal-3259751

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

rodrigoaguilera created an issue. See original summary.

rodrigoaguilera’s picture

Status: Active » Needs review

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work

Can the MR be updated to point to 10.1 please.

nod_’s picture

Also how is it different from DRUPAL_TEST_WEBDRIVER_CHROME_ARGS?

rodrigoaguilera’s picture

Status: Needs work » Needs review

Rebased agains 10.1.x.

The difference is the flags that are going to be passed to chromedriver or to chrome. As far as I remember struggling with this --allowed-ips is an option only for chromedriver.

nod_’s picture

Thanks, that makes sense to me.

The comment still needs work as the text and the variable name do not match. If someone is using firefox they would use the same variable to pass argument to the driver.

smustgrave’s picture

Updated comment.

nod_’s picture

Just remembered that we removed chromedriver from package Jason. We don't know where it's installed so we need to remove the sever_path arg

nod_’s picture

Status: Needs review » Needs work

after that it's good to go

smustgrave’s picture

Status: Needs work » Needs review

Removed server_path from nighwatch.config

nod_’s picture

Status: Needs review » Reviewed & tested by the community

Lgtm

alexpott’s picture

Version: 10.1.x-dev » 9.5.x-dev
Category: Feature request » Task
Status: Reviewed & tested by the community » Fixed

As a test only change backported to 9.5.x. We also allow you to configure this for PHPUnit using Webdriver so allowing it for Nightwatch makes sense. It doesn't apply to 9.4.x

Committed 594a227 and pushed to 10.1.x. Thanks!
Committed 13a1922 and pushed to 10.0.x. Thanks!
Committed db81f8f and pushed to 9.5.x. Thanks!

  • alexpott committed 594a227 on 10.1.x
    Issue #3259751 by rodrigoaguilera, smustgrave, nod_: Add ability to pass...

  • alexpott committed 13a1922 on 10.0.x
    Issue #3259751 by rodrigoaguilera, smustgrave, nod_: Add ability to pass...

  • alexpott committed db81f8f on 9.5.x
    Issue #3259751 by rodrigoaguilera, smustgrave, nod_: Add ability to pass...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.