@ -6,24 +6,17 @@
package org.mozilla.fenix.ui.robots
package org.mozilla.fenix.ui.robots
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.swipeDown
import androidx.test.espresso.action.ViewActions.swipeDown
import androidx.test.espresso.action.ViewActions.swipeUp
import androidx.test.espresso.action.ViewActions.swipeUp
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.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.RootMatchers
import androidx.test.espresso.matcher.RootMatchers
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.Visibility
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
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
@ -35,10 +28,9 @@ import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until
import androidx.test.uiautomator.Until
import org.hamcrest.Matcher
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.allOf
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Assert.assertTrue
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.click
import org.mozilla.fenix.helpers.click
@ -74,6 +66,11 @@ class ThreeDotMenuMainRobot {
}
}
fun clickShareButton ( ) {
fun clickShareButton ( ) {
var maxSwipes = 3
while ( ! shareButton ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
shareButton ( ) . click ( )
shareButton ( ) . click ( )
mDevice . waitNotNull ( Until . findObject ( By . text ( " ALL ACTIONS " ) ) , waitingTime )
mDevice . waitNotNull ( Until . findObject ( By . text ( " ALL ACTIONS " ) ) , waitingTime )
}
}
@ -90,73 +87,41 @@ class ThreeDotMenuMainRobot {
addNewCollectionButton ( ) . click ( )
addNewCollectionButton ( ) . click ( )
}
}
fun clickAddBookmarkButton ( ) {
mDevice . waitNotNull (
Until . findObject ( By . desc ( " Bookmark " ) ) ,
waitingTime
)
addBookmarkButton ( ) . perform (
click (
/ * no - op rollback action for when clicks randomly perform a long click , Espresso should attempt to click again
https : //issuetracker.google.com/issues/37078920#comment9
* /
object : ViewAction {
override fun getDescription ( ) : String {
return " Handle tap->longclick. "
}
override fun getConstraints ( ) : Matcher < View > {
return isAssignableFrom ( View :: class . java )
}
override fun perform ( uiController : UiController ? , view : View ? ) {
// do nothing
}
}
)
)
}
fun verifyCollectionNameTextField ( ) = assertCollectionNameTextField ( )
fun verifyCollectionNameTextField ( ) = assertCollectionNameTextField ( )
fun verifyFindInPageButton ( ) = assertFindInPageButton ( )
fun verifyFindInPageButton ( ) = assertFindInPageButton ( )
fun verifyShareScrim ( ) = assertShareScrim ( )
fun verifyShareScrim ( ) = assertShareScrim ( )
fun verifySendToDeviceTitle ( ) = assertSendToDeviceTitle ( )
fun verifySendToDeviceTitle ( ) = assertSendToDeviceTitle ( )
fun verifyShareALinkTitle ( ) = assertShareALinkTitle ( )
fun verifyShareALinkTitle ( ) = assertShareALinkTitle ( )
fun verifyWhatsNewButton ( ) = assertWhatsNewButton ( )
fun verifyWhatsNewButton ( ) = assertWhatsNewButton ( )
fun verifyAdd FirefoxHome( ) = assertAddToFirefoxHome ( )
fun verifyAddToTopSitesButton ( ) = assertAddToTopSitesButton ( )
fun verifyAddToMobileHome ( ) = assertAddToMobileHome ( )
fun verifyAddToMobileHome ( ) = assertAddToMobileHome ( )
fun verifyDesktopSite ( ) = assertDesktopSite ( )
fun verifyDesktopSite ( ) = assertDesktopSite ( )
fun verifyDownloadsButton ( ) = assertDownloadsButton ( )
fun verifyDownloadsButton ( ) = assertDownloadsButton ( )
fun verifyShareTabsOverlay ( ) = assertShareTabsOverlay ( )
fun verifyShareTabsOverlay ( ) = assertShareTabsOverlay ( )
fun verifySignInToSyncButton ( ) = assertSignInToSyncButton ( )
fun verifyThreeDotMainMenuItems ( ) {
fun verifyNewTabButton ( ) = assertNewTabButton ( )
if ( FeatureFlags . toolbarMenuFeature ) {
fun verifyReportSiteIssueButton ( ) = assertReportSiteIssueButton ( )
verifyDownloadsButton ( )
verifyHistoryButton ( )
fun verifyPageThreeDotMainMenuItems ( ) {
verifyBookmarksButton ( )
verifyNewTabButton ( )
verifySettingsButton ( )
verifyBookmarksButton ( )
verifyDesktopSite ( )
verifyAddBookmarkButton ( )
verifySaveCollection ( )
verifyHistoryButton ( )
verifyShareButton ( )
verifyDownloadsButton ( )
verifyForwardButton ( )
verifyAddOnsButton ( )
verifyRefreshButton ( )
verifySignInToSyncButton ( )
} else {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
verifyAddOnsButton ( )
verifyFindInPageButton ( )
verifyDownloadsButton ( )
verifyDesktopSite ( )
verifyHistoryButton ( )
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
verifyBookmarksButton ( )
verifyReportSiteIssueButton ( )
verifySyncedTabsButton ( )
verifyAddToTopSitesButton ( )
verifySettingsButton ( )
verifyAddToMobileHome ( )
verifyFindInPageButton ( )
verifySaveCollection ( )
verifyAddFirefoxHome ( )
verifySettingsButton ( )
verifyAddToMobileHome ( )
verifyShareButton ( )
verifyDesktopSite ( )
verifyForwardButton ( )
verifySaveCollection ( )
verifyRefreshButton ( )
verifyAddBookmarkButton ( )
verifyShareButton ( )
verifyForwardButton ( )
verifyRefreshButton ( )
}
}
}
private fun assertShareTabsOverlay ( ) {
private fun assertShareTabsOverlay ( ) {
@ -171,11 +136,12 @@ 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 {
onView ( withId ( R . id . mozac _browser _menu _recyclerView ) ) . perform ( swipeDown ( ) )
var maxSwipes = 3
onView ( allOf ( withResourceName ( " text " ) , withText ( R . string . browser _menu _settings ) ) )
while ( ! settingsButton ( ) . exists ( ) && maxSwipes != 0 ) {
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
. check ( matches ( isCompletelyDisplayed ( ) ) )
maxSwipes --
. perform ( ViewActions . click ( ) )
}
settingsButton ( ) . click ( )
SettingsRobot ( ) . interact ( )
SettingsRobot ( ) . interact ( )
return SettingsRobot . Transition ( )
return SettingsRobot . Transition ( )
@ -219,7 +185,7 @@ class ThreeDotMenuMainRobot {
}
}
fun bookmarkPage ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
fun bookmarkPage ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice . waitNotNull ( Until . findObject ( By . desc( " Bookmark " ) ) , waitingTime )
mDevice . waitNotNull ( Until . findObject ( By . text( " Bookmarks " ) ) , waitingTime )
addBookmarkButton ( ) . click ( )
addBookmarkButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
BrowserRobot ( ) . interact ( )
@ -227,10 +193,12 @@ class ThreeDotMenuMainRobot {
}
}
fun sharePage ( interact : LibrarySubMenusMultipleSelectionToolbarRobot . ( ) -> Unit ) : LibrarySubMenusMultipleSelectionToolbarRobot . Transition {
fun sharePage ( interact : LibrarySubMenusMultipleSelectionToolbarRobot . ( ) -> Unit ) : LibrarySubMenusMultipleSelectionToolbarRobot . Transition {
mDevice . waitNotNull ( Until . findObject ( By . desc ( " Share " ) ) , waitingTime )
var maxSwipes = 3
while ( ! shareButton ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
shareButton ( ) . click ( )
shareButton ( ) . click ( )
pressBack ( )
LibrarySubMenusMultipleSelectionToolbarRobot ( ) . interact ( )
LibrarySubMenusMultipleSelectionToolbarRobot ( ) . interact ( )
return LibrarySubMenusMultipleSelectionToolbarRobot . Transition ( )
return LibrarySubMenusMultipleSelectionToolbarRobot . Transition ( )
}
}
@ -244,7 +212,11 @@ class ThreeDotMenuMainRobot {
}
}
fun goForward ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
fun goForward ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice . waitNotNull ( Until . findObject ( By . desc ( " Forward " ) ) , waitingTime )
var maxSwipes = 3
while ( ! forwardButton ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
forwardButton ( ) . click ( )
forwardButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
BrowserRobot ( ) . interact ( )
@ -278,8 +250,12 @@ class ThreeDotMenuMainRobot {
}
}
fun refreshPage ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
fun refreshPage ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
// TODO: this is not finding the button correctly
var maxSwipes = 3
mDevice . waitNotNull ( Until . findObject ( By . desc ( " Refresh " ) ) , waitingTime )
while ( ! refreshButton ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
assertRefreshButton ( )
refreshButton ( ) . click ( )
refreshButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
BrowserRobot ( ) . interact ( )
@ -346,6 +322,11 @@ class ThreeDotMenuMainRobot {
}
}
fun openReaderViewAppearance ( interact : ReaderViewRobot . ( ) -> Unit ) : ReaderViewRobot . Transition {
fun openReaderViewAppearance ( interact : ReaderViewRobot . ( ) -> Unit ) : ReaderViewRobot . Transition {
var maxSwipes = 3
while ( ! readerViewAppearanceToggle ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
readerViewAppearanceToggle ( ) . click ( )
readerViewAppearanceToggle ( ) . click ( )
ReaderViewRobot ( ) . interact ( )
ReaderViewRobot ( ) . interact ( )
@ -353,7 +334,7 @@ class ThreeDotMenuMainRobot {
}
}
fun addToFirefoxHome ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
fun addToFirefoxHome ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
addTo FirefoxHome Button( ) . click ( )
addTo TopSites Button( ) . click ( )
BrowserRobot ( ) . interact ( )
BrowserRobot ( ) . interact ( )
return BrowserRobot . Transition ( )
return BrowserRobot . Transition ( )
@ -368,6 +349,11 @@ class ThreeDotMenuMainRobot {
}
}
fun clickInstall ( interact : AddToHomeScreenRobot . ( ) -> Unit ) : AddToHomeScreenRobot . Transition {
fun clickInstall ( interact : AddToHomeScreenRobot . ( ) -> Unit ) : AddToHomeScreenRobot . Transition {
var maxSwipes = 3
while ( !in stallPWAButton ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
installPWAButton ( ) . click ( )
installPWAButton ( ) . click ( )
AddToHomeScreenRobot ( ) . interact ( )
AddToHomeScreenRobot ( ) . interact ( )
@ -407,15 +393,15 @@ class ThreeDotMenuMainRobot {
}
}
}
}
}
}
private fun threeDotMenuRecyclerView ( ) =
onView ( withId ( R . id . mozac _browser _menu _recyclerView ) )
private fun threeDotMenuRecyclerViewExists ( ) {
private fun threeDotMenuRecyclerViewExists ( ) {
onView( withId ( R . id . mozac _browser _menu _recyclerView ) ) . check ( matches ( isDisplayed ( ) ) )
threeDotMenuRecyclerView( ) . check ( matches ( isDisplayed ( ) ) )
}
}
private fun settingsButton ( ) = onView ( allOf ( withResourceName ( " text " ) , withText ( R . string . browser _menu _settings ) ) )
private fun settingsButton ( ) = mDevice . findObject ( UiSelector ( ) . text ( " Settings " ) )
private fun assertSettingsButton ( ) = settingsButton ( )
private fun assertSettingsButton ( ) = assertTrue ( settingsButton ( ) . waitForExists ( waitingTime ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
. check ( matches ( isCompletelyDisplayed ( ) ) )
private fun addOnsButton ( ) = onView ( allOf ( withText ( " Add-ons " ) ) )
private fun addOnsButton ( ) = onView ( allOf ( withText ( " Add-ons " ) ) )
private fun assertAddOnsButton ( ) {
private fun assertAddOnsButton ( ) {
@ -435,27 +421,28 @@ private fun syncedTabsButton() = onView(allOf(withText(R.string.library_synced_t
private fun assertSyncedTabsButton ( ) = syncedTabsButton ( )
private fun assertSyncedTabsButton ( ) = syncedTabsButton ( )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun signInToSyncButton ( ) = onView ( withText ( " Sign in to sync " ) )
private fun assertSignInToSyncButton ( ) = signInToSyncButton ( ) . check ( matches ( isDisplayed ( ) ) )
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 ( Visibility . VISIBLE ) ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun forwardButton ( ) = onView ( ViewMatchers . withContentDescription ( " Forward " ) )
private fun forwardButton ( ) = mDevice . findObject ( UiSelector ( ) . description ( " Forward " ) )
private fun assertForwardButton ( ) = forwardButton ( )
private fun assertForwardButton ( ) = assertTrue ( forwardButton ( ) . waitForExists ( waitingTime ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun addBookmarkButton ( ) = onView ( ViewMatchers . withContentDescription ( " Bookmark " ) )
private fun addBookmarkButton ( ) = onView ( allOf ( withId ( R . id . checkbox ) , withText ( " Add " ) ) )
private fun assertAddBookmarkButton ( ) {
private fun assertAddBookmarkButton ( ) {
onView ( withId ( R . id . mozac _browser _menu _menuView ) ) . perform ( swipeUp ( ) )
onView ( withId ( R . id . mozac _browser _menu _menuView ) ) . perform ( swipeUp ( ) )
addBookmarkButton ( ) . check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
addBookmarkButton ( ) . check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
}
}
private fun editBookmarkButton ( ) = onView ( ViewMatchers . withContentDescription ( " Edit bookmark " ) )
private fun editBookmarkButton ( ) = onView ( withText ( " Edit " ) )
private fun assertEditBookmarkButton ( ) = editBookmarkButton ( )
private fun assertEditBookmarkButton ( ) = editBookmarkButton ( )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun refreshButton ( ) = onView ( ViewMatchers . withContentDescription ( " Refresh " ) )
private fun refreshButton ( ) = mDevice . findObject ( UiSelector ( ) . description ( " Refresh " ) )
private fun assertRefreshButton ( ) = refreshButton ( )
private fun assertRefreshButton ( ) = assertTrue ( refreshButton ( ) . waitForExists ( waitingTime ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun stopLoadingButton ( ) = onView ( ViewMatchers . withContentDescription ( " Stop " ) )
private fun stopLoadingButton ( ) = onView ( ViewMatchers . withContentDescription ( " Stop " ) )
@ -467,9 +454,8 @@ private fun shareTabButton() = onView(allOf(withText("Share all tabs"))).inRoot(
private fun assertShareTabButton ( ) = shareTabButton ( )
private fun assertShareTabButton ( ) = shareTabButton ( )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun shareButton ( ) = onView ( ViewMatchers . withContentDescription ( " Share " ) )
private fun shareButton ( ) = mDevice . findObject ( UiSelector ( ) . description ( " Share " ) )
private fun assertShareButton ( ) = shareButton ( )
private fun assertShareButton ( ) = assertTrue ( shareButton ( ) . waitForExists ( waitingTime ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun browserViewSaveCollectionButton ( ) = onView (
private fun browserViewSaveCollectionButton ( ) = onView (
allOf (
allOf (
@ -497,6 +483,7 @@ private fun assertCollectionNameTextField() = collectionNameTextField()
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
. check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
private fun reportSiteIssueButton ( ) = onView ( withText ( " Report Site Issue… " ) )
private fun reportSiteIssueButton ( ) = onView ( withText ( " Report Site Issue… " ) )
private fun assertReportSiteIssueButton ( ) = reportSiteIssueButton ( ) . check ( matches ( isDisplayed ( ) ) )
private fun findInPageButton ( ) = onView ( allOf ( withText ( " Find in page " ) ) )
private fun findInPageButton ( ) = onView ( allOf ( withText ( " Find in page " ) ) )
@ -531,17 +518,29 @@ private fun assertWhatsNewButton() = whatsNewButton()
private fun addToHomeScreenButton ( ) = onView ( withText ( " Add to Home screen " ) )
private fun addToHomeScreenButton ( ) = onView ( withText ( " Add to Home screen " ) )
private fun readerViewAppearanceToggle ( ) =
private fun readerViewAppearanceToggle ( ) =
onView ( allOf ( withText ( R . string . browser _menu _read _appearance ) ) )
mDevice . findObject ( UiSelector ( ) . text ( " Customize reader view " ) )
private fun assertReaderViewAppearanceButton ( visible : Boolean ) = readerViewAppearanceToggle ( )
private fun assertReaderViewAppearanceButton ( visible : Boolean ) {
. check (
var maxSwipes = 3
if ( visible ) matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) else ViewAssertions . doesNotExist ( )
if ( visible ) {
)
while ( ! readerViewAppearanceToggle ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
assertTrue ( readerViewAppearanceToggle ( ) . exists ( ) )
} else {
while ( ! readerViewAppearanceToggle ( ) . exists ( ) && maxSwipes != 0 ) {
threeDotMenuRecyclerView ( ) . perform ( swipeUp ( ) )
maxSwipes --
}
assertFalse ( readerViewAppearanceToggle ( ) . exists ( ) )
}
}
private fun addToFirefoxHomeButton ( ) =
private fun addTo TopSites Button( ) =
onView ( allOf ( withText ( R . string . browser _menu _add _to _top _sites ) ) )
onView ( allOf ( withText ( R . string . browser _menu _add _to _top _sites ) ) )
private fun assertAddToFirefoxHome ( ) {
private fun assertAddTo TopSitesButton ( ) {
onView ( withId ( R . id . mozac _browser _menu _recyclerView ) )
onView ( withId ( R . id . mozac _browser _menu _recyclerView ) )
. perform (
. perform (
RecyclerViewActions . scrollTo < RecyclerView . ViewHolder > (
RecyclerViewActions . scrollTo < RecyclerView . ViewHolder > (
@ -562,7 +561,7 @@ private fun assertAddToMobileHome() {
) . check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
) . check ( matches ( withEffectiveVisibility ( Visibility . VISIBLE ) ) )
}
}
private fun installPWAButton ( ) = onView( allOf ( withId ( R . id . highlight _text ) , withT ext( " Install " ) ) )
private fun installPWAButton ( ) = mDevice. findObject ( UiSelector ( ) . t ext( " Install " ) )
private fun desktopSiteButton ( ) =
private fun desktopSiteButton ( ) =
onView ( allOf ( withText ( R . string . browser _menu _desktop _site ) ) )
onView ( allOf ( withText ( R . string . browser _menu _desktop _site ) ) )
@ -610,3 +609,5 @@ private fun assertShareAllTabsButton() {
. check (
. check (
matches ( isDisplayed ( ) ) )
matches ( isDisplayed ( ) ) )
}
}
private fun assertNewTabButton ( ) = onView ( withText ( " New tab " ) ) . check ( matches ( isDisplayed ( ) ) )