nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

Feature: specify client's locale in tests #900

Closed nkbt closed 8 years ago

nkbt commented 8 years ago

I want to be able to set browser's locale for some of the tests to check that i18n works fine. I could not find any way to do so neither through Nightwatch nor Selenium.

I could do it by sending some arbitrary headers, but also could not find the way to do so.

Is it even possible? Feel free to close the case if not really, thank you!

beatfactor commented 8 years ago

There isn't a way to send headers from Nightwatch in a UI test.

One way you could do this in Firefox is to create a specific profile and specify the language (go into about:config and set intl.accept_languages). Then pass the name of the profile in nightwatch.json (see http://nightwatchjs.org/guide#selenium-settings).

nkbt commented 8 years ago

Thanks 👌 On Tue, 15 Mar 2016 at 8:10 PM, Andrei Rusu notifications@github.com wrote:

There isn't a way to send headers from Nightwatch in a UI test.

One way you could do this in Firefox is to create a specific profile and specify the language (go into about:config and set intl.accept_languages). Then pass the name of the profile in nightwatch.json (see http://nightwatchjs.org/guide#selenium-settings).

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub:

https://github.com/nightwatchjs/nightwatch/issues/900#issuecomment-196731199

DATADEER commented 7 years ago

Setup custom language in ChromeDriver with Nightwatchjs config https://gist.github.com/DATADEER/51da97498c03c804d75f4b3828cedb8c