playwright: [BUG] Webkit and Firefox do not respect locale setting
Context:
- Playwright Version: latest
- Operating System: Win10
- Node.js version: LTS
- Browser: Webkit, Firefox
- Extra: [any specific details about your environment]
Describe the bug Our frontend application is built using Angular.
Every request it sends to the backend must have Accept-Language header, with short language value, e.g. cs. NOT cs-CZ - that is considered invalid, and backend will return HTTP error.
I have two issues:
-
when
localeis not explicitly set in the configuration, then Webkit and Firefox ignorecsvalue which should be set by application under test, and seten-USforAccept-Languageheader value. -
when
localeis explicitly set - either in config file, or usingtest.use()in the test, then it:- in the trace console log shows, that header value is
cs, BUT backend logs shows, that in reality it sendscs, cs-CZ. - Firefox will start sending correct request header intermittently, or after calling
page.reload() - Webkit will be still bugged
- in the trace console log shows, that header value is
This is currently a blocker for testing on these two browsers, since without backend data application cannot render needed content.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 14
- Comments: 23 (5 by maintainers)
Any news on this BUG? Maybe someone has found a good workaround?
hi @pavelfeldman any update on this? Is it possible to fix this? Or maybe enable an option to opt out from default enforced locale setting (which does not work correctly and is causing issues?)
I can also confirm the issue on my side :
localeis not respected by Firefox and Webkit, only Chromium is OK.timezoneIdis not respected either.On Firefox/Webkit & Chromium, my simple type date input has different placeholder, and give different formatted date value with wrong timezone.
Note the placeholders (“jj/mm/aaaa” or “mm/dd/yyyy”) and the locales of the browsers here
Also, I don’t know if
contextOptions.localeis supposed to be filled during tests, but its value is always undefined.Playwright Version: 1.31.1 Operating System: Xubuntu 22.04.2 LTS Node.js version: v16.19.1 Browser: Chromium, Webkit, Firefox
I think we have enough information to act.