|
|
@ -15,6 +15,7 @@ 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.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.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.contrib.RecyclerViewActions
|
|
|
@ -114,9 +115,11 @@ class ThreeDotMenuMainRobot {
|
|
|
|
fun verifyAddToMobileHome() = assertAddToMobileHome()
|
|
|
|
fun verifyAddToMobileHome() = assertAddToMobileHome()
|
|
|
|
fun verifyDesktopSite() = assertDesktopSite()
|
|
|
|
fun verifyDesktopSite() = assertDesktopSite()
|
|
|
|
fun verifyOpenInAppButton() = assertOpenInAppButton()
|
|
|
|
fun verifyOpenInAppButton() = assertOpenInAppButton()
|
|
|
|
|
|
|
|
fun verifyDownloadsButton() = assertDownloadsButton()
|
|
|
|
|
|
|
|
|
|
|
|
fun verifyThreeDotMainMenuItems() {
|
|
|
|
fun verifyThreeDotMainMenuItems() {
|
|
|
|
verifyAddOnsButton()
|
|
|
|
verifyAddOnsButton()
|
|
|
|
|
|
|
|
verifyDownloadsButton()
|
|
|
|
verifyHistoryButton()
|
|
|
|
verifyHistoryButton()
|
|
|
|
verifyBookmarksButton()
|
|
|
|
verifyBookmarksButton()
|
|
|
|
verifySyncedTabsButton()
|
|
|
|
verifySyncedTabsButton()
|
|
|
@ -125,6 +128,7 @@ class ThreeDotMenuMainRobot {
|
|
|
|
verifyAddFirefoxHome()
|
|
|
|
verifyAddFirefoxHome()
|
|
|
|
verifyAddToMobileHome()
|
|
|
|
verifyAddToMobileHome()
|
|
|
|
verifyDesktopSite()
|
|
|
|
verifyDesktopSite()
|
|
|
|
|
|
|
|
verifySaveCollection()
|
|
|
|
verifyAddBookmarkButton()
|
|
|
|
verifyAddBookmarkButton()
|
|
|
|
verifyShareButton()
|
|
|
|
verifyShareButton()
|
|
|
|
verifyForwardButton()
|
|
|
|
verifyForwardButton()
|
|
|
@ -135,14 +139,6 @@ class ThreeDotMenuMainRobot {
|
|
|
|
|
|
|
|
|
|
|
|
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
|
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
|
|
|
|
|
|
|
|
|
fun clickAddOnsReportSiteIssue(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
|
|
|
|
|
|
addOnsButton().click()
|
|
|
|
|
|
|
|
addOnsReportSiteIssueButton().click()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BrowserRobot().interact()
|
|
|
|
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun openSettings(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
|
|
|
|
fun openSettings(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
|
|
|
|
onView(withId(R.id.mozac_browser_menu_recyclerView)).perform(ViewActions.swipeDown())
|
|
|
|
onView(withId(R.id.mozac_browser_menu_recyclerView)).perform(ViewActions.swipeDown())
|
|
|
|
onView(allOf(withResourceName("text"), withText(R.string.browser_menu_settings)))
|
|
|
|
onView(allOf(withResourceName("text"), withText(R.string.browser_menu_settings)))
|
|
|
@ -224,13 +220,6 @@ class ThreeDotMenuMainRobot {
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun goBackToBrowser(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
|
|
|
|
|
|
mDevice.pressBack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BrowserRobot().interact()
|
|
|
|
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun close(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
|
|
|
fun close(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
|
|
|
// Close three dot
|
|
|
|
// Close three dot
|
|
|
|
mDevice.pressBack()
|
|
|
|
mDevice.pressBack()
|
|
|
@ -359,6 +348,13 @@ class ThreeDotMenuMainRobot {
|
|
|
|
SettingsSubMenuAddonsManagerRobot().interact()
|
|
|
|
SettingsSubMenuAddonsManagerRobot().interact()
|
|
|
|
return SettingsSubMenuAddonsManagerRobot.Transition()
|
|
|
|
return SettingsSubMenuAddonsManagerRobot.Transition()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun exitSaveCollection(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
|
|
|
|
|
|
exitSaveCollectionButton().click()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BrowserRobot().interact()
|
|
|
|
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -372,9 +368,10 @@ private fun assertSettingsButton() = settingsButton()
|
|
|
|
.check(matches(isCompletelyDisplayed()))
|
|
|
|
.check(matches(isCompletelyDisplayed()))
|
|
|
|
|
|
|
|
|
|
|
|
private fun addOnsButton() = onView(allOf(withText("Add-ons")))
|
|
|
|
private fun addOnsButton() = onView(allOf(withText("Add-ons")))
|
|
|
|
private fun assertAddOnsButton() = addOnsButton()
|
|
|
|
private fun assertAddOnsButton() {
|
|
|
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
onView(withId(R.id.mozac_browser_menu_menuView)).perform(swipeDown())
|
|
|
|
private fun addOnsReportSiteIssueButton() = onView(allOf(withText("Report Site Issue…")))
|
|
|
|
addOnsButton().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()
|
|
|
@ -397,8 +394,10 @@ private fun assertForwardButton() = forwardButton()
|
|
|
|
.check(matches(withEffectiveVisibility(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() {
|
|
|
|
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
onView(withId(R.id.mozac_browser_menu_menuView)).perform(swipeUp())
|
|
|
|
|
|
|
|
addBookmarkButton().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()
|
|
|
@ -454,10 +453,10 @@ private fun SendToDeviceTitle() =
|
|
|
|
private fun assertSendToDeviceTitle() = SendToDeviceTitle()
|
|
|
|
private fun assertSendToDeviceTitle() = SendToDeviceTitle()
|
|
|
|
.check(matches(withEffectiveVisibility(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")))
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertShareALinkTitle() = ShareALinkTitle()
|
|
|
|
private fun assertShareALinkTitle() = shareALinkTitle()
|
|
|
|
|
|
|
|
|
|
|
|
private fun whatsNewButton() = onView(
|
|
|
|
private fun whatsNewButton() = onView(
|
|
|
|
allOf(
|
|
|
|
allOf(
|
|
|
@ -511,12 +510,8 @@ private fun assertAddToMobileHome() {
|
|
|
|
private fun desktopSiteButton() =
|
|
|
|
private fun desktopSiteButton() =
|
|
|
|
onView(allOf(withText(R.string.browser_menu_desktop_site)))
|
|
|
|
onView(allOf(withText(R.string.browser_menu_desktop_site)))
|
|
|
|
private fun assertDesktopSite() {
|
|
|
|
private fun assertDesktopSite() {
|
|
|
|
onView(withId(R.id.mozac_browser_menu_recyclerView))
|
|
|
|
onView(withId(R.id.mozac_browser_menu_menuView)).perform(swipeUp())
|
|
|
|
.perform(
|
|
|
|
desktopSiteButton().check(matches(isDisplayed()))
|
|
|
|
RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>(
|
|
|
|
|
|
|
|
hasDescendant(withText(R.string.browser_menu_desktop_site))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun openInAppButton() =
|
|
|
|
private fun openInAppButton() =
|
|
|
@ -530,9 +525,15 @@ private fun assertOpenInAppButton() {
|
|
|
|
).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun addonsManagerButton() = onView(withText("Add-ons Manager"))
|
|
|
|
private fun downloadsButton() = onView(withText(R.string.library_downloads))
|
|
|
|
|
|
|
|
private fun assertDownloadsButton() {
|
|
|
|
|
|
|
|
onView(withId(R.id.mozac_browser_menu_menuView)).perform(swipeDown())
|
|
|
|
|
|
|
|
downloadsButton().check(matches(isDisplayed()))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun clickAddonsManagerButton() {
|
|
|
|
private fun clickAddonsManagerButton() {
|
|
|
|
onView(withId(R.id.mozac_browser_menu_menuView)).perform(swipeDown())
|
|
|
|
onView(withId(R.id.mozac_browser_menu_menuView)).perform(swipeDown())
|
|
|
|
onView(withText("Add-ons")).check(matches(isCompletelyDisplayed())).click()
|
|
|
|
addOnsButton().check(matches(isCompletelyDisplayed())).click()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun exitSaveCollectionButton() = onView(withId(R.id.back_button)).check(matches(isDisplayed()))
|
|
|
|