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

Approach for testing multi-lingual sites using the domain as the language selection method #249

Open
nicrodgers opened this issue Feb 3, 2016 · 3 comments
Labels

Comments

@nicrodgers
Copy link

Is anyone using the Behat Drupal Extension to test multi-lingual sites using the domain as the language selection method? How did you approach it?

Up until our, our multi-lingual site detected language based on path, but we now have to change to domain based detection. Our existing test suite works fine with path-based detection, but now we need to update it to work with domain-based.

I am wondering how best to approach it, specifically:

  • base_url in behat.yml - set this to the default language?
  • testing language toggles work - currently we follow the toggle link and use 'And I should be on "es/some-page"' but this will need to be updated to check the domain has changed. Should we just make the URLs absolute, or is there a nicer way? If we had to make them absolute then we'd need to use a variable, as the domains are different depending on whether we're running the tests locally, on dev, or on staging.
  • tests that log in, do something, then change to a different language. Currently these work fine as the user remains logged in after the language change, because they stay on the same domain and the cookie is still set. However with domain based language, going to another language will mean you are not logged in on that site, so how do we get Behat to log us in to the new domain?

Any thoughts appreciated.

@jhedstrom
Copy link
Owner

Also related #184 and #93.

@mathiasselleslach
Copy link

@nicrodgers ,

Not sure if still relevant, but I was looking into the same a while back and used this as a base to go from: https://stackoverflow.com/a/13342710

@leymannx
Copy link

I'd close this in favor of I'd close this in favor of #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants