diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt index 15ba722f60..99ae1910d5 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt @@ -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() + } + } } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt index 207c8f9b14..f1c8777f50 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt @@ -1064,7 +1064,7 @@ class SmokeTest { verifyFolderTitle("My Folder") }.openThreeDotMenu("My Folder") { }.clickDelete { - confirmFolderDeletion() + confirmDeletion() verifyDeleteSnackBarText() navigateUp() } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BookmarksRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BookmarksRobot.kt index 6a222b9475..848cfc593f 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BookmarksRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BookmarksRobot.kt @@ -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() {