Bug 1807268 - Re-enable verifyShowClipboardSuggestionsToggleTest UI test r=jajohnson
[gecko.git] / mobile / android / fenix / app / src / androidTest / java / org / mozilla / fenix / ui / SettingsAboutTest.kt
blob3e37fb5e3b3ae7498c01fd43fa221fed602b3a39
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
8 import org.junit.Rule
9 import org.junit.Test
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
17 /**
18  *  Tests for verifying the main three dot menu options
19  *
20  */
22 class SettingsAboutTest : TestSetup() {
23     @get:Rule
24     val activityIntentTestRule = HomeActivityIntentTestRule()
26     @Rule
27     @JvmField
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
32     @Test
33     fun verifyAboutSettingsItemsTest() {
34         homeScreen {
35         }.openThreeDotMenu {
36         }.openSettings {
37             verifyAboutHeading()
38             verifyRateOnGooglePlay()
39             verifyAboutFirefoxPreview()
40         }
41     }
43     // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/246966
44     @Test
45     fun verifyRateOnGooglePlayButton() {
46         activityIntentTestRule.applySettingsExceptions {
47             it.isTCPCFREnabled = false
48         }
50         homeScreen {
51         }.openThreeDotMenu {
52         }.openSettings {
53             clickRateButtonGooglePlay()
54             verifyGooglePlayRedirect()
55             // press back to return to the app, or accept ToS if still visible
56             mDevice.pressBack()
57             dismissGooglePlayToS()
58         }
59     }
61     // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/246961
62     @Test
63     fun verifyAboutFirefoxMenuItems() {
64         activityIntentTestRule.applySettingsExceptions {
65             it.isJumpBackInCFREnabled = false
66             it.isTCPCFREnabled = false
67         }
68         homeScreen {
69         }.openThreeDotMenu {
70         }.openSettings {
71         }.openAboutFirefoxPreview {
72             verifyAboutFirefoxPreviewInfo()
73         }
74     }
77 private fun dismissGooglePlayToS() {
78     if (mDevice.findObject(UiSelector().textContains("Terms of Service")).exists()) {
79         mDevice.findObject(UiSelector().textContains("ACCEPT")).click()
80     }