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 dcf5a6c4f..3b50a489f 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt @@ -494,12 +494,16 @@ class BookmarksTest { }.openBookmarks { createFolder("1") getInstrumentation().waitForIdleSync() + waitForBookmarksFolderContentToExist("Bookmarks", "1") selectFolder("1") + verifyCurrentFolderTitle("1") createFolder("2") getInstrumentation().waitForIdleSync() + waitForBookmarksFolderContentToExist("1", "2") selectFolder("2") verifyCurrentFolderTitle("2") navigateUp() + waitForBookmarksFolderContentToExist("1", "2") verifyCurrentFolderTitle("1") mDevice.pressBack() verifyBookmarksMenuView() 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 8eddc0384..3f15b840e 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 @@ -105,6 +105,10 @@ class BookmarksRobot { fun verifySelectDefaultFolderSnackBarText() = assertSnackBarText("Can’t edit default folders") fun verifyCurrentFolderTitle(title: String) { + mDevice.findObject(UiSelector().resourceId("$packageName:id/navigationToolbar") + .textContains(title)) + .waitForExists(waitingTime) + onView( allOf( withText(title), @@ -114,6 +118,14 @@ class BookmarksRobot { .check(matches(isDisplayed())) } + fun waitForBookmarksFolderContentToExist(parentFolderName: String, childFolderName: String) { + mDevice.findObject(UiSelector().resourceId("$packageName:id/navigationToolbar") + .textContains(parentFolderName)) + .waitForExists(waitingTime) + + mDevice.waitNotNull(Until.findObject(By.text(childFolderName)), waitingTime) + } + fun verifySignInToSyncButton() = signInToSyncButton().check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))