For #25125 fix flaky downloadMultipleFileTypesTest UI test

This commit is contained in:
AndiAJ 2022-06-02 17:39:41 +03:00 committed by mergify[bot]
parent 9c6a127a40
commit e977e0292a
3 changed files with 4 additions and 8 deletions

View File

@ -5,9 +5,9 @@
package org.mozilla.fenix.helpers
import android.net.Uri
import java.util.concurrent.TimeUnit
import okhttp3.mockwebserver.MockWebServer
import org.mozilla.fenix.helpers.ext.toUri
import java.util.concurrent.TimeUnit
/**
* Helper for hosting web pages locally for testing purposes.

View File

@ -14,7 +14,6 @@ import org.junit.runners.Parameterized
import org.mozilla.fenix.customannotations.SmokeTest
import org.mozilla.fenix.helpers.FeatureSettingsHelper
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
import org.mozilla.fenix.helpers.RetryTestRule
import org.mozilla.fenix.ui.robots.navigationToolbar
/**
@ -33,10 +32,6 @@ class DownloadFileTypesTest(fileName: String) {
@get:Rule
val activityTestRule = HomeActivityIntentTestRule()
@Rule
@JvmField
val retryTestRule = RetryTestRule(3)
companion object {
// Creating test data. The test will take each file name as a parameter and run it individually.
@JvmStatic

View File

@ -27,6 +27,7 @@ import org.junit.Assert.assertTrue
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.Constants.PackageName.GOOGLE_APPS_PHOTOS
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeLong
import org.mozilla.fenix.helpers.TestHelper
import org.mozilla.fenix.helpers.TestHelper.assertExternalAppOpens
import org.mozilla.fenix.helpers.TestHelper.packageName
@ -140,12 +141,12 @@ private fun assertDownloadPrompt(fileName: String) {
assertTrue(
"Download prompt button not visible",
mDevice.findObject(UiSelector().resourceId("$packageName:id/download_button"))
.waitForExists(waitingTime)
.waitForExists(waitingTimeLong)
)
assertTrue(
"$fileName title doesn't match",
mDevice.findObject(UiSelector().text(fileName))
.waitForExists(waitingTime)
.waitForExists(waitingTimeLong)
)
break