ddev / ddev-selenium-standalone-chrome

A DDEV service for running standalone Chrome
Apache License 2.0
31 stars 18 forks source link

Unable to run behat tests on a url that has been specified as an additional_hostname in ddev. #37

Open jonnyhocks opened 6 months ago

jonnyhocks commented 6 months ago

Hello,

Logging an issue here which we have discovered where its not possible to run behat tests using this addon where the base_url in the behat.yml config file is set to a url which is listed as an additional_hostname entry in the .ddev/config.yaml file.

Our scenario for doing this is because we have a website which uses domain-based localisation, and we added a behat specific url to the additional hostnames so that we can run behat tests on path-based localisation.

Steps to reproduce:

unknown error: net::ERR_CONNECTION_REFUSED
        (Session info: headless chrome=101.0.4951.41)
      Build info: version: '4.1.4', revision: '535d840ee2'
      System info: host: 'c951a4569d1f', ip: '192.168.155.2', os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.7-orbstack-00109-gd8500ae6683d', java.version: '11.0.14'
      Driver info: driver.version: unknown (WebDriver\Exception\UnknownError)
nicrodgers commented 1 month ago

Have a look at https://ddev.readthedocs.io/en/stable/users/usage/faq/#communicate-via-https

You'll need to create a .ddev/docker-compose.communicate.yaml file and put in it:

services:
  web:
    external_links:
      - "ddev-router:additional-hostname-a.ddev.site"
      - "ddev-router:additional-hostname-b.ddev.site"

(change 'web' to the name of the service that needs to access it)