From 1a8155edfde58194ddfa9922623829d649023d4f Mon Sep 17 00:00:00 2001 From: AndiAJ Date: Tue, 11 May 2021 19:08:53 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/19468 and https://github.com/mozilla-mobile/fenix/issues/19478 fix intermittent UI tests --- .../org/mozilla/fenix/ui/robots/HomeScreenRobot.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HomeScreenRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HomeScreenRobot.kt index 51c354fbbc..b7c788bc03 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HomeScreenRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/HomeScreenRobot.kt @@ -314,9 +314,9 @@ class HomeScreenRobot { } fun openSearch(interact: SearchRobot.() -> Unit): SearchRobot.Transition { - navigationToolbar().perform(click()) - mDevice.findObject(UiSelector().resourceId("$packageName:id/search_wrapper")) + mDevice.findObject(UiSelector().resourceId("$packageName:id/toolbar")) .waitForExists(waitingTime) + navigationToolbar().perform(click()) SearchRobot().interact() return SearchRobot.Transition() @@ -376,7 +376,9 @@ class HomeScreenRobot { } fun openNavigationToolbar(interact: NavigationToolbarRobot.() -> Unit): NavigationToolbarRobot.Transition { - assertNavigationToolbar().perform(click()) + mDevice.findObject(UiSelector().resourceId("$packageName:id/toolbar")) + .waitForExists(waitingTime) + navigationToolbar().perform(click()) NavigationToolbarRobot().interact() return NavigationToolbarRobot.Transition() @@ -472,8 +474,7 @@ private fun assertKeyboardVisibility(isExpectedToBeVisible: Boolean) = .contains("mInputShown=true") ) -private fun navigationToolbar() = - onView(withId(R.id.toolbar_wrapper)) +private fun navigationToolbar() = onView(withId(R.id.toolbar)) private fun closeTabButton() = onView(withId(R.id.close_tab_button))