Running Cypress with a localized Angular application #16816
LexanRed
started this conversation in
Show and Tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks,
I have a quick question about Cypress and i18n.
Currently e2e testing depends on the development build target by default, which works even if the app is localized.
If you specify the ci config, the devServerTarget is serve-static, which also works fine, as long as you do not localize.
If you activate i18n, the served content is not the application itself but rather a folder containing the different locales.
If you specify a base url which contains the path to the locale you want to test, it also works fine, as long as the physical path and the baseHref in Angular do not differ.
In our case it does not work out because our sourceLocal is en-US, but the baseHref for that language is /en, not /en-US.
How did you solve that problem? Is it possible to override the baseHref for e2e Testing? Or can you recommend a different http server than @nx/web:file-server which can handle a path and a baseHref?
Our i18n config looks like this:
Any ideas are very much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions