For #19415: fixed private browsing button visibility issue

upstream-sync
Oana Horvath 3 years ago
parent 0141d96465
commit 0877e4cbb7

@ -335,7 +335,11 @@ class HomeScreenRobot {
} }
fun togglePrivateBrowsingMode() { fun togglePrivateBrowsingMode() {
onView(ViewMatchers.withResourceName("privateBrowsingButton")) mDevice.findObject(UiSelector().resourceId("$packageName:id/privateBrowsingButton"))
.waitForExists(
waitingTime
)
privateBrowsingButton()
.perform(click()) .perform(click())
} }
@ -344,10 +348,10 @@ class HomeScreenRobot {
for (i in 1..5) { for (i in 1..5) {
mDevice.findObject(UiSelector().resourceId("$packageName:id/privateBrowsingButton")) mDevice.findObject(UiSelector().resourceId("$packageName:id/privateBrowsingButton"))
.waitForExists( .waitForExists(
waitingTime waitingTime
) )
onView(ViewMatchers.withResourceName("privateBrowsingButton")) privateBrowsingButton()
.perform(click()) .perform(click())
} }
@ -502,8 +506,8 @@ private fun assertHomeMenu() = onView(ViewMatchers.withResourceName("menuButton"
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomePrivateBrowsingButton() = private fun assertHomePrivateBrowsingButton() =
onView(ViewMatchers.withResourceName("privateBrowsingButton")) privateBrowsingButton()
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(isDisplayed()))
private fun assertHomeWordmark() = onView(ViewMatchers.withResourceName("wordmark")) private fun assertHomeWordmark() = onView(ViewMatchers.withResourceName("wordmark"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
@ -718,6 +722,8 @@ private fun assertShareTabsOverlay() {
onView(withId(R.id.share_tab_url)).check(matches(isDisplayed())) onView(withId(R.id.share_tab_url)).check(matches(isDisplayed()))
} }
private fun privateBrowsingButton() = onView(withId(R.id.privateBrowsingButton))
private fun tabMediaControlButton() = onView(withId(R.id.play_pause_button)) private fun tabMediaControlButton() = onView(withId(R.id.play_pause_button))
private fun collectionItem(title: String) = private fun collectionItem(title: String) =

Loading…
Cancel
Save