2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] New deleteBookmarkInEditModeTest UI test

This commit is contained in:
AndiAJ 2021-09-13 16:53:25 +03:00 committed by mergify[bot]
parent 9cf25c9c64
commit ba70d609f1
3 changed files with 28 additions and 4 deletions

View File

@ -441,12 +441,12 @@ class BookmarksTest {
}.openThreeDotMenu("1") {
}.clickDelete {
verifyDeleteFolderConfirmationMessage()
confirmFolderDeletion()
confirmDeletion()
verifyDeleteSnackBarText()
}.openThreeDotMenu("2") {
}.clickDelete {
verifyDeleteFolderConfirmationMessage()
confirmFolderDeletion()
confirmDeletion()
verifyDeleteSnackBarText()
verifyFolderTitle("3")
}.closeMenu {
@ -537,4 +537,24 @@ class BookmarksTest {
verifyHomeScreen()
}
}
@Test
fun deleteBookmarkInEditModeTest() {
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
browserScreen {
createBookmark(defaultWebPage.url)
}.openThreeDotMenu {
}.openBookmarks {
bookmarksListIdlingResource =
RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.bookmark_list), 2)
IdlingRegistry.getInstance().register(bookmarksListIdlingResource!!)
}.openThreeDotMenu(defaultWebPage.url) {
IdlingRegistry.getInstance().unregister(bookmarksListIdlingResource!!)
}.clickEdit {
clickDeleteInEditModeButton()
confirmDeletion()
verifyDeleteSnackBarText()
}
}
}

View File

@ -1064,7 +1064,7 @@ class SmokeTest {
verifyFolderTitle("My Folder")
}.openThreeDotMenu("My Folder") {
}.clickDelete {
confirmFolderDeletion()
confirmDeletion()
verifyDeleteSnackBarText()
navigateUp()
}

View File

@ -197,13 +197,15 @@ class BookmarksRobot {
fun longTapDesktopFolder(title: String) = onView(withText(title)).perform(longClick())
fun confirmFolderDeletion() {
fun confirmDeletion() {
onView(withText(R.string.delete_browsing_data_prompt_allow))
.inRoot(RootMatchers.isDialog())
.check(matches(isDisplayed()))
.click()
}
fun clickDeleteInEditModeButton() = deleteInEditModeButton().click()
class Transition {
fun closeMenu(interact: HomeScreenRobot.() -> Unit): Transition {
closeButton().click()
@ -290,6 +292,8 @@ private fun bookmarkURLEditBox() = onView(withId(R.id.bookmarkUrlEdit))
private fun saveBookmarkButton() = onView(withId(R.id.save_bookmark_button))
private fun deleteInEditModeButton() = onView(withId(R.id.delete_bookmark_button))
private fun signInToSyncButton() = onView(withId(R.id.bookmark_folders_sign_in))
private fun assertBookmarksView() {