Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthew Finkel
fenix
Commits
10dadb83
Commit
10dadb83
authored
Nov 13, 2020
by
Oana Horvath
Browse files
Closes #12899: fixed UI test for ETP off
parent
d45bdfb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt
View file @
10dadb83
...
...
@@ -10,7 +10,6 @@ import androidx.test.uiautomator.UiDevice
import
okhttp3.mockwebserver.MockWebServer
import
org.junit.After
import
org.junit.Before
import
org.junit.Ignore
import
org.junit.Rule
import
org.junit.Test
import
org.mozilla.fenix.helpers.AndroidAssetDispatcher
...
...
@@ -130,9 +129,8 @@ class SmokeTest {
}
}
@Ignore
(
"Flaky test: https://github.com/mozilla-mobile/fenix/issues/12899"
)
@Test
fun
verifyETP
ToolbarShieldIconIs
NotDisplayedIf
ETPIs
OFFGlobally
Test
()
{
fun
verifyETP
Shield
NotDisplayedIfOFFGlobally
()
{
val
defaultWebPage
=
TestAssetHelper
.
getGenericAsset
(
mockWebServer
,
1
)
homeScreen
{
...
...
@@ -149,9 +147,8 @@ class SmokeTest {
}.
openSettings
{
}.
openEnhancedTrackingProtectionSubMenu
{
clickEnhancedTrackingProtectionDefaults
()
}.
goBackToHomeScreen
{
}.
openTabDrawer
{
}.
openTab
(
defaultWebPage
.
title
)
{
}.
goBack
{
}.
goBackToBrowser
{
clickEnhancedTrackingProtectionPanel
()
verifyEnhancedTrackingProtectionSwitch
()
// Turning off TP Switch results in adding the WebPage to exception list
...
...
app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt
View file @
10dadb83
...
...
@@ -33,6 +33,7 @@ import androidx.test.uiautomator.UiSelector
import
androidx.test.uiautomator.Until
import
org.hamcrest.CoreMatchers.allOf
import
org.hamcrest.CoreMatchers.containsString
import
org.hamcrest.Matchers.not
import
org.junit.Assert.assertTrue
import
org.mozilla.fenix.R
import
org.mozilla.fenix.ext.components
...
...
@@ -185,10 +186,10 @@ class BrowserRobot {
.
perform
(
ViewActions
.
pressBack
())
}
fun
clickEnhancedTrackingProtectionPanel
()
=
enhancedTrackingProtection
Panel
().
click
()
fun
clickEnhancedTrackingProtectionPanel
()
=
enhancedTrackingProtection
Indicator
().
click
()
fun
verifyEnhancedTrackingProtectionPanelNotVisible
()
=
assertEnhancedTrackingProtection
Panel
NotVisible
()
assertEnhancedTrackingProtection
Indicator
NotVisible
()
fun
clickContextOpenLinkInNewTab
()
{
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
()
.
check
(
matches
(
withEffectiveVisibility
(
Visibility
.
VISIBLE
)))
fun
enhancedTrackingProtection
Panel
()
=
fun
enhancedTrackingProtection
Indicator
()
=
onView
(
withId
(
R
.
id
.
mozac_browser_toolbar_tracking_protection_indicator
))
private
fun
assertEnhancedTrackingProtectionPanelNotVisible
()
{
enhancedTrackingProtectionPanel
()
.
check
(
matches
(
withEffectiveVisibility
(
Visibility
.
GONE
)))
private
fun
assertEnhancedTrackingProtectionIndicatorNotVisible
()
{
enhancedTrackingProtectionIndicator
().
check
(
matches
(
not
(
isDisplayed
())))
}
private
fun
assertEnhancedTrackingProtectionSwitch
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment