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 androidx.test.uiautomator.UiSelector
10 import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
11 import org.mozilla.fenix.helpers.RetryTestRule
12 import org.mozilla.fenix.helpers.TestHelper.mDevice
13 import org.mozilla.fenix.helpers.TestSetup
14 import org.mozilla.fenix.ui.robots.clickRateButtonGooglePlay
15 import org.mozilla.fenix.ui.robots.homeScreen
18 * Tests for verifying the main three dot menu options
22 class SettingsAboutTest : TestSetup() {
24 val activityIntentTestRule = HomeActivityIntentTestRule()
28 val retryTestRule = RetryTestRule(3)
30 // Walks through the About settings menu to ensure all items are present
31 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2092700
33 fun verifyAboutSettingsItemsTest() {
38 verifyRateOnGooglePlay()
39 verifyAboutFirefoxPreview()
43 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/246966
45 fun verifyRateOnGooglePlayButton() {
46 activityIntentTestRule.applySettingsExceptions {
47 it.isTCPCFREnabled = false
53 clickRateButtonGooglePlay()
54 verifyGooglePlayRedirect()
55 // press back to return to the app, or accept ToS if still visible
57 dismissGooglePlayToS()
61 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/246961
63 fun verifyAboutFirefoxMenuItems() {
64 activityIntentTestRule.applySettingsExceptions {
65 it.isJumpBackInCFREnabled = false
66 it.isTCPCFREnabled = false
71 }.openAboutFirefoxPreview {
72 verifyAboutFirefoxPreviewInfo()
77 private fun dismissGooglePlayToS() {
78 if (mDevice.findObject(UiSelector().textContains("Terms of Service")).exists()) {
79 mDevice.findObject(UiSelector().textContains("ACCEPT")).click()