diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt index d0b47eb89..074f1efb5 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt @@ -46,9 +46,9 @@ class HomeScreenTest { verifyAddTabButton() verifyNoTabsOpenedHeader() verifyNoTabsOpenedText() - verifyCollectionsHeader() - verifyNoCollectionsHeader() - verifyNoCollectionsText() + verifyCollectionsHeaderIsNotShown() + verifyNoCollectionsHeaderIsNotShown() + verifyNoCollectionsTextIsNotShown() verifyHomeToolbar() verifyHomeComponent() } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt index 4675da8fb..89fc9526a 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt @@ -65,8 +65,8 @@ class TabbedBrowsingTest { verifyOpenTabsHeader() verifyNoTabsOpenedText() verifyNoTabsOpenedHeader() - verifyNoCollectionsText() - verifyNoCollectionsHeader() + verifyNoCollectionsTextIsNotShown() + verifyNoCollectionsHeaderIsNotShown() verifyAddTabButton() } @@ -83,6 +83,8 @@ class TabbedBrowsingTest { TestAssetHelper.waitingTime ) verifyExistingTabList() + verifyNoCollectionsHeader() + verifyNoCollectionsText() }.openTabsListThreeDotMenu { verifyCloseAllTabsButton() @@ -153,8 +155,8 @@ class TabbedBrowsingTest { verifyShareTabButton() verifySaveCollection() }.closeAllTabs { - verifyNoCollectionsHeader() - verifyNoCollectionsText() + verifyNoCollectionsHeaderIsNotShown() + verifyNoCollectionsTextIsNotShown() verifyNoTabsOpenedHeader() verifyNoTabsOpenedText() } 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 a1b34902f..359786eb7 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 @@ -55,6 +55,9 @@ class HomeScreenRobot { fun verifyCollectionsHeader() = assertCollectionsHeader() fun verifyNoCollectionsHeader() = assertNoCollectionsHeader() fun verifyNoCollectionsText() = assertNoCollectionsText() + fun verifyNoCollectionsHeaderIsNotShown() = assertNoCollectionsHeaderIsNotVisible() + fun verifyCollectionsHeaderIsNotShown() = assertCollectionsHeaderIsNotVisible() + fun verifyNoCollectionsTextIsNotShown() = assertNoCollectionsTextIsNotVisible() fun verifyNoTabsOpenedHeader() = assertNoTabsOpenedHeader() fun verifyHomeWordmark() = assertHomeWordmark() fun verifyHomeToolbar() = assertHomeToolbar() @@ -322,13 +325,29 @@ private fun assertNoCollectionsHeader() = onView(allOf(withText("No collections"))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) +private fun assertNoCollectionsHeaderIsNotVisible() = + onView(allOf(withText("No collections"))) + .check(doesNotExist()) + +private fun assertCollectionsHeaderIsNotVisible() = + onView(allOf(withText("Collections"))) + .check(doesNotExist()) + private fun assertNoCollectionsText() = + onView( + allOf( + withText("Collect the things that matter to you. To start, save open tabs to a new collection.") + ) + ) + .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) + +private fun assertNoCollectionsTextIsNotVisible() = onView( allOf( withText("Collect the things that matter to you. To start, save open tabs to a new collection.") ) ) - .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) + .check(doesNotExist()) private fun assertHomeComponent() = onView(ViewMatchers.withResourceName("sessionControlRecyclerView")) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))