From 22879b533eeda614287932e09f72f3ab78aeba93 Mon Sep 17 00:00:00 2001 From: mcarare Date: Mon, 2 Dec 2019 11:33:14 +0200 Subject: [PATCH] For #6881 Choose visible view when multiple views have same label text --- .../org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt index 225a363d0..1e228bae6 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt @@ -174,7 +174,8 @@ private fun threeDotMenuRecyclerViewExists() { onView(withId(R.id.mozac_browser_menu_recyclerView)).check(matches(isDisplayed())) } -private fun settingsButton() = onView(allOf(withText(R.string.settings))) +private fun settingsButton() = onView(allOf(withText(R.string.settings), + withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) private fun assertSettingsButton() = settingsButton() .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) @@ -255,6 +256,7 @@ private fun ShareALinkTitle() = private fun assertShareALinkTitle() = ShareALinkTitle() -private fun whatsNewButton() = onView(allOf(withText("What's New"))) +private fun whatsNewButton() = onView(allOf(withText("What's New"), + withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) private fun assertWhatsNewButton() = whatsNewButton() .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))