forked from mozilla-mobile/firefox-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1873200 - New cookie banner blocker UI smoke tests
- Loading branch information
1 parent
e58472c
commit 486d24a
Showing
4 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
fenix/app/src/androidTest/java/org/mozilla/fenix/ui/CookieBannerBlockerTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.mozilla.fenix.ui | ||
|
||
import androidx.core.net.toUri | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.mozilla.fenix.customannotations.SmokeTest | ||
import org.mozilla.fenix.ext.settings | ||
import org.mozilla.fenix.helpers.AppAndSystemHelper.runWithCondition | ||
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule | ||
import org.mozilla.fenix.helpers.TestHelper.appContext | ||
import org.mozilla.fenix.ui.robots.homeScreen | ||
import org.mozilla.fenix.ui.robots.navigationToolbar | ||
|
||
/** | ||
* Tests for verifying the new Cookie banner blocker option and functionality. | ||
*/ | ||
class CookieBannerBlockerTest { | ||
@get:Rule | ||
val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides(skipOnboarding = true) | ||
|
||
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2419260 | ||
@SmokeTest | ||
@Test | ||
fun verifyCookieBannerBlockerSettingsOptionTest() { | ||
runWithCondition(appContext.settings().shouldUseCookieBannerPrivateMode) { | ||
homeScreen { | ||
}.openThreeDotMenu { | ||
}.openSettings { | ||
verifyCookieBannerBlockerButton(enabled = true) | ||
} | ||
} | ||
} | ||
|
||
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2419273 | ||
@SmokeTest | ||
@Test | ||
fun verifyCFRAfterBlockingTheCookieBanner() { | ||
runWithCondition(appContext.settings().shouldUseCookieBannerPrivateMode) { | ||
homeScreen { | ||
}.togglePrivateBrowsingMode() | ||
|
||
navigationToolbar { | ||
}.enterURLAndEnterToBrowser("voetbal24.be".toUri()) { | ||
waitForPageToLoad() | ||
verifyCookieBannerExists(exists = false) | ||
verifyCookieBannerBlockerCFRExists(exists = true) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters