-
Notifications
You must be signed in to change notification settings - Fork 16
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
UI Tests: Find in Page #2443
UI Tests: Find in Page #2443
Conversation
…n English phrase and update in test
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.
Explanation of changes outside of test case.
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.
An explanation of how we are checking for find highlighting without highlight marker accessibility data from the system find component, and how we are checking that the "find next" highlight is highlighting a difference occurrence in the text.
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 looks great to me @Halle!
"Couldn't find \"Find in Page\" statusField in a reasonable timeframe." | ||
) | ||
let statusFieldTextContent = try XCTUnwrap(statusField.value as? String) | ||
XCTAssertEqual(statusFieldTextContent, "1 of 4") // Note: this is not a localized test element, and it should have a localization strategy. |
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.
Would you have any recommendation for that? Is it possible that we import app localizations here? That would probably be tricky if at all possible. My thinking was that we could force the app to run in English and limit to testing English language.
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 is definitely tricky. As a general thing, I try to have as few as possible pass states that depend on an English phrase, because it flags up an area where we can predict that UX changes and improvements will change it in the future (which equals future UI test maintenance). That's one reason I try to avoid using English sample text or accessibility identifiers that are English phrases about the element, because it lets checks like this stand out so we can easily see them where they are part of a test.
But in this case, I thought this UI element was the good indicator from the outside of the app of whether occurrence counting and finding next were doing the right thing.
Localization was slightly imprecise, because what I really want is to make the test more robust over time by using the default language NSLocalizedString
and its tokenization to construct this comparison the same way that the string is constructed in English, so that the test keeps working when the string changes. For these tests its good to know as little about the app as we can get away with, but it might be a good compromise to add UserText.swift
to the target so that we can use its values in order to do more robust tests of textual UI.
(Edit: but I do think pinning the tests to English for now is a good idea!)
Task/Issue URL: https://app.asana.com/0/1199230911884351/1205717021705364/f
Tech Design URL:
CC:
Description: Adds a series of UI tests for Find in Page
Steps to test this PR: