2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00

For #27392 fix flaky verifyAboutFirefoxPreview UI test

This commit is contained in:
AndiAJ 2022-11-04 14:56:58 +02:00 committed by mergify[bot]
parent 00327bb4e4
commit 39937f51c9

View File

@ -44,6 +44,7 @@ import org.junit.Assert.assertTrue
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.Constants.LISTS_MAXSWIPES import org.mozilla.fenix.helpers.Constants.LISTS_MAXSWIPES
import org.mozilla.fenix.helpers.Constants.PackageName.GOOGLE_PLAY_SERVICES import org.mozilla.fenix.helpers.Constants.PackageName.GOOGLE_PLAY_SERVICES
import org.mozilla.fenix.helpers.Constants.RETRY_COUNT
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestHelper.appName import org.mozilla.fenix.helpers.TestHelper.appName
import org.mozilla.fenix.helpers.TestHelper.getStringResource import org.mozilla.fenix.helpers.TestHelper.getStringResource
@ -575,7 +576,21 @@ private fun rateOnGooglePlayHeading(): UiObject {
} }
private fun aboutFirefoxHeading(): UiObject { private fun aboutFirefoxHeading(): UiObject {
for (i in 1..RETRY_COUNT) {
try {
settingsList().scrollToEnd(LISTS_MAXSWIPES) settingsList().scrollToEnd(LISTS_MAXSWIPES)
assertTrue(
mDevice.findObject(UiSelector().text("About $appName"))
.waitForExists(waitingTime),
)
break
} catch (e: AssertionError) {
if (i == RETRY_COUNT) {
throw e
}
}
}
return mDevice.findObject(UiSelector().text("About $appName")) return mDevice.findObject(UiSelector().text("About $appName"))
} }