Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into 24855
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored May 9, 2022
2 parents 36d6d4d + 98455c0 commit 15341b5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import org.junit.Test
import org.mozilla.fenix.customannotations.SmokeTest
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.FeatureSettingsHelper
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
import org.mozilla.fenix.helpers.RetryTestRule
import org.mozilla.fenix.helpers.TestAssetHelper
import org.mozilla.fenix.helpers.TestHelper
import org.mozilla.fenix.helpers.TestHelper.appContext
Expand All @@ -42,23 +42,20 @@ class SettingsPrivacyTest {
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
private lateinit var mockWebServer: MockWebServer
private val pageShortcutName = "TestShortcut"
private val featureSettingsHelper = FeatureSettingsHelper()

@get:Rule
val activityTestRule = HomeActivityIntentTestRule()

@Rule
@JvmField
val retryTestRule = RetryTestRule(3)

@Before
fun setUp() {
mockWebServer = MockWebServer().apply {
dispatcher = AndroidAssetDispatcher()
start()
}

val settings = activityTestRule.activity.applicationContext.settings()
settings.shouldShowJumpBackInCFR = false
featureSettingsHelper.setJumpBackCFREnabled(false)
featureSettingsHelper.disablePwaCFR(true)

if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
val autofillManager: AutofillManager =
Expand Down Expand Up @@ -301,7 +298,6 @@ class SettingsPrivacyTest {
}
}

@Ignore("Intermittent failures, see: https://github.com/mozilla-mobile/fenix/issues/23816")
@SmokeTest
@Test
fun verifyMultipleLoginsSelectionsTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,25 @@ class BrowserRobot {
}

fun verifyPrefilledLoginCredentials(userName: String) {
var currentTries = 0
// Sometimes the assertion of the pre-filled logins fails so we are re-trying after refreshing the page
while (currentTries++ < 3) {
try {
mDevice.waitForObjects(userNameTextBox)
assertTrue(userNameTextBox.text.equals(userName))

break
} catch (e: AssertionError) {
browserScreen {
}.openThreeDotMenu {
}.refreshPage {
clearUserNameLoginCredential()
clickSuggestedLoginsButton()
verifySuggestedUserName(userName)
clickLoginSuggestion(userName)
}
}
}
mDevice.waitForObjects(userNameTextBox)
assertTrue(userNameTextBox.text.equals(userName))
}
Expand Down

0 comments on commit 15341b5

Please sign in to comment.