Closes #20540: always swipe twice to openSettings in ThreeDotMenuMainRobot.

upstream-sync
Michael Comella 3 years ago committed by mergify[bot]
parent a07775f187
commit f7b85a6e95

@ -127,11 +127,11 @@ class ThreeDotMenuMainRobot {
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
fun openSettings(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition { fun openSettings(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
var maxSwipes = 3 // We require one swipe to display the full size 3-dot menu. On smaller devices
while (!settingsButton().exists() && maxSwipes != 0) { // such as the Pixel 2, we require two swipes to display the "Settings" menu item
threeDotMenuRecyclerView().perform(swipeUp()) // at the bottom. On larger devices, the second swipe is a no-op.
maxSwipes-- threeDotMenuRecyclerView().perform(swipeUp())
} threeDotMenuRecyclerView().perform(swipeUp())
settingsButton().click() settingsButton().click()
SettingsRobot().interact() SettingsRobot().interact()

Loading…
Cancel
Save