This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 comments
- Loading branch information
1 parent
0206082
commit 4582c25
Showing
8 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...st/java/org/mozilla/fenix/ui/robots/SettingsSubMenuLoginsAndPasswordOptionsToSaveRobot.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters