[fenix] For https://github.com/mozilla-mobile/fenix/issues/26936 and https://github.com/mozilla-mobile/fenix/issues/26818 fix saveLoginFromPromptTest and neverSaveLoginFromPromptTest UI tests

pull/600/head
AndiAJ 2 years ago committed by mergify[bot]
parent 3951af62a6
commit e2378a2678

@ -475,11 +475,28 @@ class BrowserRobot {
}
fun verifySaveLoginPromptIsShown() {
mDevice.findObject(UiSelector().text("test@example.com")).waitForExists(waitingTime)
val submitButton = mDevice.findObject(By.res("submit"))
submitButton.clickAndWait(Until.newWindow(), waitingTime)
// Click save to save the login
mDevice.waitNotNull(Until.findObjects(text("Save")))
for (i in 1..RETRY_COUNT) {
try {
mDevice.findObject(
UiSelector()
.text("submit")
.resourceId("submit")
.className("android.widget.Button"),
)
.also { it.waitForExists(waitingTime) }
.also { it.clickAndWaitForNewWindow(waitingTime) }
break
} catch (e: UiObjectNotFoundException) {
if (i == RETRY_COUNT) {
throw e
} else {
browserScreen {
}.openThreeDotMenu {
}.refreshPage { }
}
}
}
}
fun verifyUpdateLoginPromptIsShown() {

Loading…
Cancel
Save