79614060

Date: 2025-05-09 11:57:28
Score: 0.5
Natty:
Report link

For Nightwatch, what I did was specify my driver to launch in the specific language/locale settings in the Nightwatch.conf.js file and then launch the test with the --env setting corresponding to that language.

I then leveraged a framework called i18next which let me use lookup keys in place of hardcoded strings in my tests so I didn't have to create multiple test files for each language. The test automatically detects which language the browser context is in and looks up the correct string values.

Multi-language testing in Nightwatch.js (tutorial video)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: EdgeCase