This repository was archived by the owner on Dec 14, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/androidTest/java/mozilla/lockbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77package mozilla.lockbox.robots
88
9+ import android.view.KeyEvent
910import androidx.test.espresso.Espresso.onView
1011import androidx.test.espresso.action.ViewActions.click
1112import androidx.test.espresso.action.ViewActions.replaceText
@@ -22,9 +23,14 @@ class EditCredentialRobot : BaseTestRobot {
2223 fun closeEditChanges () = ClickActions .click { contentDescription(" Back" ) }
2324
2425 fun tapOnUserName () = onView(withId(R .id.inputUsername)).perform(click())
26+ fun tapOnPasswordRemoveChar () = onView(withId(R .id.inputPassword))
27+ .perform(click())
28+ .perform(pressKey(KeyEvent .KEYCODE_DEL ))
2529 fun editUserName (text : String ) = onView(withId(R .id.inputUsername)).perform(replaceText(text))
2630
27- fun editPassword (text : String ) = onView(withId(R .id.inputPassword)).perform(replaceText(text))
31+ fun editPassword (text : String ) = onView(withId(R .id.inputPassword))
32+ .perform(replaceText(text))
33+
2834 fun assertErrorEmptyPassord () = VisibilityAssertions .displayed { id(R .id.textinput_error) }
2935 fun noErrorEmptyPassword () = VisibilityAssertions .notDisplayed { id(R .id.textinput_error) }
3036}
Original file line number Diff line number Diff line change @@ -107,11 +107,13 @@ open class ItemDetailsTest {
107107 }
108108
109109 @Test
110- fun editItemInvalidTextFieldInput () {
110+ fun editItemInvalidPasswordInput () {
111111 navigator.gotoItemDetailKebabMenu()
112112 kebabMenu { tapEditButton() }
113113 editCredential {
114114 editPassword(" " )
115+ tapOnPasswordRemoveChar()
116+ tapOnUserName()
115117 assertErrorEmptyPassord()
116118 editPassword(" foo bar baz" )
117119 sleep(1000 )
You can’t perform that action at this time.
0 commit comments