diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt index 576c6d01a5..964f65d45d 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt @@ -366,7 +366,7 @@ class BrowserRobot { } fun openNavigationToolbar(interact: NavigationToolbarRobot.() -> Unit): NavigationToolbarRobot.Transition { - + mDevice.waitForIdle(waitingTime) navURLBar().click() NavigationToolbarRobot().interact() diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt index 6386741927..8acea84782 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt @@ -29,6 +29,8 @@ import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.Until import androidx.test.uiautomator.Until.findObject import org.hamcrest.CoreMatchers.allOf +import org.hamcrest.CoreMatchers.anyOf +import org.hamcrest.CoreMatchers.containsString import org.mozilla.fenix.R import org.mozilla.fenix.helpers.TestAssetHelper import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime @@ -179,10 +181,21 @@ private fun tabMediaControlButton() = onView(withId(R.id.play_pause_button)) private fun closeTabButton() = onView(withId(R.id.mozac_browser_tabstray_close)) private fun assertCloseTabsButton(title: String) = - onView(allOf(withId(R.id.mozac_browser_tabstray_close), withContentDescription("Close tab $title"))) + onView( + allOf( + withId(R.id.mozac_browser_tabstray_close), + withContentDescription("Close tab $title") + ) + ) .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) -private fun normalBrowsingButton() = onView(withContentDescription("Open tabs")) +private fun normalBrowsingButton() = onView( + anyOf( + withContentDescription(containsString("open tabs. Tap to switch tabs.")), + withContentDescription(containsString("open tab. Tap to switch tabs.")) + ) +) + private fun privateBrowsingButton() = onView(withContentDescription("Private tabs")) private fun newTabButton() = onView(withId(R.id.new_tab_button)) private fun threeDotMenu() = onView(withId(R.id.tab_tray_overflow))