From e7b2578a5a6fa8094cf7c6f71f350325e7e840b1 Mon Sep 17 00:00:00 2001 From: Aaron Train Date: Wed, 29 Sep 2021 16:27:34 -0400 Subject: [PATCH] [fenix] No issue: Fix AssertionError in openThreeDotMenu fix: ktlint --- .../org/mozilla/fenix/ui/robots/HomeScreenRobot.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 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 3ac6502073..c1006a420f 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 @@ -170,8 +170,17 @@ class HomeScreenRobot { } fun openThreeDotMenu(interact: ThreeDotMenuMainRobot.() -> Unit): ThreeDotMenuMainRobot.Transition { - mDevice.waitNotNull(Until.findObject(By.res("$packageName:id/menuButton")), waitingTime) - threeDotButton().perform(click()) + // Issue: https://github.com/mozilla-mobile/fenix/issues/21578 + try { + mDevice.waitNotNull( + Until.findObject(By.res("$packageName:id/menuButton")), + waitingTime + ) + } catch (e: AssertionError) { + mDevice.pressBack() + } finally { + threeDotButton().perform(click()) + } ThreeDotMenuMainRobot().interact() return ThreeDotMenuMainRobot.Transition()