Add tests for verifying basic UI functionality of Enhanced Tracking Protectionfennec/nightly
parent
71880705df
commit
4a2cb91ad9
@ -0,0 +1,41 @@
|
||||
<!-- https://github.com/mozilla/dummytracker -->
|
||||
<!-- https://github.com/englehardt/englehardt.github.io/tree/master/test/trackingprotection/test_pages -->
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test for each list will say "Blocked" if Firefox is blocking resources from that list.</p>
|
||||
<p>Fingerprinting (base-fingerprinting-track-digest256):</p>
|
||||
<img
|
||||
src="https://base-fingerprinting-track-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
<br/>
|
||||
<p>Cryptomining (base-cryptomining-track-digest256):</p>
|
||||
<img
|
||||
src="https://base-cryptomining-track-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
<br/>
|
||||
<p>Basic Tracking Protection List (base-track-digest256):</p>
|
||||
<img
|
||||
src="https://base-track-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
<p>STP Tracker blocking (social-tracking-protection-digest256)</p>
|
||||
<img
|
||||
src="https://social-tracking-protection-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
<p>social-track-digest256:</p>
|
||||
<img
|
||||
src="https://social-track-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
<br/>
|
||||
<p>ads-track-digest256:</p>
|
||||
<img
|
||||
src="https://ads-track-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
<br/>
|
||||
<p>analytics-track-digest256:</p>
|
||||
<img
|
||||
src="https://analytics-track-digest256.dummytracker.org/test_not_blocked.png"
|
||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,205 @@
|
||||
/* 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.test.platform.app.InstrumentationRegistry
|
||||
import okhttp3.mockwebserver.MockWebServer
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper
|
||||
import org.mozilla.fenix.ui.robots.enhancedTrackingProtection
|
||||
import org.mozilla.fenix.ui.robots.homeScreen
|
||||
import org.mozilla.fenix.ui.robots.navigationToolbar
|
||||
import org.mozilla.fenix.ui.robots.settingsSubMenuEnhancedTrackingProtection
|
||||
|
||||
/**
|
||||
* Tests for verifying basic UI functionality of Enhanced Tracking Protection
|
||||
*
|
||||
* Including
|
||||
* - Verifying default states
|
||||
* - Verifying Enhanced Tracking Protection notification bubble
|
||||
* - Verifying Enhanced Tracking Protection notification shield
|
||||
* - Verifying Enhanced Tracking Protection content sheet
|
||||
* - Verifying Enhanced Tracking Protection content sheet details
|
||||
* - Verifying Enhanced Tracking Protection toggle
|
||||
* - Verifying Enhanced Tracking Protection site exceptions
|
||||
*/
|
||||
|
||||
class EnhancedTrackingProtectionTest {
|
||||
private lateinit var mockWebServer: MockWebServer
|
||||
|
||||
@get:Rule
|
||||
val activityTestRule = HomeActivityTestRule()
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
mockWebServer = MockWebServer().apply {
|
||||
setDispatcher(AndroidAssetDispatcher())
|
||||
start()
|
||||
}
|
||||
|
||||
// Reset on-boarding notification for each test
|
||||
TestHelper.setPreference(
|
||||
InstrumentationRegistry.getInstrumentation().context,
|
||||
"pref_key_tracking_protection_onboarding", 0
|
||||
)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
mockWebServer.shutdown()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSettingsDefaults() {
|
||||
homeScreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
verifyEnhancedTrackingProtectionButton()
|
||||
verifyEnhancedTrackingProtectionValue("On")
|
||||
}.openEnhancedTrackingProtectionSubMenu {
|
||||
verifyEnhancedTrackingProtectionHeader()
|
||||
verifyEnhancedTrackingProtectionOptions()
|
||||
verifyEnhancedTrackingProtectionDefaults()
|
||||
}.openExceptions {
|
||||
verifyDefault()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStrictVisitContentNotification() {
|
||||
val trackingProtectionTest =
|
||||
TestAssetHelper.getEnhancedTrackingProtectionAsset(mockWebServer)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(trackingProtectionTest.url) {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionNotice()
|
||||
}.closeNotificationPopup {}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStrictVisitContentShield() {
|
||||
val trackingProtectionTest =
|
||||
TestAssetHelper.getEnhancedTrackingProtectionAsset(mockWebServer)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(trackingProtectionTest.url) {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionNotice()
|
||||
}.closeNotificationPopup {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionShield()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStrictVisitProtectionSheet() {
|
||||
val trackingProtectionTest =
|
||||
TestAssetHelper.getEnhancedTrackingProtectionAsset(mockWebServer)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(trackingProtectionTest.url) {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionNotice()
|
||||
}.closeNotificationPopup {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionShield()
|
||||
}.openEnhancedTrackingProtectionSheet {
|
||||
verifyEnhancedTrackingProtectionSheetStatus("ON", true)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStrictVisitDisable() {
|
||||
val trackingProtectionTest =
|
||||
TestAssetHelper.getEnhancedTrackingProtectionAsset(mockWebServer)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(trackingProtectionTest.url) {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionNotice()
|
||||
}.closeNotificationPopup {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionShield()
|
||||
}.openEnhancedTrackingProtectionSheet {
|
||||
verifyEnhancedTrackingProtectionSheetStatus("ON", true)
|
||||
}.disableEnhancedTrackingProtectionFromSheet {
|
||||
verifyEnhancedTrackingProtectionSheetStatus("OFF", false)
|
||||
}.closeEnhancedTrackingProtectionSheet {}
|
||||
|
||||
// Verify that Enhanced Tracking Protection remains globally enabled
|
||||
navigationToolbar {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
verifyEnhancedTrackingProtectionValue("On")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStrictVisitDisableExceptionToggle() {
|
||||
val trackingProtectionTest =
|
||||
TestAssetHelper.getEnhancedTrackingProtectionAsset(mockWebServer)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(trackingProtectionTest.url) {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionNotice()
|
||||
}.closeNotificationPopup {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionShield()
|
||||
}.openEnhancedTrackingProtectionSheet {
|
||||
verifyEnhancedTrackingProtectionSheetStatus("ON", true)
|
||||
}.disableEnhancedTrackingProtectionFromSheet {
|
||||
verifyEnhancedTrackingProtectionSheetStatus("OFF", false)
|
||||
}.openProtectionSettings {
|
||||
verifyEnhancedTrackingProtectionHeader()
|
||||
verifyEnhancedTrackingProtectionOptions()
|
||||
verifyEnhancedTrackingProtectionDefaults()
|
||||
}
|
||||
|
||||
settingsSubMenuEnhancedTrackingProtection {
|
||||
}.openExceptions {
|
||||
verifyListedURL(trackingProtectionTest.url.toString())
|
||||
}.disableExceptions {
|
||||
verifyDefault()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStrictVisitSheetDetails() {
|
||||
val trackingProtectionTest =
|
||||
TestAssetHelper.getEnhancedTrackingProtectionAsset(mockWebServer)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(trackingProtectionTest.url) {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionNotice()
|
||||
}.closeNotificationPopup {}
|
||||
|
||||
enhancedTrackingProtection {
|
||||
verifyEnhancedTrackingProtectionShield()
|
||||
}.openEnhancedTrackingProtectionSheet {
|
||||
verifyEnhancedTrackingProtectionSheetStatus("ON", true)
|
||||
}.openDetails {
|
||||
verifyEnhancedTrackingProtectionDetailsStatus("Blocked")
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
/* 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/. */
|
||||
|
||||
@file:Suppress("TooManyFunctions")
|
||||
|
||||
package org.mozilla.fenix.ui.robots
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.assertion.ViewAssertions
|
||||
import androidx.test.espresso.matcher.ViewMatchers
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.click
|
||||
import org.mozilla.fenix.helpers.ext.waitNotNull
|
||||
import org.mozilla.fenix.helpers.isChecked
|
||||
|
||||
/**
|
||||
* Implementation of Robot Pattern for Enhanced Tracking Protection UI.
|
||||
*/
|
||||
class EnhancedTrackingProtectionRobot {
|
||||
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())!!
|
||||
|
||||
fun verifyEnhancedTrackingProtectionNotice() = assertEnhancedTrackingProtectionNotice()
|
||||
|
||||
fun verifyEnhancedTrackingProtectionShield() = assertEnhancedTrackingProtectionShield()
|
||||
|
||||
fun verifyEnhancedTrackingProtectionSheetStatus(status: String, state: Boolean) =
|
||||
assertEnhancedTrackingProtectionSheetStatus(status, state)
|
||||
|
||||
fun verifyEnhancedTrackingProtectionDetailsStatus(status: String) =
|
||||
assertEnhancedTrackingProtectionDetailsStatus(status)
|
||||
|
||||
class Transition {
|
||||
fun openEnhancedTrackingProtectionSheet(interact: EnhancedTrackingProtectionRobot.() -> Unit): Transition {
|
||||
openEnhancedTrackingProtectionSheet().click()
|
||||
|
||||
EnhancedTrackingProtectionRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
|
||||
fun closeNotificationPopup(interact: BrowserRobot.() -> Unit): Transition {
|
||||
closeButton().click()
|
||||
|
||||
BrowserRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
|
||||
fun closeEnhancedTrackingProtectionSheet(interact: BrowserRobot.() -> Unit): Transition {
|
||||
// Back out of the Enhanced Tracking Protection sheet
|
||||
mDevice.pressBack()
|
||||
|
||||
BrowserRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
|
||||
fun disableEnhancedTrackingProtectionFromSheet(interact: EnhancedTrackingProtectionRobot.() -> Unit): Transition {
|
||||
disableEnhancedTrackingProtection().click()
|
||||
|
||||
EnhancedTrackingProtectionRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
|
||||
fun openProtectionSettings(interact: SettingsSubMenuEnhancedTrackingProtectionRobot.() -> Unit): Transition {
|
||||
openEnhancedTrackingProtectionSettings().click()
|
||||
|
||||
SettingsSubMenuEnhancedTrackingProtectionRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
|
||||
fun openDetails(interact: EnhancedTrackingProtectionRobot.() -> Unit): Transition {
|
||||
openEnhancedTrackingProtectionDetails().click()
|
||||
|
||||
EnhancedTrackingProtectionRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun enhancedTrackingProtection(interact: EnhancedTrackingProtectionRobot.() -> Unit): EnhancedTrackingProtectionRobot.Transition {
|
||||
EnhancedTrackingProtectionRobot().interact()
|
||||
return EnhancedTrackingProtectionRobot.Transition()
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionNotice() {
|
||||
mDevice.waitNotNull(
|
||||
Until.findObject(By.res("org.mozilla.fenix.debug:id/onboarding_message")),
|
||||
TestAssetHelper.waitingTime
|
||||
)
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionShield() {
|
||||
mDevice.waitNotNull(
|
||||
Until.findObjects(By.descContains("Tracking Protection has blocked trackers"))
|
||||
)
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionSheetStatus(status: String, state: Boolean) {
|
||||
mDevice.waitNotNull(Until.findObjects(By.textContains(status)))
|
||||
onView(ViewMatchers.withResourceName("switch_widget")).check(
|
||||
ViewAssertions.matches(
|
||||
isChecked(
|
||||
state
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionDetailsStatus(status: String) {
|
||||
mDevice.waitNotNull(Until.findObjects(By.textContains(status)))
|
||||
}
|
||||
|
||||
private fun closeButton() = onView(ViewMatchers.withId(R.id.close_onboarding))
|
||||
|
||||
private fun openEnhancedTrackingProtectionSheet() =
|
||||
onView(ViewMatchers.withId(R.id.mozac_browser_toolbar_tracking_protection_indicator))
|
||||
|
||||
private fun disableEnhancedTrackingProtection() =
|
||||
onView(ViewMatchers.withResourceName("switch_widget"))
|
||||
|
||||
private fun openEnhancedTrackingProtectionSettings() =
|
||||
onView(ViewMatchers.withId(R.id.protection_settings))
|
||||
|
||||
private fun openEnhancedTrackingProtectionDetails() =
|
||||
onView(ViewMatchers.withId(R.id.tracking_content))
|
@ -0,0 +1,56 @@
|
||||
/* 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/. */
|
||||
|
||||
@file:Suppress("TooManyFunctions")
|
||||
|
||||
package org.mozilla.fenix.ui.robots
|
||||
|
||||
import androidx.test.espresso.Espresso
|
||||
import androidx.test.espresso.matcher.ViewMatchers
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import org.hamcrest.CoreMatchers
|
||||
import org.mozilla.fenix.helpers.click
|
||||
import org.mozilla.fenix.R
|
||||
|
||||
/**
|
||||
* Implementation of Robot Pattern for the settings Enhanced Tracking Protection Exceptions sub menu.
|
||||
*/
|
||||
class SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot {
|
||||
|
||||
fun verifyDefault() = assertExceptionDefault()!!
|
||||
|
||||
fun verifyListedURL(url: String) = assertExceptionURL(url)!!
|
||||
|
||||
class Transition {
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())!!
|
||||
|
||||
fun goBack(interact: SettingsSubMenuEnhancedTrackingProtectionRobot.() -> Unit): SettingsSubMenuEnhancedTrackingProtectionRobot.Transition {
|
||||
mDevice.waitForIdle()
|
||||
goBackButton().click()
|
||||
|
||||
SettingsSubMenuEnhancedTrackingProtectionRobot().interact()
|
||||
return SettingsSubMenuEnhancedTrackingProtectionRobot.Transition()
|
||||
}
|
||||
|
||||
fun disableExceptions(interact: SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.() -> Unit): Transition {
|
||||
disableExceptionsButton().click()
|
||||
|
||||
SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun goBackButton() =
|
||||
Espresso.onView(CoreMatchers.allOf(ViewMatchers.withContentDescription("Navigate up")))
|
||||
|
||||
private fun assertExceptionDefault() =
|
||||
Espresso.onView(CoreMatchers.allOf(ViewMatchers.withText("Exceptions let you disable tracking protection for selected sites.")))
|
||||
|
||||
private fun assertExceptionURL(url: String) =
|
||||
Espresso.onView(CoreMatchers.allOf(ViewMatchers.withText(url)))
|
||||
|
||||
private fun disableExceptionsButton() =
|
||||
Espresso.onView(CoreMatchers.allOf(ViewMatchers.withId(R.id.removeAllExceptions)))
|
@ -0,0 +1,89 @@
|
||||
/* 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/. */
|
||||
|
||||
@file:Suppress("TooManyFunctions")
|
||||
|
||||
package org.mozilla.fenix.ui.robots
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withResourceName
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import org.hamcrest.CoreMatchers
|
||||
import org.mozilla.fenix.helpers.click
|
||||
import org.mozilla.fenix.helpers.isChecked
|
||||
|
||||
/**
|
||||
* Implementation of Robot Pattern for the settings Enhanced Tracking Protection sub menu.
|
||||
*/
|
||||
class SettingsSubMenuEnhancedTrackingProtectionRobot {
|
||||
|
||||
fun verifyEnhancedTrackingProtectionHeader() = assertEnhancedTrackingProtectionHeader()
|
||||
|
||||
fun verifyEnhancedTrackingProtectionOptions() = assertEnhancedTrackingProtectionOptions()
|
||||
|
||||
fun verifyEnhancedTrackingProtectionDefaults() = assertEnhancedTrackingProtectionDefaults()
|
||||
|
||||
class Transition {
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())!!
|
||||
|
||||
fun goBack(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
|
||||
mDevice.waitForIdle()
|
||||
goBackButton().click()
|
||||
|
||||
SettingsRobot().interact()
|
||||
return SettingsRobot.Transition()
|
||||
}
|
||||
|
||||
fun openExceptions(interact: SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.() -> Unit): SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.Transition {
|
||||
openExceptions().click()
|
||||
|
||||
SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot().interact()
|
||||
return SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.Transition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionHeader() {
|
||||
onView(ViewMatchers.withText("Browse without being followed"))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionOptions() {
|
||||
onView(ViewMatchers.withText("Standard"))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
val stdText = "Pages will load normally, but block fewer trackers."
|
||||
onView(ViewMatchers.withText(stdText))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
|
||||
onView(ViewMatchers.withText("Strict (Default)"))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
val summaryText =
|
||||
"Stronger tracking protection and faster performance, but some sites may not work properly."
|
||||
onView(ViewMatchers.withText(summaryText))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
}
|
||||
|
||||
private fun assertEnhancedTrackingProtectionDefaults() {
|
||||
onView(withResourceName("switch_widget")).check(
|
||||
matches(
|
||||
isChecked(
|
||||
true
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
fun settingsSubMenuEnhancedTrackingProtection(interact: SettingsSubMenuEnhancedTrackingProtectionRobot.() -> Unit): SettingsSubMenuEnhancedTrackingProtectionRobot.Transition {
|
||||
SettingsSubMenuEnhancedTrackingProtectionRobot().interact()
|
||||
return SettingsSubMenuEnhancedTrackingProtectionRobot.Transition()
|
||||
}
|
||||
|
||||
private fun goBackButton() =
|
||||
onView(CoreMatchers.allOf(ViewMatchers.withContentDescription("Navigate up")))
|
||||
|
||||
private fun openExceptions() =
|
||||
onView(CoreMatchers.allOf(ViewMatchers.withText("Exceptions")))
|
Loading…
Reference in New Issue