Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jonnyhocks opened this issue Mar 15, 2024 · 3 comments

Comments

@jonnyhocks
Copy link

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:

  • Set up a vanilla ddev project
  • add this repo's addon.
  • configure basic behat (I followed the instructions here)
  • Run the test and see that the tests run and pass.
  • Add a new alternative url to additional_hostnames in .ddev/config.yaml
  • Update behat.yml with the new url.
  • Run tests and see error as below:
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
Copy link

nicrodgers commented Aug 7, 2024

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)

@tame4tex
Copy link

See #52 for additional instructions added to the README

@weitzman
Copy link
Collaborator

weitzman commented Dec 6, 2024

Lets continue in the PE #52

@weitzman weitzman closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants