2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/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 b7c039a7ca
commit ddc846eca8

View File

@ -44,6 +44,7 @@ import org.junit.Assert.assertTrue
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.Constants.LISTS_MAXSWIPES
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.TestHelper.appName
import org.mozilla.fenix.helpers.TestHelper.getStringResource
@ -575,7 +576,21 @@ private fun rateOnGooglePlayHeading(): UiObject {
}
private fun aboutFirefoxHeading(): UiObject {
for (i in 1..RETRY_COUNT) {
try {
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"))
}