2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-02 03:40:16 +00:00

[fenix] [UI Smoke Tests] New undoDeleteBookmarkFolderTest UI test and Improve coverage for deleteNonEmptyBookmarkFolderTest UI test (https://github.com/mozilla-mobile/fenix/pull/22587)

* New undoDeleteBookmarkFolderTest smoke UI test

* Improve coverage for deleteNonEmptyBookmarkFolderTest UI smoke test

Co-authored-by: AndiAJ <andiaj@users.noreply.github.com>
This commit is contained in:
Andrei Joltan 2021-12-07 15:54:05 +02:00 committed by GitHub
parent 87203e4afb
commit edd33f2685
3 changed files with 43 additions and 1 deletions

View File

@ -627,4 +627,30 @@ class BookmarksTest {
verifyBookmarkIsDeleted("Test_Page_1")
}
}
@SmokeTest
@Test
fun undoDeleteBookmarkFolderTest() {
browserScreen {
}.openThreeDotMenu {
}.openBookmarks {
bookmarksListIdlingResource =
RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.bookmark_list), 1)
IdlingRegistry.getInstance().register(bookmarksListIdlingResource!!)
createFolder("My Folder")
verifyFolderTitle("My Folder")
IdlingRegistry.getInstance().unregister(bookmarksListIdlingResource!!)
}.openThreeDotMenu("My Folder") {
}.clickDelete {
cancelFolderDeletion()
verifyFolderTitle("My Folder")
}.openThreeDotMenu("My Folder") {
}.clickDelete {
confirmDeletion()
verifyDeleteSnackBarText()
clickUndoDeleteButton()
verifyFolderTitle("My Folder")
}
}
}

View File

@ -945,6 +945,18 @@ class SmokeTest {
verifyFolderTitle("My Folder")
IdlingRegistry.getInstance().unregister(bookmarksListIdlingResource!!)
}.openThreeDotMenu("Test_Page_1") {
}.clickEdit {
clickParentFolderSelector()
selectFolder("My Folder")
navigateUp()
saveEditBookmark()
createFolder("My Folder 2")
bookmarksListIdlingResource =
RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.bookmark_list), 1)
IdlingRegistry.getInstance().register(bookmarksListIdlingResource!!)
verifyFolderTitle("My Folder 2")
IdlingRegistry.getInstance().unregister(bookmarksListIdlingResource!!)
}.openThreeDotMenu("My Folder 2") {
}.clickEdit {
clickParentFolderSelector()
selectFolder("My Folder")
@ -958,12 +970,15 @@ class SmokeTest {
}.clickDelete {
confirmDeletion()
verifyDeleteSnackBarText()
verifyBookmarkIsDeleted("My Folder")
verifyBookmarkIsDeleted("My Folder 2")
verifyBookmarkIsDeleted("Test_Page_1")
navigateUp()
}
browserScreen {
}.openThreeDotMenu {
verifyBookmarksButton()
verifyAddBookmarkButton()
}
}

View File

@ -369,6 +369,7 @@ private fun assertBookmarkIsDeleted(expectedTitle: String) {
assertFalse(
mDevice.findObject(
UiSelector()
.resourceId("$packageName:id/title")
.textContains(expectedTitle)
).waitForExists(waitingTime)
)