Bug 1807268 - Re-enable verifyShowClipboardSuggestionsToggleTest UI test r=jajohnson
[gecko.git] / mobile / android / fenix / app / src / androidTest / java / org / mozilla / fenix / ui / GlobalPrivacyControlTest.kt
blob02e4cc2242746819f4e53ebe8761922e412ba5d1
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.fenix.ui
7 import org.junit.Before
8 import org.junit.Rule
9 import org.junit.Test
10 import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
11 import org.mozilla.fenix.helpers.TestAssetHelper.TestAsset
12 import org.mozilla.fenix.helpers.TestAssetHelper.getGPCTestAsset
13 import org.mozilla.fenix.helpers.TestSetup
14 import org.mozilla.fenix.ui.robots.homeScreen
15 import org.mozilla.fenix.ui.robots.navigationToolbar
17 /**
18  * Tests for Global Privacy Control setting.
19  */
21 class GlobalPrivacyControlTest : TestSetup() {
22     private lateinit var gpcPage: TestAsset
24     @get:Rule
25     val activityTestRule = HomeActivityIntentTestRule(
26         isJumpBackInCFREnabled = false,
27         isTCPCFREnabled = false,
28         isWallpaperOnboardingEnabled = false,
29         skipOnboarding = true,
30     )
32     @Before
33     override fun setUp() {
34         super.setUp()
35         gpcPage = getGPCTestAsset(mockWebServer)
36     }
38     // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2429327
39     @Test
40     fun testGPCinNormalBrowsing() {
41         navigationToolbar {
42         }.enterURLAndEnterToBrowser(gpcPage.url) {
43             verifyPageContent("GPC not enabled.")
44         }.openThreeDotMenu {
45         }.openSettings {
46         }.openEnhancedTrackingProtectionSubMenu {
47             scrollToGCPSettings()
48             verifyGPCTextWithSwitchWidget()
49             verifyGPCSwitchEnabled(false)
50             switchGPCToggle()
51         }.goBack {
52         }.goBackToBrowser {
53             verifyPageContent("GPC is enabled.")
54         }
55     }
57     // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2429364
58     @Test
59     fun testGPCinPrivateBrowsing() {
60         homeScreen { }.togglePrivateBrowsingMode()
61         navigationToolbar {
62         }.enterURLAndEnterToBrowser(gpcPage.url) {
63             verifyPageContent("GPC is enabled.")
64         }.openThreeDotMenu {
65         }.openSettings {
66         }.openEnhancedTrackingProtectionSubMenu {
67             scrollToGCPSettings()
68             verifyGPCTextWithSwitchWidget()
69             verifyGPCSwitchEnabled(false)
70             switchGPCToggle()
71         }.goBack {
72         }.goBackToBrowser {
73             verifyPageContent("GPC is enabled.")
74         }
75     }