This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from MaximeZmt/laurislopata/edit-profile
Laurislopata/edit profile
- Loading branch information
Showing
9 changed files
with
254 additions
and
72 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 |
---|---|---|
|
@@ -38,38 +38,83 @@ class SignInActivityTest { | |
Register::class.java | ||
) | ||
|
||
|
||
@Test | ||
fun logInCorrect() { | ||
val username = "john@test.com" | ||
fun logInIncorrect() { | ||
val username = "johnyyy@test.com" | ||
val password = "password" | ||
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.logIn)).perform(click()) | ||
Thread.sleep(3_000) | ||
onView(withId(R.id.email)).check(matches(withText("[email protected]"))) | ||
onView(withId(R.id.email)).check(matches(withText("Authentication error"))) | ||
} | ||
|
||
@Test | ||
fun logInIncorrect() { | ||
val username = "johnyyy@test.com" | ||
fun createAccountIncorrect() { | ||
val username = "john@test.com" | ||
val password = "password" | ||
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.logIn)).perform(click()) | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
Thread.sleep(3_000) | ||
onView(withId(R.id.email)).check(matches(withText("Authentication error"))) | ||
} | ||
|
||
@Test | ||
fun createAccountIncorrect() { | ||
val username = "[email protected]" | ||
fun stringValidationEmptyUsername() { | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
onView(withId(R.id.email)).check(matches(withText("Empty email or password"))) | ||
} | ||
|
||
@Test | ||
fun stringValidationEmptyUPassword() { | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
onView(withId(R.id.email)).check(matches(withText("Empty email or password"))) | ||
} | ||
|
||
@Test | ||
fun stringValidationWrongEmail() { | ||
val username = "john" | ||
val password = "password" | ||
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
onView(withId(R.id.email)).check(matches(withText("Not an email"))) | ||
} | ||
|
||
@Test | ||
fun stringValidationShorPassword() { | ||
val username = "[email protected]" | ||
val password = "12345" | ||
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
onView(withId(R.id.email)).check(matches(withText("Password has to be at least 6 symbols"))) | ||
} | ||
|
||
@Test | ||
fun derinTest() { | ||
val a = FireBaseAuthenticator() | ||
a.googleActivityResult(-1,-1,null) | ||
onView(withId(R.id.email)).check(matches(withText("TextView"))) | ||
} | ||
|
||
@Test | ||
fun ardaTest() { | ||
val a = FireBaseAuthenticator() | ||
a.googleActivityResult(1000,-1,null) | ||
onView(withId(R.id.email)).check(matches(withText("TextView"))) | ||
} | ||
|
||
@Test | ||
fun logInCorrect() { | ||
val username = "[email protected]" | ||
val password = "password" | ||
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.logIn)).perform(click()) | ||
Thread.sleep(3_000) | ||
onView(withId(R.id.email)).check(matches(withText("Authentication error"))) | ||
onView(withId(R.id.email)).check(matches(withText("[email protected]"))) | ||
} | ||
|
||
@Test | ||
|
@@ -85,5 +130,4 @@ class SignInActivityTest { | |
} | ||
|
||
|
||
|
||
} |
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
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
Oops, something went wrong.