For #12895 Fix Intermittent test navigateBookmarksFoldersTest

upstream-sync
AndiAJ 3 years ago committed by Oana Horvath
parent c488bb0e11
commit a4a2a59b7d

@ -494,12 +494,16 @@ class BookmarksTest {
}.openBookmarks { }.openBookmarks {
createFolder("1") createFolder("1")
getInstrumentation().waitForIdleSync() getInstrumentation().waitForIdleSync()
waitForBookmarksFolderContentToExist("Bookmarks", "1")
selectFolder("1") selectFolder("1")
verifyCurrentFolderTitle("1")
createFolder("2") createFolder("2")
getInstrumentation().waitForIdleSync() getInstrumentation().waitForIdleSync()
waitForBookmarksFolderContentToExist("1", "2")
selectFolder("2") selectFolder("2")
verifyCurrentFolderTitle("2") verifyCurrentFolderTitle("2")
navigateUp() navigateUp()
waitForBookmarksFolderContentToExist("1", "2")
verifyCurrentFolderTitle("1") verifyCurrentFolderTitle("1")
mDevice.pressBack() mDevice.pressBack()
verifyBookmarksMenuView() verifyBookmarksMenuView()

@ -105,6 +105,10 @@ class BookmarksRobot {
fun verifySelectDefaultFolderSnackBarText() = assertSnackBarText("Cant edit default folders") fun verifySelectDefaultFolderSnackBarText() = assertSnackBarText("Cant edit default folders")
fun verifyCurrentFolderTitle(title: String) { fun verifyCurrentFolderTitle(title: String) {
mDevice.findObject(UiSelector().resourceId("$packageName:id/navigationToolbar")
.textContains(title))
.waitForExists(waitingTime)
onView( onView(
allOf( allOf(
withText(title), withText(title),
@ -114,6 +118,14 @@ class BookmarksRobot {
.check(matches(isDisplayed())) .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() = fun verifySignInToSyncButton() =
signInToSyncButton().check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) signInToSyncButton().check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))

Loading…
Cancel
Save