From 76bf730782cff8ec5530d852b2731d641facdecc Mon Sep 17 00:00:00 2001 From: AndiAJ Date: Mon, 9 May 2022 15:13:05 +0300 Subject: [PATCH] For #24998 fix flaky deleteDeleteBrowsingHistoryDataTest UI test --- .../ui/robots/SettingsSubMenuDeleteBrowsingDataRobot.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuDeleteBrowsingDataRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuDeleteBrowsingDataRobot.kt index 8569cc97c9..5f6efe46d4 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuDeleteBrowsingDataRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuDeleteBrowsingDataRobot.kt @@ -134,7 +134,7 @@ private fun openTabsCheckBox() = onView(allOf(withId(R.id.checkbox), hasSibling( private fun browsingHistorySubsection() = onView(withText(R.string.preferences_delete_browsing_data_browsing_data_title)) -private fun browsingHistoryDescription(addresses: String) = onView(withText("$addresses addresses")) +private fun browsingHistoryDescription(addresses: String) = mDevice.findObject(UiSelector().textContains("$addresses addresses")) private fun browsingHistoryCheckBox() = onView(allOf(withId(R.id.checkbox), hasSibling(withText("Browsing history and site data")))) @@ -186,7 +186,7 @@ private fun assertAllOptionsAndCheckBoxes() { openTabsDescription("0").check(matches(withEffectiveVisibility(Visibility.VISIBLE))) openTabsCheckBox().check(matches(withEffectiveVisibility(Visibility.VISIBLE))) browsingHistorySubsection().check(matches(withEffectiveVisibility(Visibility.VISIBLE))) - browsingHistoryDescription("0").check(matches(withEffectiveVisibility(Visibility.VISIBLE))) + assertTrue(browsingHistoryDescription("0").waitForExists(waitingTime)) browsingHistoryCheckBox().check(matches(withEffectiveVisibility(Visibility.VISIBLE))) cookiesSubsection().check(matches(withEffectiveVisibility(Visibility.VISIBLE))) cookiesDescription().check(matches(withEffectiveVisibility(Visibility.VISIBLE))) @@ -213,7 +213,7 @@ private fun assertOpenTabsDescription(tabNumber: String) = openTabsDescription(tabNumber).check(matches(withEffectiveVisibility(Visibility.VISIBLE))) private fun assertBrowsingHistoryDescription(addresses: String) = - browsingHistoryDescription(addresses).check(matches(withEffectiveVisibility(Visibility.VISIBLE))) + assertTrue(browsingHistoryDescription(addresses).waitForExists(waitingTime)) private fun assertDeleteBrowsingDataSnackbar() { assertTrue(