|
|
|
@ -132,8 +132,6 @@ class BookmarksRobot {
|
|
|
|
|
addFolderButton().click()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun clickdeleteBookmarkButton() = deleteBookmarkButton().click()
|
|
|
|
|
|
|
|
|
|
fun addNewFolderName(name: String) {
|
|
|
|
|
addFolderTitleField()
|
|
|
|
|
.click()
|
|
|
|
@ -166,7 +164,7 @@ class BookmarksRobot {
|
|
|
|
|
|
|
|
|
|
fun saveEditBookmark() {
|
|
|
|
|
saveBookmarkButton().click()
|
|
|
|
|
mDevice.findObject(UiSelector().resourceId("R.id.bookmark_list")).waitForExists(waitingTime)
|
|
|
|
|
mDevice.findObject(UiSelector().resourceId("org.mozilla.fenix.debug:id/bookmark_list")).waitForExists(waitingTime)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun clickParentFolderSelector() = bookmarkFolderSelector().click()
|
|
|
|
@ -190,31 +188,6 @@ class BookmarksRobot {
|
|
|
|
|
return Transition()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun goBackToBrowser(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
|
|
|
closeButton().click()
|
|
|
|
|
|
|
|
|
|
BrowserRobot().interact()
|
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun confirmBookmarkFolderDeletionAndGoBackToBrowser(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
|
|
|
onView(withText(R.string.delete_browsing_data_prompt_allow))
|
|
|
|
|
.inRoot(RootMatchers.isDialog())
|
|
|
|
|
.check(matches(isDisplayed()))
|
|
|
|
|
.click()
|
|
|
|
|
|
|
|
|
|
BrowserRobot().interact()
|
|
|
|
|
return BrowserRobot.Transition()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun openThreeDotMenu(interact: ThreeDotMenuBookmarksRobot.() -> Unit): ThreeDotMenuBookmarksRobot.Transition {
|
|
|
|
|
mDevice.waitNotNull(Until.findObject(res("org.mozilla.fenix.debug:id/overflow_menu")))
|
|
|
|
|
threeDotMenu().click()
|
|
|
|
|
|
|
|
|
|
ThreeDotMenuBookmarksRobot().interact()
|
|
|
|
|
return ThreeDotMenuBookmarksRobot.Transition()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun openThreeDotMenu(bookmarkTitle: String, interact: ThreeDotMenuBookmarksRobot.() -> Unit): ThreeDotMenuBookmarksRobot.Transition {
|
|
|
|
|
mDevice.waitNotNull(Until.findObject(res("org.mozilla.fenix.debug:id/overflow_menu")))
|
|
|
|
|
threeDotMenu(bookmarkTitle).click()
|
|
|
|
@ -259,7 +232,7 @@ private fun bookmarkFavicon(url: String) = onView(
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
private fun bookmarkURL(url: String) = onView(allOf(withId(R.id.url), withText(url)))
|
|
|
|
|
private fun bookmarkURL(url: String) = onView(allOf(withId(R.id.url), withText(containsString(url))))
|
|
|
|
|
|
|
|
|
|
private fun addFolderButton() = onView(withId(R.id.add_bookmark_folder))
|
|
|
|
|
|
|
|
|
@ -267,8 +240,6 @@ private fun addFolderTitleField() = onView(withId(R.id.bookmarkNameEdit))
|
|
|
|
|
|
|
|
|
|
private fun saveFolderButton() = onView(withId(R.id.confirm_add_folder_button))
|
|
|
|
|
|
|
|
|
|
private fun deleteBookmarkButton() = onView(withId(R.id.delete_bookmark_button))
|
|
|
|
|
|
|
|
|
|
private fun threeDotMenu(bookmarkUrl: Uri) = onView(
|
|
|
|
|
allOf(
|
|
|
|
|
withId(R.id.overflow_menu),
|
|
|
|
@ -283,8 +254,6 @@ private fun threeDotMenu(bookmarkTitle: String) = onView(
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
private fun threeDotMenu() = onView(withId(R.id.overflow_menu)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
|
|
|
|
|
|
|
|
|
private fun snackBarText() = onView(withId(R.id.snackbar_text))
|
|
|
|
|
|
|
|
|
|
private fun snackBarUndoButton() = onView(withId(R.id.snackbar_btn))
|
|
|
|
@ -306,7 +275,7 @@ private fun assertBookmarksView() {
|
|
|
|
|
withParent(withId(R.id.navigationToolbar))
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
|
|
|
|
.check(matches(isDisplayed()))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun assertEmptyBookmarksList() =
|
|
|
|
@ -321,7 +290,7 @@ private fun assertBookmarkFavicon(forUrl: Uri) = bookmarkFavicon(forUrl.toString
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
private fun assertBookmarkURL(expectedURL: String) =
|
|
|
|
|
mDevice.findObject(UiSelector().text(expectedURL))
|
|
|
|
|
bookmarkURL(expectedURL).check(matches(isDisplayed()))
|
|
|
|
|
|
|
|
|
|
private fun assertFolderTitle(expectedTitle: String) =
|
|
|
|
|
onView(withText(expectedTitle)).check(matches(isDisplayed()))
|
|
|
|
@ -359,13 +328,13 @@ private fun assertKeyboardVisibility(isExpectedToBeVisible: Boolean) =
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
private fun assertShareOverlay() =
|
|
|
|
|
onView(withId(R.id.shareWrapper)).check(matches(ViewMatchers.isDisplayed()))
|
|
|
|
|
onView(withId(R.id.shareWrapper)).check(matches(isDisplayed()))
|
|
|
|
|
|
|
|
|
|
private fun assertShareBookmarkTitle() =
|
|
|
|
|
onView(withId(R.id.share_tab_title)).check(matches(ViewMatchers.isDisplayed()))
|
|
|
|
|
onView(withId(R.id.share_tab_title)).check(matches(isDisplayed()))
|
|
|
|
|
|
|
|
|
|
private fun assertShareBookmarkFavicon() =
|
|
|
|
|
onView(withId(R.id.share_tab_favicon)).check(matches(ViewMatchers.isDisplayed()))
|
|
|
|
|
onView(withId(R.id.share_tab_favicon)).check(matches(isDisplayed()))
|
|
|
|
|
|
|
|
|
|
private fun assertShareBookmarkUrl() =
|
|
|
|
|
onView(withId(R.id.share_tab_url)).check(matches(isDisplayed()))
|
|
|
|
|