mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/23816 fix disabled verifyMultipleLoginsSelectionsTest UI test
This commit is contained in:
parent
cad6b21cd1
commit
9490fea9e9
@ -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
|
||||
@ -42,14 +42,11 @@ 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 {
|
||||
@ -57,8 +54,8 @@ class SettingsPrivacyTest {
|
||||
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 =
|
||||
@ -301,7 +298,6 @@ class SettingsPrivacyTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("Intermittent failures, see: https://github.com/mozilla-mobile/fenix/issues/23816")
|
||||
@SmokeTest
|
||||
@Test
|
||||
fun verifyMultipleLoginsSelectionsTest() {
|
||||
|
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user