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
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
18 * Tests for Global Privacy Control setting.
21 class GlobalPrivacyControlTest : TestSetup() {
22 private lateinit var gpcPage: TestAsset
25 val activityTestRule = HomeActivityIntentTestRule(
26 isJumpBackInCFREnabled = false,
27 isTCPCFREnabled = false,
28 isWallpaperOnboardingEnabled = false,
29 skipOnboarding = true,
33 override fun setUp() {
35 gpcPage = getGPCTestAsset(mockWebServer)
38 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2429327
40 fun testGPCinNormalBrowsing() {
42 }.enterURLAndEnterToBrowser(gpcPage.url) {
43 verifyPageContent("GPC not enabled.")
46 }.openEnhancedTrackingProtectionSubMenu {
48 verifyGPCTextWithSwitchWidget()
49 verifyGPCSwitchEnabled(false)
53 verifyPageContent("GPC is enabled.")
57 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2429364
59 fun testGPCinPrivateBrowsing() {
60 homeScreen { }.togglePrivateBrowsingMode()
62 }.enterURLAndEnterToBrowser(gpcPage.url) {
63 verifyPageContent("GPC is enabled.")
66 }.openEnhancedTrackingProtectionSubMenu {
68 verifyGPCTextWithSwitchWidget()
69 verifyGPCSwitchEnabled(false)
73 verifyPageContent("GPC is enabled.")