Re-enable ETP UI tests and update local asset (#8733)
parent
e3d34edfc7
commit
6ac13b3f7b
|
@ -1,41 +1,18 @@
|
||||||
<!-- https://github.com/mozilla/dummytracker -->
|
<!DOCTYPE HTML>
|
||||||
<!-- https://github.com/englehardt/englehardt.github.io/tree/master/test/trackingprotection/test_pages -->
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
<html>
|
- 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/. -->
|
||||||
|
<html dir="ltr" xml:lang="en-US" lang="en-US">
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="utf8">
|
||||||
|
<title>Trackers</title></head>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>Test for each list will say "Blocked" if Firefox is blocking resources from that list.</p>
|
<p>Trackers</p>
|
||||||
<p>Fingerprinting (base-fingerprinting-track-digest256):</p>
|
|
||||||
<img
|
<!-- test-track-simple -->
|
||||||
src="https://base-fingerprinting-track-digest256.dummytracker.org/test_not_blocked.png"
|
<script src="http://trackertest.org/tracker.js"></script>
|
||||||
onerror="this.onerror=null;this.src='https://not-a-tracker.dummytracker.org/test_blocked.png'">
|
<script src="https://tracking.example.com/tracker.js"></script>
|
||||||
<br/>
|
<script src="https://itisatracker.org/tracker.js"></script>
|
||||||
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -8,7 +8,6 @@ import androidx.test.platform.app.InstrumentationRegistry
|
||||||
import okhttp3.mockwebserver.MockWebServer
|
import okhttp3.mockwebserver.MockWebServer
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||||
|
@ -74,7 +73,6 @@ class EnhancedTrackingProtectionTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled for investigation into failure - https://github.com/mozilla-mobile/fenix/issues/7907")
|
|
||||||
@Test
|
@Test
|
||||||
fun testStrictVisitContentNotification() {
|
fun testStrictVisitContentNotification() {
|
||||||
val trackingProtectionTest =
|
val trackingProtectionTest =
|
||||||
|
@ -88,7 +86,6 @@ class EnhancedTrackingProtectionTest {
|
||||||
}.closeNotificationPopup {}
|
}.closeNotificationPopup {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled for investigation into failure - https://github.com/mozilla-mobile/fenix/issues/7907")
|
|
||||||
@Test
|
@Test
|
||||||
fun testStrictVisitContentShield() {
|
fun testStrictVisitContentShield() {
|
||||||
val trackingProtectionTest =
|
val trackingProtectionTest =
|
||||||
|
@ -106,7 +103,6 @@ class EnhancedTrackingProtectionTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled for investigation into failure - https://github.com/mozilla-mobile/fenix/issues/7907")
|
|
||||||
@Test
|
@Test
|
||||||
fun testStrictVisitProtectionSheet() {
|
fun testStrictVisitProtectionSheet() {
|
||||||
val trackingProtectionTest =
|
val trackingProtectionTest =
|
||||||
|
@ -126,7 +122,6 @@ class EnhancedTrackingProtectionTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled for investigation into failure - https://github.com/mozilla-mobile/fenix/issues/7907")
|
|
||||||
@Test
|
@Test
|
||||||
fun testStrictVisitDisable() {
|
fun testStrictVisitDisable() {
|
||||||
val trackingProtectionTest =
|
val trackingProtectionTest =
|
||||||
|
@ -150,12 +145,14 @@ class EnhancedTrackingProtectionTest {
|
||||||
// Verify that Enhanced Tracking Protection remains globally enabled
|
// Verify that Enhanced Tracking Protection remains globally enabled
|
||||||
navigationToolbar {
|
navigationToolbar {
|
||||||
}.openThreeDotMenu {
|
}.openThreeDotMenu {
|
||||||
|
verifyThreeDotMenuExists()
|
||||||
|
verifySettingsButton()
|
||||||
}.openSettings {
|
}.openSettings {
|
||||||
|
verifyEnhancedTrackingProtectionButton()
|
||||||
verifyEnhancedTrackingProtectionValue("On")
|
verifyEnhancedTrackingProtectionValue("On")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled for investigation into failure - https://github.com/mozilla-mobile/fenix/issues/7907")
|
|
||||||
@Test
|
@Test
|
||||||
fun testStrictVisitDisableExceptionToggle() {
|
fun testStrictVisitDisableExceptionToggle() {
|
||||||
val trackingProtectionTest =
|
val trackingProtectionTest =
|
||||||
|
@ -188,7 +185,6 @@ class EnhancedTrackingProtectionTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled for investigation into failure - https://github.com/mozilla-mobile/fenix/issues/7907")
|
|
||||||
@Test
|
@Test
|
||||||
fun testStrictVisitSheetDetails() {
|
fun testStrictVisitSheetDetails() {
|
||||||
val trackingProtectionTest =
|
val trackingProtectionTest =
|
||||||
|
|
|
@ -65,7 +65,7 @@ class NavigationToolbarRobot {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun openThreeDotMenu(interact: ThreeDotMenuMainRobot.() -> Unit): ThreeDotMenuMainRobot.Transition {
|
fun openThreeDotMenu(interact: ThreeDotMenuMainRobot.() -> Unit): ThreeDotMenuMainRobot.Transition {
|
||||||
mDevice.waitNotNull(Until.findObject(By.descContains("Menu")), waitingTime)
|
mDevice.waitNotNull(Until.findObject(By.res("org.mozilla.fenix.debug:id/mozac_browser_toolbar_menu")), waitingTime)
|
||||||
threeDotButton().click()
|
threeDotButton().click()
|
||||||
|
|
||||||
ThreeDotMenuMainRobot().interact()
|
ThreeDotMenuMainRobot().interact()
|
||||||
|
@ -146,7 +146,7 @@ private fun assertNoHistoryBookmarks() {
|
||||||
private fun dismissOnboardingButton() = onView(withId(R.id.close_onboarding))
|
private fun dismissOnboardingButton() = onView(withId(R.id.close_onboarding))
|
||||||
private fun urlBar() = onView(withId(R.id.toolbar))
|
private fun urlBar() = onView(withId(R.id.toolbar))
|
||||||
private fun awesomeBar() = onView(withId(R.id.mozac_browser_toolbar_edit_url_view))
|
private fun awesomeBar() = onView(withId(R.id.mozac_browser_toolbar_edit_url_view))
|
||||||
private fun threeDotButton() = onView(withContentDescription("Menu"))
|
private fun threeDotButton() = onView(withId(R.id.mozac_browser_toolbar_menu))
|
||||||
private fun newTab() = onView(withContentDescription("Add tab"))
|
private fun newTab() = onView(withContentDescription("Add tab"))
|
||||||
private fun fillLinkButton() = onView(withId(R.id.fill_link_from_clipboard))
|
private fun fillLinkButton() = onView(withId(R.id.fill_link_from_clipboard))
|
||||||
private fun clearAddressBar() = onView(withId(R.id.mozac_browser_toolbar_clear_view))
|
private fun clearAddressBar() = onView(withId(R.id.mozac_browser_toolbar_clear_view))
|
||||||
|
|
|
@ -195,6 +195,7 @@ private fun assertPrivacyHeading() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun assertEnhancedTrackingProtectionButton() {
|
private fun assertEnhancedTrackingProtectionButton() {
|
||||||
|
mDevice.wait(Until.findObject(By.text("Privacy and Security")), waitingTime)
|
||||||
onView(ViewMatchers.withId(R.id.recycler_view)).perform(
|
onView(ViewMatchers.withId(R.id.recycler_view)).perform(
|
||||||
RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>(
|
RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>(
|
||||||
ViewMatchers.hasDescendant(ViewMatchers.withText("Enhanced Tracking Protection"))
|
ViewMatchers.hasDescendant(ViewMatchers.withText("Enhanced Tracking Protection"))
|
||||||
|
@ -202,8 +203,10 @@ private fun assertEnhancedTrackingProtectionButton() {
|
||||||
).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun assertEnhancedTrackingProtectionValue(state: String) =
|
private fun assertEnhancedTrackingProtectionValue(state: String) {
|
||||||
|
mDevice.wait(Until.findObject(By.text("Enhanced Tracking Protection")), waitingTime)
|
||||||
onView(ViewMatchers.withText(state)).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
onView(ViewMatchers.withText(state)).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
}
|
||||||
|
|
||||||
private fun assertLoginsButton() {
|
private fun assertLoginsButton() {
|
||||||
TestHelper.scrollToElementByText("Logins and passwords")
|
TestHelper.scrollToElementByText("Logins and passwords")
|
||||||
|
|
|
@ -6,18 +6,16 @@
|
||||||
|
|
||||||
package org.mozilla.fenix.ui.robots
|
package org.mozilla.fenix.ui.robots
|
||||||
|
|
||||||
import android.view.View
|
import androidx.preference.R
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.test.espresso.Espresso.onView
|
import androidx.test.espresso.Espresso.onView
|
||||||
import androidx.test.espresso.UiController
|
|
||||||
import androidx.test.espresso.ViewAction
|
|
||||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions
|
||||||
import androidx.test.espresso.matcher.ViewMatchers
|
import androidx.test.espresso.matcher.ViewMatchers
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withResourceName
|
import androidx.test.espresso.matcher.ViewMatchers.withResourceName
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
import androidx.test.uiautomator.UiDevice
|
import androidx.test.uiautomator.UiDevice
|
||||||
import org.hamcrest.CoreMatchers
|
import org.hamcrest.CoreMatchers
|
||||||
import org.hamcrest.Matcher
|
|
||||||
import org.mozilla.fenix.helpers.TestHelper
|
|
||||||
import org.mozilla.fenix.helpers.click
|
import org.mozilla.fenix.helpers.click
|
||||||
import org.mozilla.fenix.helpers.isChecked
|
import org.mozilla.fenix.helpers.isChecked
|
||||||
|
|
||||||
|
@ -46,24 +44,15 @@ class SettingsSubMenuEnhancedTrackingProtectionRobot {
|
||||||
fun openExceptions(
|
fun openExceptions(
|
||||||
interact: SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.() -> Unit
|
interact: SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.() -> Unit
|
||||||
): SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.Transition {
|
): SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.Transition {
|
||||||
TestHelper.scrollToElementByText("Exceptions")
|
|
||||||
openExceptions().perform(
|
|
||||||
object : ViewAction {
|
|
||||||
override fun getConstraints(): Matcher<View> {
|
|
||||||
// do not check constraints, check if enabled
|
|
||||||
return ViewMatchers.isEnabled()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getDescription(): String {
|
onView(ViewMatchers.withId(R.id.recycler_view)).perform(
|
||||||
return "Exceptions"
|
RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>(
|
||||||
}
|
ViewMatchers.hasDescendant(ViewMatchers.withText("Exceptions"))
|
||||||
|
)
|
||||||
override fun perform(uiController: UiController?, view: View) {
|
|
||||||
view.performClick()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
openExceptions().click()
|
||||||
|
|
||||||
SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot().interact()
|
SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot().interact()
|
||||||
return SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.Transition()
|
return SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.Transition()
|
||||||
}
|
}
|
||||||
|
@ -84,9 +73,16 @@ private fun assertEnhancedTrackingProtectionOptions() {
|
||||||
|
|
||||||
onView(ViewMatchers.withText("Strict (Default)"))
|
onView(ViewMatchers.withText("Strict (Default)"))
|
||||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||||
val summaryText =
|
val strictText =
|
||||||
"Stronger tracking protection and faster performance, but some sites may not work properly."
|
"Stronger tracking protection and faster performance, but some sites may not work properly."
|
||||||
onView(ViewMatchers.withText(summaryText))
|
onView(ViewMatchers.withText(strictText))
|
||||||
|
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||||
|
|
||||||
|
onView(ViewMatchers.withText("Custom"))
|
||||||
|
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||||
|
val customText =
|
||||||
|
"Choose which trackers and scripts to block"
|
||||||
|
onView(ViewMatchers.withText(customText))
|
||||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,20 +7,21 @@
|
||||||
package org.mozilla.fenix.ui.robots
|
package org.mozilla.fenix.ui.robots
|
||||||
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.test.espresso.contrib.RecyclerViewActions
|
|
||||||
import androidx.test.espresso.Espresso.onView
|
import androidx.test.espresso.Espresso.onView
|
||||||
import androidx.test.espresso.action.ViewActions
|
import androidx.test.espresso.action.ViewActions
|
||||||
import androidx.test.espresso.assertion.ViewAssertions
|
import androidx.test.espresso.assertion.ViewAssertions
|
||||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions
|
||||||
import androidx.test.espresso.matcher.ViewMatchers
|
import androidx.test.espresso.matcher.ViewMatchers
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
|
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.hasFocus
|
import androidx.test.espresso.matcher.ViewMatchers.hasFocus
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||||
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.withResourceName
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
import androidx.test.uiautomator.By
|
import androidx.test.uiautomator.By
|
||||||
import androidx.test.uiautomator.UiDevice
|
import androidx.test.uiautomator.UiDevice
|
||||||
|
@ -86,7 +87,10 @@ class ThreeDotMenuMainRobot {
|
||||||
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||||
|
|
||||||
fun openSettings(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
|
fun openSettings(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
|
||||||
settingsButton().click()
|
onView(allOf(withResourceName("text"), withText(R.string.browser_menu_settings)))
|
||||||
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
.check(matches(isCompletelyDisplayed()))
|
||||||
|
.perform(ViewActions.click())
|
||||||
|
|
||||||
SettingsRobot().interact()
|
SettingsRobot().interact()
|
||||||
return SettingsRobot.Transition()
|
return SettingsRobot.Transition()
|
||||||
|
@ -236,55 +240,50 @@ private fun threeDotMenuRecyclerViewExists() {
|
||||||
onView(withId(R.id.mozac_browser_menu_recyclerView)).check(matches(isDisplayed()))
|
onView(withId(R.id.mozac_browser_menu_recyclerView)).check(matches(isDisplayed()))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun settingsButton() = onView(
|
private fun settingsButton() = onView(allOf(withResourceName("text"), withText(R.string.browser_menu_settings)))
|
||||||
allOf(
|
|
||||||
withText(R.string.settings),
|
|
||||||
withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
private fun assertSettingsButton() = settingsButton()
|
private fun assertSettingsButton() = settingsButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
.check(matches(isCompletelyDisplayed()))
|
||||||
|
|
||||||
private fun libraryButton() = onView(allOf(withText(R.string.browser_menu_your_library)))
|
private fun libraryButton() = onView(allOf(withText(R.string.browser_menu_your_library)))
|
||||||
private fun assertLibraryButton() = libraryButton()
|
private fun assertLibraryButton() = libraryButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun historyButton() = onView(allOf(withText(R.string.library_history)))
|
private fun historyButton() = onView(allOf(withText(R.string.library_history)))
|
||||||
private fun assertHistoryButton() = historyButton()
|
private fun assertHistoryButton() = historyButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun bookmarksButton() = onView(allOf(withText(R.string.library_bookmarks)))
|
private fun bookmarksButton() = onView(allOf(withText(R.string.library_bookmarks)))
|
||||||
private fun assertBookmarksButton() = bookmarksButton()
|
private fun assertBookmarksButton() = bookmarksButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun helpButton() = onView(allOf(withText(R.string.browser_menu_help)))
|
private fun helpButton() = onView(allOf(withText(R.string.browser_menu_help)))
|
||||||
private fun assertHelpButton() = helpButton()
|
private fun assertHelpButton() = helpButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun forwardButton() = onView(ViewMatchers.withContentDescription("Forward"))
|
private fun forwardButton() = onView(ViewMatchers.withContentDescription("Forward"))
|
||||||
private fun assertForwardButton() = forwardButton()
|
private fun assertForwardButton() = forwardButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun addBookmarkButton() = onView(ViewMatchers.withContentDescription("Bookmark"))
|
private fun addBookmarkButton() = onView(ViewMatchers.withContentDescription("Bookmark"))
|
||||||
private fun assertAddBookmarkButton() = addBookmarkButton()
|
private fun assertAddBookmarkButton() = addBookmarkButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun editBookmarkButton() = onView(ViewMatchers.withContentDescription("Edit bookmark"))
|
private fun editBookmarkButton() = onView(ViewMatchers.withContentDescription("Edit bookmark"))
|
||||||
private fun assertEditBookmarkButton() = editBookmarkButton()
|
private fun assertEditBookmarkButton() = editBookmarkButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun refreshButton() = onView(ViewMatchers.withContentDescription("Refresh"))
|
private fun refreshButton() = onView(ViewMatchers.withContentDescription("Refresh"))
|
||||||
private fun assertRefreshButton() = refreshButton()
|
private fun assertRefreshButton() = refreshButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun closeAllTabsButton() = onView(allOf(withText("Close all tabs")))
|
private fun closeAllTabsButton() = onView(allOf(withText("Close all tabs")))
|
||||||
private fun assertCloseAllTabsButton() = closeAllTabsButton()
|
private fun assertCloseAllTabsButton() = closeAllTabsButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun shareTabButton() = onView(allOf(withText("Share tabs")))
|
private fun shareTabButton() = onView(allOf(withText("Share tabs")))
|
||||||
private fun assertShareTabButton() = shareTabButton()
|
private fun assertShareTabButton() = shareTabButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun shareButton() = onView(ViewMatchers.withContentDescription("Share"))
|
private fun shareButton() = onView(ViewMatchers.withContentDescription("Share"))
|
||||||
private fun assertShareButton() = shareButton()
|
private fun assertShareButton() = shareButton()
|
||||||
|
@ -299,15 +298,15 @@ private fun browserViewSaveCollectionButton() = onView(
|
||||||
|
|
||||||
private fun saveCollectionButton() = onView(allOf(withText("Save to collection")))
|
private fun saveCollectionButton() = onView(allOf(withText("Save to collection")))
|
||||||
private fun assertSaveCollectionButton() = saveCollectionButton()
|
private fun assertSaveCollectionButton() = saveCollectionButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun addNewCollectionButton() = onView(allOf(withText("Add new collection")))
|
private fun addNewCollectionButton() = onView(allOf(withText("Add new collection")))
|
||||||
private fun assertaddNewCollectionButton() = addNewCollectionButton()
|
private fun assertaddNewCollectionButton() = addNewCollectionButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun collectionNameTextField() = onView(allOf(withResourceName("name_collection_edittext")))
|
private fun collectionNameTextField() = onView(allOf(withResourceName("name_collection_edittext")))
|
||||||
private fun assertCollectionNameTextField() = collectionNameTextField()
|
private fun assertCollectionNameTextField() = collectionNameTextField()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun findInPageButton() = onView(allOf(withText("Find in page")))
|
private fun findInPageButton() = onView(allOf(withText("Find in page")))
|
||||||
private fun assertFindInPageButton() = findInPageButton()
|
private fun assertFindInPageButton() = findInPageButton()
|
||||||
|
@ -320,7 +319,7 @@ private fun SendToDeviceTitle() =
|
||||||
onView(allOf(withText("SEND TO DEVICE"), withResourceName("accountHeaderText")))
|
onView(allOf(withText("SEND TO DEVICE"), withResourceName("accountHeaderText")))
|
||||||
|
|
||||||
private fun assertSendToDeviceTitle() = SendToDeviceTitle()
|
private fun assertSendToDeviceTitle() = SendToDeviceTitle()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun ShareALinkTitle() =
|
private fun ShareALinkTitle() =
|
||||||
onView(allOf(withText("ALL ACTIONS"), withResourceName("apps_link_header")))
|
onView(allOf(withText("ALL ACTIONS"), withResourceName("apps_link_header")))
|
||||||
|
@ -330,17 +329,17 @@ private fun assertShareALinkTitle() = ShareALinkTitle()
|
||||||
private fun whatsNewButton() = onView(
|
private fun whatsNewButton() = onView(
|
||||||
allOf(
|
allOf(
|
||||||
withText("What’s New"),
|
withText("What’s New"),
|
||||||
withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)
|
withEffectiveVisibility(Visibility.VISIBLE)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun assertWhatsNewButton() = whatsNewButton()
|
private fun assertWhatsNewButton() = whatsNewButton()
|
||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||||
|
|
||||||
private fun readerViewToggle() = onView(allOf(withText(R.string.browser_menu_read)))
|
private fun readerViewToggle() = onView(allOf(withText(R.string.browser_menu_read)))
|
||||||
private fun assertReaderViewToggle(visible: Boolean) = readerViewToggle()
|
private fun assertReaderViewToggle(visible: Boolean) = readerViewToggle()
|
||||||
.check(
|
.check(
|
||||||
if (visible) matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)) else ViewAssertions.doesNotExist()
|
if (visible) matches(withEffectiveVisibility(Visibility.VISIBLE)) else ViewAssertions.doesNotExist()
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun readerViewAppearanceToggle() =
|
private fun readerViewAppearanceToggle() =
|
||||||
|
@ -348,7 +347,7 @@ private fun readerViewAppearanceToggle() =
|
||||||
|
|
||||||
private fun assertReaderViewAppearanceButton(visible: Boolean) = readerViewAppearanceToggle()
|
private fun assertReaderViewAppearanceButton(visible: Boolean) = readerViewAppearanceToggle()
|
||||||
.check(
|
.check(
|
||||||
if (visible) matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)) else ViewAssertions.doesNotExist()
|
if (visible) matches(withEffectiveVisibility(Visibility.VISIBLE)) else ViewAssertions.doesNotExist()
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun addToFirefoxHomeButton() =
|
private fun addToFirefoxHomeButton() =
|
||||||
|
|
Loading…
Reference in New Issue