From 48079720897d84cfa39b89bd547667a16447f42e Mon Sep 17 00:00:00 2001 From: Oana Horvath Date: Mon, 1 Nov 2021 11:00:42 +0200 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/21397: disabled homescreen features to improve collections visibility --- .../java/org/mozilla/fenix/ui/CollectionTest.kt | 14 +++++++++----- .../java/org/mozilla/fenix/ui/SmokeTest.kt | 10 ++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/CollectionTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/CollectionTest.kt index 3062db3909..c5e0b71e32 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/CollectionTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/CollectionTest.kt @@ -9,11 +9,10 @@ import androidx.test.uiautomator.UiDevice import okhttp3.mockwebserver.MockWebServer import org.junit.After import org.junit.Before -import org.junit.Ignore import org.junit.Rule import org.junit.Test -import org.mozilla.fenix.ext.settings import org.mozilla.fenix.helpers.AndroidAssetDispatcher +import org.mozilla.fenix.helpers.FeatureSettingsHelper import org.mozilla.fenix.helpers.HomeActivityTestRule import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset import org.mozilla.fenix.ui.robots.browserScreen @@ -34,13 +33,17 @@ class CollectionTest { private lateinit var mockWebServer: MockWebServer private val firstCollectionName = "testcollection_1" private val secondCollectionName = "testcollection_2" + private val featureSettingsHelper = FeatureSettingsHelper() @get:Rule val activityTestRule = HomeActivityTestRule() @Before fun setUp() { - activityTestRule.activity.applicationContext.settings().shouldShowJumpBackInCFR = false + // disabling these features to have better visibility of Collections + featureSettingsHelper.setRecentTabsFeatureEnabled(false) + featureSettingsHelper.setPocketEnabled(false) + featureSettingsHelper.setJumpBackCFREnabled(false) mockWebServer = MockWebServer().apply { dispatcher = AndroidAssetDispatcher() @@ -51,6 +54,9 @@ class CollectionTest { @After fun tearDown() { mockWebServer.shutdown() + + // resetting modified features enabled setting to default + featureSettingsHelper.resetAllFeatureFlags() } @Test @@ -81,7 +87,6 @@ class CollectionTest { } @Test - @Ignore("https://github.com/mozilla-mobile/fenix/issues/21397") fun verifyAddTabButtonOfCollectionMenu() { val firstWebPage = getGenericAsset(mockWebServer, 1) val secondWebPage = getGenericAsset(mockWebServer, 2) @@ -108,7 +113,6 @@ class CollectionTest { } @Test - @Ignore("https://github.com/mozilla-mobile/fenix/issues/21397") fun renameCollectionTest() { val webPage = getGenericAsset(mockWebServer, 1) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt index a6860522d8..f4ac2968dc 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt @@ -823,8 +823,11 @@ class SmokeTest { } @Test - @Ignore("https://github.com/mozilla-mobile/fenix/issues/21397") fun createFirstCollectionTest() { + // disabling these features to have better visibility of Collections + featureSettingsHelper.setRecentTabsFeatureEnabled(false) + featureSettingsHelper.setPocketEnabled(false) + val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1) val secondWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 2) @@ -855,8 +858,11 @@ class SmokeTest { } @Test - @Ignore("https://github.com/mozilla-mobile/fenix/issues/21397") fun verifyExpandedCollectionItemsTest() { + // disabling these features to have better visibility of Collections + featureSettingsHelper.setRecentTabsFeatureEnabled(false) + featureSettingsHelper.setPocketEnabled(false) + val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1) navigationToolbar {