WordPress-Android icon indicating copy to clipboard operation
WordPress-Android copied to clipboard

[Screenshots] Mocked notifications are always in English

Open AliSoftware opened this issue 2 years ago • 2 comments

Parent: #17128

When running the WPScreenshotTest and JPScreenshotTest to capture Play Store screenshots, we mock the network requests, including the ones returning notifications to be shown in the Notifications tab.

Those mocks always return English copies though, which means that this screen shows notifications in English ("X and 5 others liked your post")… even when capturing screenshots for non-en-US locale.

This makes those screenshots inconsistent with the reality, and could make users think, looking at the Play Store screenshots, that the Notifications screen is not localized (while in the real, non-mocked world, they are).

5-reply-in-real-time

Warning: Those tests were run from the branch from this PR (which fixes screenshot automation). If you start working on this, make sure that either that PR has landed since, or that you cut your branch to fix this from this PR's branch, to benefit from the tooling fixes related to screenshots that I've made so far.

AliSoftware avatar Sep 06 '22 10:09 AliSoftware

This should be achievable fairly easily, in the worst case by having multiple files instead of one rest_v11_notifications.json (or should it be default-notifications.json - possibly, one of them is redundant 🤔), and by specifying the exact locale in the response template (in the first file we don't even mention locale, in the second it's a wildcard). I'm sure this is known to you @AliSoftware, just leaving this text here because I was curious where the mocks for notifications are, and how they look.

I guess (hope) this situation with completely untranslated text is only typical for notifications. For reviews, for example, the "connecting texts" (like '... left a review for ...' are not part of mocks and are generated by the app). The review text itself is not translated, however, and is a part of mocks - but I guess it's fine - displaying the review in the language it was written is something quite common.

pachlava avatar Sep 12 '22 09:09 pachlava

I actually didn't take the time to investigate which mock files were involved and if we already passed the locale as parameter, so this is great and useful info @pachlava , thanks!

AliSoftware avatar Sep 12 '22 16:09 AliSoftware