-
Notifications
You must be signed in to change notification settings - Fork 136
Fix ScreenshotTest for different locales #12979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ScreenshotTest for different locales #12979
Conversation
| import org.hamcrest.Matchers | ||
|
|
||
| class SingleOrderScreen : Screen(R.id.orderStatus_subtitle) { | ||
| class SingleOrderScreen : Screen(R.id.orderDetail_container) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the language is set to Arabic, the test cannot find orderStatus_subtitle. This is likely because we use a different text view for RTL languages. Using orderDetail_container makes sense, as it is also used in goBackToOrdersScreen().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense, I think the cause that this used to work and not anymore could be linked to the tablet support and how it changed the screen layout.
Another possibility is to use orderRefreshLayout as it's the root layout of the screen, but I think both serve the same purpose here.
| while (currentAttempt < maxAttempts) { | ||
| try { | ||
| composeTestRule.onNodeWithContentDescription(getTranslatedString(R.string.settings)) | ||
| composeTestRule.onNodeWithContentDescription(getTranslatedString(R.string.more_menu_button_settings)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R.string.settings was not the correct string for the button but it was working since we use the same string for settings and more_menu_button_settings for all languages except for French.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
JorgeMucientes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this @irfano, ScreenshotTest ran well for both of the languages.
As per Arabic I tested the first option the system settings displayed. I presume any option should do as the issue was with RTL, so any language that would be RTL should do for the test I guess.
Closes: woocommerce/woomobile-private#393
Description
ScreenshotTestwas failing when the language is set to Arabic or French. This PR fixes these failures.Important
Do not merge now, we'll merge this as a beta fix for 21.2.
Steps to reproduce
ScreenshotTest.ScreenshotTest.The tests that have been performed
ScreenshotTestRELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: