UITests: New tests for save Login prompt (#8381)
* UITests: New tests for save Login prompt * fixing firebase timing issues when webpage loads * adding tests for don't save and check the prompt options * fix detekt issue * fix reviewer commentsfennec/beta
parent
020608275d
commit
4582c25208
@ -0,0 +1,22 @@
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
</head>
|
||||
|
||||
<body aria-label="body">
|
||||
|
||||
<form method="GET" action="passwordsubmit.html">
|
||||
<p>Username: <input id="username" type="text" value="test@example.com"></p>
|
||||
<p>Password: <input id="password" type="password" value="verysecret"></p>
|
||||
<p><input type="submit" id="submit" value="Login" aria-label="submit"/></p>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
document.getElementById("password").value = Math.random().toString();
|
||||
</script>
|
||||
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
</head>
|
||||
<body aria-label="body">
|
||||
<p>Password submitted. Nope just a test.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,38 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.ui.robots
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.action.ViewActions
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
||||
import org.hamcrest.CoreMatchers
|
||||
|
||||
/**
|
||||
* Implementation of Robot Pattern for the Privacy Settings > saved logins sub menu
|
||||
*/
|
||||
|
||||
class SettingsSubMenuLoginsAndPasswordOptionsToSaveRobot {
|
||||
fun verifySaveLoginsOptionsView() {
|
||||
onView(ViewMatchers.withText("Ask to save"))
|
||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
|
||||
onView(ViewMatchers.withText("Never save"))
|
||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
}
|
||||
|
||||
class Transition {
|
||||
fun goBack(interact: SettingsSubMenuLoginsAndPasswordRobot.() -> Unit): SettingsSubMenuLoginsAndPasswordRobot.Transition {
|
||||
goBackButton().perform(ViewActions.click())
|
||||
|
||||
SettingsSubMenuLoginsAndPasswordRobot().interact()
|
||||
return SettingsSubMenuLoginsAndPasswordRobot.Transition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun goBackButton() =
|
||||
onView(CoreMatchers.allOf(ViewMatchers.withContentDescription("Navigate up")))
|
Loading…
Reference in New Issue