[fenix] For https://github.com/mozilla-mobile/fenix/issues/22095: fix intermittent click failure in verifyRateOnGooglePlayRedirect UI test

pull/600/head
Oana Horvath 3 years ago committed by mergify[bot]
parent 893dfb0393
commit 888e9365cc

@ -93,7 +93,7 @@ class SettingsRobot {
// ABOUT SECTION
fun verifyAboutHeading() = assertAboutHeading()
fun verifyRateOnGooglePlay() = assertRateOnGooglePlay()
fun verifyRateOnGooglePlay() = assertTrue(rateOnGooglePlayHeading().waitForExists(waitingTime))
fun verifyAboutFirefoxPreview() = assertTrue(aboutFirefoxHeading().waitForExists(waitingTime))
fun verifyGooglePlayRedirect() = assertGooglePlayRedirect()
@ -475,10 +475,15 @@ private fun assertAboutHeading(): ViewInteraction {
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
}
private fun assertRateOnGooglePlay(): ViewInteraction {
private fun rateOnGooglePlayHeading(): UiObject {
val rateOnGooglePlay = mDevice.findObject(UiSelector().text("Rate on Google Play"))
scrollToElementByText("Rate on Google Play")
return onView(withText("Rate on Google Play"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
if (!rateOnGooglePlay.exists()) {
settingsList().swipeUp(2)
rateOnGooglePlay.waitForExists(waitingTime)
}
return rateOnGooglePlay
}
private fun aboutFirefoxHeading(): UiObject {
@ -495,7 +500,7 @@ private fun aboutFirefoxHeading(): UiObject {
fun swipeToBottom() = onView(withId(R.id.recycler_view)).perform(ViewActions.swipeUp())
fun clickRateButtonGooglePlay() {
assertRateOnGooglePlay().click()
rateOnGooglePlayHeading().click()
}
private fun assertGooglePlayRedirect() {

Loading…
Cancel
Save