|
|
@ -26,7 +26,6 @@ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withResourceName
|
|
|
|
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
|
|
|
import androidx.test.platform.app.InstrumentationRegistry
|
|
|
|
import androidx.test.platform.app.InstrumentationRegistry
|
|
|
|
import androidx.test.uiautomator.By
|
|
|
|
import androidx.test.uiautomator.By
|
|
|
@ -164,15 +163,9 @@ class BrowserRobot {
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyEnhancedTrackingProtectionSwitch() = assertEnhancedTrackingProtectionSwitch()
|
|
|
|
fun verifyEnhancedTrackingProtectionSwitch() = assertEnhancedTrackingProtectionSwitch()
|
|
|
|
|
|
|
|
|
|
|
|
fun clickEnhancedTrackingProtectionSwitchOffOn() =
|
|
|
|
|
|
|
|
onView(withResourceName("switch_widget")).click()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyProtectionSettingsButton() = assertProtectionSettingsButton()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyEnhancedTrackingOptions() {
|
|
|
|
fun verifyEnhancedTrackingOptions() {
|
|
|
|
clickEnhancedTrackingProtectionPanel()
|
|
|
|
onView(withId(R.id.mozac_browser_toolbar_security_indicator)).click()
|
|
|
|
verifyEnhancedTrackingProtectionSwitch()
|
|
|
|
verifyEnhancedTrackingProtectionSwitch()
|
|
|
|
verifyProtectionSettingsButton()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyMenuButton() = assertMenuButton()
|
|
|
|
fun verifyMenuButton() = assertMenuButton()
|
|
|
@ -214,11 +207,6 @@ class BrowserRobot {
|
|
|
|
.perform(ViewActions.pressBack())
|
|
|
|
.perform(ViewActions.pressBack())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun clickEnhancedTrackingProtectionPanel() = enhancedTrackingProtectionIndicator().click()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyEnhancedTrackingProtectionPanelNotVisible() =
|
|
|
|
|
|
|
|
assertEnhancedTrackingProtectionIndicatorNotVisible()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun clickContextOpenLinkInNewTab() {
|
|
|
|
fun clickContextOpenLinkInNewTab() {
|
|
|
|
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
|
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
|
mDevice.waitNotNull(
|
|
|
|
mDevice.waitNotNull(
|
|
|
@ -566,11 +554,6 @@ fun browserScreen(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun dismissTrackingOnboarding() {
|
|
|
|
|
|
|
|
mDevice.wait(Until.findObject(By.res("close_onboarding")), waitingTime)
|
|
|
|
|
|
|
|
dismissOnboardingButton().click()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun navURLBar() = onView(withId(R.id.toolbar))
|
|
|
|
fun navURLBar() = onView(withId(R.id.toolbar))
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertNavURLBar() = navURLBar()
|
|
|
|
private fun assertNavURLBar() = navURLBar()
|
|
|
@ -579,13 +562,6 @@ private fun assertNavURLBar() = navURLBar()
|
|
|
|
private fun assertNavURLBarHidden() = navURLBar()
|
|
|
|
private fun assertNavURLBarHidden() = navURLBar()
|
|
|
|
.check(matches(not(isDisplayed())))
|
|
|
|
.check(matches(not(isDisplayed())))
|
|
|
|
|
|
|
|
|
|
|
|
fun enhancedTrackingProtectionIndicator() =
|
|
|
|
|
|
|
|
onView(withId(R.id.mozac_browser_toolbar_tracking_protection_indicator))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertEnhancedTrackingProtectionIndicatorNotVisible() {
|
|
|
|
|
|
|
|
enhancedTrackingProtectionIndicator().check(matches(not(isDisplayed())))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertEnhancedTrackingProtectionSwitch() {
|
|
|
|
private fun assertEnhancedTrackingProtectionSwitch() {
|
|
|
|
withText(R.id.trackingProtectionSwitch)
|
|
|
|
withText(R.id.trackingProtectionSwitch)
|
|
|
|
.matches(withEffectiveVisibility(Visibility.VISIBLE))
|
|
|
|
.matches(withEffectiveVisibility(Visibility.VISIBLE))
|
|
|
|