For #26884 - Update tests to modify settings through the activity rules
This commit is contained in:
parent
0442695972
commit
d391d1bf95
|
@ -43,8 +43,7 @@ class MenuScreenShotTest : ScreenshotTest() {
|
|||
val localeTestRule = LocaleTestRule()
|
||||
|
||||
@get:Rule
|
||||
var mActivityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = mActivityTestRule.featureSettingsHelper
|
||||
var mActivityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -53,8 +52,6 @@ class MenuScreenShotTest : ScreenshotTest() {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -47,8 +47,7 @@ class BookmarksTest {
|
|||
}
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
|
@ -61,8 +60,6 @@ class BookmarksTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
package org.mozilla.fenix.ui
|
||||
|
||||
import androidx.core.net.toUri
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.R
|
||||
|
@ -26,20 +25,12 @@ class BrowsingErrorPagesTest {
|
|||
private val harmfulSiteWarning = getStringResource(R.string.mozac_browser_errorpages_safe_harmful_uri_title)
|
||||
|
||||
@get: Rule
|
||||
val mActivityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = mActivityTestRule.featureSettingsHelper
|
||||
val mActivityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
val retryTestRule = RetryTestRule(3)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
// disabling the jump-back-in pop-up that interferes with the tests.
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@SmokeTest
|
||||
@Test
|
||||
fun blockMalwarePageTest() {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
|
||||
import org.mozilla.fenix.ui.robots.browserScreen
|
||||
|
@ -35,23 +34,21 @@ class CollectionTest {
|
|||
private val firstCollectionName = "testcollection_1"
|
||||
private val secondCollectionName = "testcollection_2"
|
||||
private val collectionName = "First Collection"
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val composeTestRule = AndroidComposeTestRule(
|
||||
HomeActivityIntentTestRule(),
|
||||
{ it.activity },
|
||||
)
|
||||
// disabling these features to have better visibility of Collections,
|
||||
// and to avoid multiple matches on tab items
|
||||
HomeActivityIntentTestRule(
|
||||
isPocketEnabled = false,
|
||||
isJumpBackInCFREnabled = false,
|
||||
isRecentTabsFeatureEnabled = false,
|
||||
isRecentlyVisitedFeatureEnabled = false,
|
||||
),
|
||||
) { it.activity }
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
// disabling these features to have better visibility of Collections,
|
||||
// and to avoid multiple matches on tab items
|
||||
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
|
||||
featureSettingsHelper.setPocketEnabled(false)
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setRecentlyVisitedFeatureEnabled(false)
|
||||
|
||||
mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
mockWebServer = MockWebServer().apply {
|
||||
dispatcher = AndroidAssetDispatcher()
|
||||
|
@ -62,9 +59,6 @@ class CollectionTest {
|
|||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
|
||||
// resetting modified features enabled setting to default
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@SmokeTest
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.junit.Test
|
|||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.ext.settings
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RetryTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
|
@ -41,14 +40,12 @@ class ContextMenusTest {
|
|||
private lateinit var mockWebServer: MockWebServer
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule()
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
val retryTestRule = RetryTestRule(3)
|
||||
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
activityIntentTestRule.activity.applicationContext.settings().shouldShowJumpBackInCFR = false
|
||||
|
@ -57,14 +54,11 @@ class ContextMenusTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@SmokeTest
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.junit.Test
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper.getStringResource
|
||||
|
@ -22,21 +21,19 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
class CrashReportingTest {
|
||||
private lateinit var mDevice: UiDevice
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
private val tabCrashMessage = getStringResource(R.string.tab_crash_title_2)
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = AndroidComposeTestRule(
|
||||
HomeActivityIntentTestRule(),
|
||||
{ it.activity },
|
||||
)
|
||||
HomeActivityIntentTestRule(
|
||||
isPocketEnabled = false,
|
||||
isJumpBackInCFREnabled = false,
|
||||
isWallpaperOnboardingEnabled = false,
|
||||
),
|
||||
) { it.activity }
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setPocketEnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
|
||||
mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
mockWebServer = MockWebServer().apply {
|
||||
dispatcher = AndroidAssetDispatcher()
|
||||
|
@ -47,7 +44,6 @@ class CrashReportingTest {
|
|||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.junit.Test
|
|||
import org.mozilla.fenix.IntentReceiverActivity
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelperDelegate
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper.createCustomTabIntent
|
||||
|
@ -47,7 +47,7 @@ class CustomTabsTest {
|
|||
false,
|
||||
)
|
||||
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
private val featureSettingsHelper = FeatureSettingsHelperDelegate()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -57,7 +57,9 @@ class CustomTabsTest {
|
|||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.apply {
|
||||
isTCPCFREnabled = false
|
||||
}.applyFlagUpdates()
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -5,14 +5,11 @@
|
|||
package org.mozilla.fenix.ui
|
||||
|
||||
import androidx.core.net.toUri
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Parameterized
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.ui.robots.navigationToolbar
|
||||
|
||||
|
@ -27,10 +24,9 @@ class DownloadFileTypesTest(fileName: String) {
|
|||
/* Remote test page managed by Mozilla Mobile QA team at https://github.com/mozilla-mobile/testapp */
|
||||
private val downloadTestPage = "https://storage.googleapis.com/mobile_test_assets/test_app/downloads.html"
|
||||
private var downloadFile: String = fileName
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityIntentTestRule()
|
||||
val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
companion object {
|
||||
// Creating test data. The test will take each file name as a parameter and run it individually.
|
||||
|
@ -48,21 +44,6 @@ class DownloadFileTypesTest(fileName: String) {
|
|||
)
|
||||
}
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
// disabling the jump-back-in pop-up that interferes with the tests.
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
// disable the TCP CFR that appears when loading webpages and interferes with the tests.
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
// disabling the PWA CFR on 3rd visit
|
||||
featureSettingsHelper.disablePwaCFR(true)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@SmokeTest
|
||||
@Test
|
||||
fun downloadMultipleFileTypesTest() {
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.junit.rules.TestRule
|
|||
import org.junit.rules.TestWatcher
|
||||
import org.junit.runner.Description
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestHelper.deleteDownloadFromStorage
|
||||
import org.mozilla.fenix.ui.robots.browserScreen
|
||||
|
@ -34,14 +33,13 @@ import org.mozilla.fenix.ui.robots.notificationShade
|
|||
**/
|
||||
class DownloadTest {
|
||||
private lateinit var mDevice: UiDevice
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
/* Remote test page managed by Mozilla Mobile QA team at https://github.com/mozilla-mobile/testapp */
|
||||
private val downloadTestPage = "https://storage.googleapis.com/mobile_test_assets/test_app/downloads.html"
|
||||
private var downloadFile: String = ""
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityIntentTestRule()
|
||||
val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
// Making sure to grant storage access for this test running on API 28
|
||||
@get: Rule
|
||||
|
@ -62,12 +60,6 @@ class DownloadTest {
|
|||
@Before
|
||||
fun setUp() {
|
||||
mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
// disabling the jump-back-in pop-up that interferes with the tests.
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
// disable the TCP CFR that appears when loading webpages and interferes with the tests.
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
// disabling the PWA CFR on 3rd visit
|
||||
featureSettingsHelper.disablePwaCFR(true)
|
||||
// clear all existing notifications
|
||||
notificationShade {
|
||||
mDevice.openNotification()
|
||||
|
@ -77,7 +69,6 @@ class DownloadTest {
|
|||
|
||||
@After
|
||||
fun tearDown() {
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
notificationShade {
|
||||
cancelAllShownNotifications()
|
||||
}
|
||||
|
|
|
@ -39,8 +39,7 @@ class HistoryTest {
|
|||
private lateinit var mDevice: UiDevice
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -52,8 +51,6 @@ class HistoryTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -36,8 +36,7 @@ class HomeScreenTest {
|
|||
private lateinit var mockWebServer: MockWebServer
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
|
@ -51,8 +50,6 @@ class HomeScreenTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
@ -147,8 +144,10 @@ class HomeScreenTest {
|
|||
|
||||
@Test
|
||||
fun dismissOnboardingUsingHelpTest() {
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
activityTestRule.applySettingsExceptions {
|
||||
it.isJumpBackInCFREnabled = false
|
||||
it.isWallpaperOnboardingEnabled = false
|
||||
}
|
||||
|
||||
homeScreen {
|
||||
verifyWelcomeHeader()
|
||||
|
@ -175,8 +174,10 @@ class HomeScreenTest {
|
|||
|
||||
@Test
|
||||
fun verifyPocketHomepageStoriesTest() {
|
||||
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
|
||||
featureSettingsHelper.setRecentlyVisitedFeatureEnabled(false)
|
||||
activityTestRule.applySettingsExceptions {
|
||||
it.isRecentTabsFeatureEnabled = false
|
||||
it.isRecentlyVisitedFeatureEnabled = false
|
||||
}
|
||||
|
||||
homeScreen {
|
||||
}.dismissOnboarding()
|
||||
|
@ -196,8 +197,6 @@ class HomeScreenTest {
|
|||
@Test
|
||||
fun verifyCustomizeHomepageTest() {
|
||||
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
||||
import org.mozilla.fenix.helpers.RetryTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
|
@ -35,10 +34,9 @@ class MediaNotificationTest {
|
|||
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private lateinit var mDevice: UiDevice
|
||||
val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
private lateinit var browserStore: BrowserStore
|
||||
|
||||
@Rule
|
||||
|
@ -56,7 +54,6 @@ class MediaNotificationTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -34,8 +34,7 @@ class NavigationToolbarTest {
|
|||
|
||||
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -44,9 +43,6 @@ class NavigationToolbarTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.disablePwaCFR(true)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -6,7 +6,6 @@ package org.mozilla.fenix.ui
|
|||
|
||||
import androidx.core.net.toUri
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.R
|
||||
|
@ -26,14 +25,7 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
class NoNetworkAccessStartupTests {
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule(launchActivity = false)
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
}
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides(launchActivity = false)
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
|
@ -60,7 +52,6 @@ class NoNetworkAccessStartupTests {
|
|||
// Based on STR from https://github.com/mozilla-mobile/fenix/issues/16886
|
||||
@Test
|
||||
fun networkInterruptedFromBrowserToHomeTest() {
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
val url = "example.com"
|
||||
|
||||
activityTestRule.launchActivity(null)
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package org.mozilla.fenix.ui
|
||||
|
||||
import androidx.core.net.toUri
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.Constants.PackageName.GMAIL_APP
|
||||
import org.mozilla.fenix.helpers.Constants.PackageName.PHONE_APP
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestHelper.assertNativeAppOpens
|
||||
import org.mozilla.fenix.ui.robots.customTabScreen
|
||||
|
@ -16,8 +13,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
import org.mozilla.fenix.ui.robots.pwaScreen
|
||||
|
||||
class PwaTest {
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
/* Updated externalLinks.html to v2.0,
|
||||
changed the hypertext reference to mozilla-mobile.github.io/testapp/downloads for "External link"
|
||||
*/
|
||||
|
@ -27,18 +22,7 @@ class PwaTest {
|
|||
private val shortcutTitle = "TEST_APP"
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityIntentTestRule()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
featureSettingsHelper.disablePwaCFR(true)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@SmokeTest
|
||||
@Test
|
||||
|
|
|
@ -37,7 +37,7 @@ class ReaderViewTest {
|
|||
private val estimatedReadingTime = "1 - 2 minutes"
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule()
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
|
|
|
@ -49,10 +49,13 @@ class SearchTest {
|
|||
|
||||
@get:Rule
|
||||
val activityTestRule = AndroidComposeTestRule(
|
||||
HomeActivityTestRule(),
|
||||
{ it.activity },
|
||||
)
|
||||
private val featureSettingsHelper = activityTestRule.activityRule.featureSettingsHelper
|
||||
HomeActivityTestRule(
|
||||
isPocketEnabled = false,
|
||||
isJumpBackInCFREnabled = false,
|
||||
isTCPCFREnabled = false,
|
||||
isWallpaperOnboardingEnabled = false,
|
||||
),
|
||||
) { it.activity }
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -60,10 +63,6 @@ class SearchTest {
|
|||
dispatcher = SearchDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setPocketEnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.junit.Before
|
|||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RetryTestRule
|
||||
import org.mozilla.fenix.helpers.TestHelper.mDevice
|
||||
|
@ -30,7 +29,6 @@ class SettingsAboutTest {
|
|||
|
||||
private lateinit var mDevice: UiDevice
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule()
|
||||
|
@ -51,7 +49,6 @@ class SettingsAboutTest {
|
|||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
// Walks through settings menu and sub-menus to ensure all items are present
|
||||
|
@ -71,7 +68,9 @@ class SettingsAboutTest {
|
|||
// ABOUT
|
||||
@Test
|
||||
fun verifyRateOnGooglePlayRedirect() {
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
activityIntentTestRule.applySettingsExceptions {
|
||||
it.isTCPCFREnabled = false
|
||||
}
|
||||
|
||||
homeScreen {
|
||||
}.openThreeDotMenu {
|
||||
|
@ -86,8 +85,10 @@ class SettingsAboutTest {
|
|||
|
||||
@Test
|
||||
fun verifyAboutFirefoxPreview() {
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
activityIntentTestRule.applySettingsExceptions {
|
||||
it.isJumpBackInCFREnabled = false
|
||||
it.isTCPCFREnabled = false
|
||||
}
|
||||
homeScreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
|
|
|
@ -14,7 +14,6 @@ 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.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RecyclerViewIdlingResource
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getEnhancedTrackingProtectionAsset
|
||||
|
@ -31,10 +30,9 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
*/
|
||||
class SettingsAddonsTest {
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityIntentTestRule()
|
||||
val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -42,15 +40,11 @@ class SettingsAddonsTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
// Walks through settings add-ons menu to ensure all items are present
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper
|
||||
|
@ -30,10 +29,12 @@ class SettingsAdvancedTest {
|
|||
|
||||
private lateinit var mDevice: UiDevice
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule()
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule(
|
||||
isPocketEnabled = false,
|
||||
isTCPCFREnabled = false,
|
||||
)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -42,15 +43,11 @@ class SettingsAdvancedTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setPocketEnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
// Walks through settings menu and sub-menus to ensure all items are present
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.mozilla.fenix.FenixApplication
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RecyclerViewIdlingResource
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
|
@ -23,8 +22,8 @@ import org.mozilla.fenix.helpers.TestAssetHelper.getLoremIpsumAsset
|
|||
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeLong
|
||||
import org.mozilla.fenix.helpers.TestHelper.getStringResource
|
||||
import org.mozilla.fenix.helpers.TestHelper.mDevice
|
||||
import org.mozilla.fenix.helpers.TestHelper.runWithSystemLocaleChanged
|
||||
import org.mozilla.fenix.helpers.TestHelper.registerAndCleanupIdlingResources
|
||||
import org.mozilla.fenix.helpers.TestHelper.runWithSystemLocaleChanged
|
||||
import org.mozilla.fenix.ui.SettingsBasicsTest.CreditCard.MOCK_CREDIT_CARD_NUMBER
|
||||
import org.mozilla.fenix.ui.SettingsBasicsTest.CreditCard.MOCK_EXPIRATION_MONTH
|
||||
import org.mozilla.fenix.ui.SettingsBasicsTest.CreditCard.MOCK_EXPIRATION_YEAR
|
||||
|
@ -47,7 +46,6 @@ import java.util.Locale
|
|||
class SettingsBasicsTest {
|
||||
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
object CreditCard {
|
||||
const val MOCK_CREDIT_CARD_NUMBER = "5555555555554444"
|
||||
|
@ -58,7 +56,7 @@ class SettingsBasicsTest {
|
|||
}
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule()
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -66,18 +64,11 @@ class SettingsBasicsTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
|
||||
// resetting modified features enabled setting to default
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
private fun getUiTheme(): Boolean {
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RetryTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
|
||||
|
@ -27,10 +26,9 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
*/
|
||||
class SettingsHomepageTest {
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule(skipOnboarding = true)
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides(skipOnboarding = true)
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
|
@ -42,17 +40,11 @@ class SettingsHomepageTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
|
||||
// resetting modified features enabled setting to default
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -90,7 +82,9 @@ class SettingsHomepageTest {
|
|||
|
||||
@Test
|
||||
fun verifyRecentlyVisitedOptionTest() {
|
||||
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
|
||||
activityIntentTestRule.applySettingsExceptions {
|
||||
it.isRecentTabsFeatureEnabled = false
|
||||
}
|
||||
val genericURL = getGenericAsset(mockWebServer, 1)
|
||||
|
||||
navigationToolbar {
|
||||
|
@ -107,8 +101,10 @@ class SettingsHomepageTest {
|
|||
|
||||
@Test
|
||||
fun verifyPocketOptionTest() {
|
||||
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
|
||||
featureSettingsHelper.setRecentlyVisitedFeatureEnabled(false)
|
||||
activityIntentTestRule.applySettingsExceptions {
|
||||
it.isRecentTabsFeatureEnabled = false
|
||||
it.isRecentlyVisitedFeatureEnabled = false
|
||||
}
|
||||
val genericURL = getGenericAsset(mockWebServer, 1)
|
||||
|
||||
navigationToolbar {
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.junit.Test
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getStorageTestAsset
|
||||
|
@ -47,10 +46,9 @@ class SettingsPrivacyTest {
|
|||
private lateinit var mDevice: UiDevice
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val pageShortcutName = generateRandomString(5)
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityIntentTestRule(skipOnboarding = true)
|
||||
val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides(skipOnboarding = true)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -60,11 +58,6 @@ class SettingsPrivacyTest {
|
|||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
featureSettingsHelper.disablePwaCFR(true)
|
||||
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
|
||||
val autofillManager: AutofillManager =
|
||||
appContext.getSystemService(AutofillManager::class.java)
|
||||
|
@ -75,7 +68,6 @@ class SettingsPrivacyTest {
|
|||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
// Walks through settings privacy menu and sub-menus to ensure all items are present
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.SearchDispatcher
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
|
||||
|
@ -20,11 +19,10 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
class SettingsSearchTest {
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private lateinit var searchMockServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = AndroidComposeTestRule(
|
||||
HomeActivityIntentTestRule(),
|
||||
HomeActivityIntentTestRule.withDefaultSettingsOverrides(),
|
||||
) { it.activity }
|
||||
|
||||
@Before
|
||||
|
@ -33,17 +31,11 @@ class SettingsSearchTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
|
||||
// resetting modified features enabled setting to default
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -8,10 +8,11 @@ import android.Manifest
|
|||
import android.content.Context
|
||||
import android.hardware.camera2.CameraManager
|
||||
import android.media.AudioManager
|
||||
import android.os.Build
|
||||
import androidx.core.net.toUri
|
||||
import androidx.test.filters.SdkSuppress
|
||||
import androidx.test.rule.GrantPermissionRule
|
||||
import org.junit.Assume.assumeTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
|
@ -34,8 +35,12 @@ class SitePermissionsTest {
|
|||
private val micManager = appContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule(
|
||||
isJumpBackInCFREnabled = false,
|
||||
isPWAsPromptEnabled = false,
|
||||
isTCPCFREnabled = false,
|
||||
isDeleteSitePermissionsEnabled = true,
|
||||
)
|
||||
|
||||
@get:Rule
|
||||
val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant(
|
||||
|
@ -50,15 +55,7 @@ class SitePermissionsTest {
|
|||
@get: Rule
|
||||
val retryTestRule = RetryTestRule(3)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
// disabling the new homepage pop-up that interferes with the tests.
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.deleteSitePermissions(true)
|
||||
featureSettingsHelper.disablePwaCFR(true)
|
||||
}
|
||||
|
||||
@SdkSuppress(maxSdkVersion = Build.VERSION_CODES.P, codeName = "P")
|
||||
@SmokeTest
|
||||
@Test
|
||||
fun audioVideoPermissionChoiceOnEachRequestTest() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.mozilla.fenix.customannotations.SmokeTest
|
|||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.Constants.PackageName.YOUTUBE_APP
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelperDelegate
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RecyclerViewIdlingResource
|
||||
import org.mozilla.fenix.helpers.RetryTestRule
|
||||
|
@ -62,7 +62,7 @@ class SmokeTest {
|
|||
private lateinit var mockWebServer: MockWebServer
|
||||
private val customMenuItem = "TestMenuItem"
|
||||
private lateinit var browserStore: BrowserStore
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
private val featureSettingsHelper = FeatureSettingsHelperDelegate()
|
||||
|
||||
@get:Rule(order = 0)
|
||||
val activityTestRule = AndroidComposeTestRule(
|
||||
|
@ -88,9 +88,11 @@ class SmokeTest {
|
|||
browserStore = activityTestRule.activity.components.core.store
|
||||
|
||||
// disabling the new homepage pop-up that interferes with the tests.
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
featureSettingsHelper.apply {
|
||||
isJumpBackInCFREnabled = false
|
||||
isTCPCFREnabled = false
|
||||
isWallpaperOnboardingEnabled = false
|
||||
}.applyFlagUpdates()
|
||||
|
||||
mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
mockWebServer = MockWebServer().apply {
|
||||
|
@ -673,7 +675,6 @@ class SmokeTest {
|
|||
// caution when making changes to it, so they don't block the builds
|
||||
@Test
|
||||
fun noHistoryInPrivateBrowsingTest() {
|
||||
FeatureSettingsHelper().setTCPCFREnabled(false)
|
||||
val website = TestAssetHelper.getGenericAsset(mockWebServer, 1)
|
||||
|
||||
homeScreen {
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.ETPPolicy
|
||||
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.ui.robots.enhancedTrackingProtection
|
||||
|
@ -35,8 +36,12 @@ class StrictEnhancedTrackingProtectionTest {
|
|||
private lateinit var mockWebServer: MockWebServer
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule(
|
||||
isJumpBackInCFREnabled = false,
|
||||
isTCPCFREnabled = false,
|
||||
isWallpaperOnboardingEnabled = false,
|
||||
etpPolicy = ETPPolicy.STRICT,
|
||||
)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
|
@ -44,10 +49,6 @@ class StrictEnhancedTrackingProtectionTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
featureSettingsHelper.setStrictETPEnabled()
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -45,8 +45,7 @@ class TabbedBrowsingTest {
|
|||
|
||||
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
private val featureSettingsHelper = activityTestRule.featureSettingsHelper
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
|
@ -54,11 +53,6 @@ class TabbedBrowsingTest {
|
|||
|
||||
@Before
|
||||
fun setUp() {
|
||||
// disabling the new homepage pop-up that interferes with the tests.
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
|
||||
mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
mockWebServer = MockWebServer().apply {
|
||||
dispatcher = AndroidAssetDispatcher()
|
||||
|
@ -182,8 +176,10 @@ class TabbedBrowsingTest {
|
|||
@Test
|
||||
fun verifyUndoSnackBarTest() {
|
||||
// disabling these features because they interfere with the snackbar visibility
|
||||
featureSettingsHelper.setPocketEnabled(false)
|
||||
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
|
||||
activityTestRule.applySettingsExceptions {
|
||||
it.isPocketEnabled = false
|
||||
it.isRecentTabsFeatureEnabled = false
|
||||
}
|
||||
|
||||
val genericURL = TestAssetHelper.getGenericAsset(mockWebServer, 1)
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.junit.Before
|
|||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
||||
import org.mozilla.fenix.ui.robots.homeScreen
|
||||
|
||||
|
@ -23,15 +22,12 @@ class ThreeDotMenuMainTest {
|
|||
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
|
||||
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
mockWebServer = MockWebServer().apply {
|
||||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.junit.Test
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
|
||||
import org.mozilla.fenix.helpers.RetryTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
|
||||
|
@ -36,10 +35,9 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
|
|||
class TopSitesTest {
|
||||
private lateinit var mDevice: UiDevice
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
private val featureSettingsHelper = FeatureSettingsHelper()
|
||||
|
||||
@get:Rule
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule(skipOnboarding = true)
|
||||
val activityIntentTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides(skipOnboarding = true)
|
||||
|
||||
@get:Rule
|
||||
val retryTestRule = RetryTestRule(3)
|
||||
|
@ -51,16 +49,11 @@ class TopSitesTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
featureSettingsHelper.setJumpBackCFREnabled(false)
|
||||
featureSettingsHelper.setTCPCFREnabled(false)
|
||||
featureSettingsHelper.setShowWallpaperOnboarding(false)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
featureSettingsHelper.resetAllFeatureFlags()
|
||||
}
|
||||
|
||||
@SmokeTest
|
||||
|
|
Loading…
Reference in New Issue