From 1e4b9190a4f0d048b79d48b4027f1f7b7ecfe299 Mon Sep 17 00:00:00 2001 From: AndiAJ Date: Thu, 26 Jan 2023 11:58:48 +0200 Subject: [PATCH] [fenix] Bug 1807298 - re-enable deleteAllSearchEnginesTest UI test --- .../mozilla/fenix/ui/SettingsSearchTest.kt | 60 +++++++++++++------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt index be8c1c4d65..50701a9b16 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt @@ -9,6 +9,7 @@ import org.junit.Rule import org.junit.Test import org.mozilla.fenix.R import org.mozilla.fenix.customannotations.SmokeTest +import org.mozilla.fenix.ext.settings import org.mozilla.fenix.helpers.AndroidAssetDispatcher import org.mozilla.fenix.helpers.HomeActivityIntentTestRule import org.mozilla.fenix.helpers.RecyclerViewIdlingResource @@ -17,6 +18,7 @@ import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset import org.mozilla.fenix.helpers.TestHelper import org.mozilla.fenix.helpers.TestHelper.appContext import org.mozilla.fenix.helpers.TestHelper.exitMenu +import org.mozilla.fenix.helpers.TestHelper.runWithCondition import org.mozilla.fenix.helpers.TestHelper.setTextToClipBoard import org.mozilla.fenix.ui.robots.homeScreen import org.mozilla.fenix.ui.robots.navigationToolbar @@ -376,7 +378,6 @@ class SettingsSearchTest { } } - @Ignore("Test failure caused by: https://bugzilla.mozilla.org/show_bug.cgi?id=1807298") // Expected for en-us defaults @Test fun deleteAllSearchEnginesTest() { @@ -384,23 +385,46 @@ class SettingsSearchTest { }.openThreeDotMenu { }.openSettings { }.openSearchSubMenu { - deleteMultipleSearchEngines( - "Google", - "Bing", - "Amazon.com", - "DuckDuckGo", - "eBay", - ) - verifyDefaultSearchEngine("Wikipedia") - verifyThreeDotButtonIsNotDisplayed("Wikipedia") - openAddSearchEngineMenu() - verifyAddSearchEngineListContains( - "Google", - "Bing", - "Amazon.com", - "DuckDuckGo", - "eBay", - ) + runWithCondition(!appContext.settings().showUnifiedSearchFeature) { + // If the feature is disabled run old steps. + deleteMultipleSearchEngines( + "Google", + "Bing", + "Amazon.com", + "DuckDuckGo", + "eBay", + ) + verifyDefaultSearchEngine("Wikipedia") + verifyThreeDotButtonIsNotDisplayed("Wikipedia") + openAddSearchEngineMenu() + verifyAddSearchEngineListContains( + "Google", + "Bing", + "Amazon.com", + "DuckDuckGo", + "eBay", + ) + } + runWithCondition(appContext.settings().showUnifiedSearchFeature) { + // Run steps suitable for the enabled unified search feature. + deleteMultipleSearchEngines( + "Google", + "Bing", + "Amazon.com", + "eBay", + "Wikipedia", + ) + verifyDefaultSearchEngine("DuckDuckGo") + verifyThreeDotButtonIsNotDisplayed("DuckDuckGo") + openAddSearchEngineMenu() + verifyAddSearchEngineListContains( + "Google", + "Bing", + "Amazon.com", + "eBay", + "Wikipedia", + ) + } } }