-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Automatically scroll when needed when clicking in tests #6092
Conversation
* because the click never actually occurs (most likely due to some flakiness in | ||
* [androidx.test.espresso.action.ViewActions.click]). | ||
*/ | ||
fun clickOn(view: Matcher<View>, root: Matcher<Root>? = null, assertion: () -> Unit) { |
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.
Using this helper is advisable over the other clickOn
as it seems there's some flakiness in Espresso's ViewActions.click
that are resolved with this "try again on fail" approach.
} | ||
|
||
fun clickManuallyEnterProjectDetails(): ManualProjectCreatorDialogPage { | ||
scrollToAndClickText(org.odk.collect.strings.R.string.configure_manually) | ||
return ManualProjectCreatorDialogPage().assertOnPage() | ||
return clickOnString( |
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 change should resolve this flake.
This pulls out click interactions to a shared place and adds a fallback scroll when clicking fails so we don't need explicit methods for scrolling.