For #27392 fix flaky verifyAboutFirefoxPreview UI test

pull/543/head
AndiAJ 2 years ago committed by mergify[bot]
parent 00327bb4e4
commit 39937f51c9

@ -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 {
settingsList().scrollToEnd(LISTS_MAXSWIPES)
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"))
}

Loading…
Cancel
Save