|
|
@ -33,6 +33,7 @@ import androidx.test.uiautomator.UiSelector
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
import org.hamcrest.CoreMatchers.allOf
|
|
|
|
import org.hamcrest.CoreMatchers.allOf
|
|
|
|
import org.hamcrest.CoreMatchers.containsString
|
|
|
|
import org.hamcrest.CoreMatchers.containsString
|
|
|
|
|
|
|
|
import org.hamcrest.Matchers.not
|
|
|
|
import org.junit.Assert.assertTrue
|
|
|
|
import org.junit.Assert.assertTrue
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
@ -185,10 +186,10 @@ class BrowserRobot {
|
|
|
|
.perform(ViewActions.pressBack())
|
|
|
|
.perform(ViewActions.pressBack())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun clickEnhancedTrackingProtectionPanel() = enhancedTrackingProtectionPanel().click()
|
|
|
|
fun clickEnhancedTrackingProtectionPanel() = enhancedTrackingProtectionIndicator().click()
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyEnhancedTrackingProtectionPanelNotVisible() =
|
|
|
|
fun verifyEnhancedTrackingProtectionPanelNotVisible() =
|
|
|
|
assertEnhancedTrackingProtectionPanelNotVisible()
|
|
|
|
assertEnhancedTrackingProtectionIndicatorNotVisible()
|
|
|
|
|
|
|
|
|
|
|
|
fun clickContextOpenLinkInNewTab() {
|
|
|
|
fun clickContextOpenLinkInNewTab() {
|
|
|
|
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
|
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
@ -413,12 +414,11 @@ fun navURLBar() = onView(withId(R.id.mozac_browser_toolbar_url_view))
|
|
|
|
private fun assertNavURLBar() = navURLBar()
|
|
|
|
private fun assertNavURLBar() = navURLBar()
|
|
|
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
|
|
|
|
|
|
|
|
fun enhancedTrackingProtectionPanel() =
|
|
|
|
fun enhancedTrackingProtectionIndicator() =
|
|
|
|
onView(withId(R.id.mozac_browser_toolbar_tracking_protection_indicator))
|
|
|
|
onView(withId(R.id.mozac_browser_toolbar_tracking_protection_indicator))
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertEnhancedTrackingProtectionPanelNotVisible() {
|
|
|
|
private fun assertEnhancedTrackingProtectionIndicatorNotVisible() {
|
|
|
|
enhancedTrackingProtectionPanel()
|
|
|
|
enhancedTrackingProtectionIndicator().check(matches(not(isDisplayed())))
|
|
|
|
.check(matches(withEffectiveVisibility(Visibility.GONE)))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertEnhancedTrackingProtectionSwitch() {
|
|
|
|
private fun assertEnhancedTrackingProtectionSwitch() {
|
|
|
|