-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed tests so that they expect button to the disabled #1098 #1099
Open
epicadk
wants to merge
6
commits into
anitab-org:develop
Choose a base branch
from
epicadk:fix#1098
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
91a7607
Fixed tests so that they expect button to the disabled #1098
epicadk 1e12c85
Merge remote-tracking branch 'upstream/develop' into fix#1098
epicadk 84fa78f
fix failing tests
epicadk 2f1a75f
Merge remote-tracking branch 'upstream/develop' into fix#1098
epicadk f2d819e
Temporarily disable tests.
epicadk 9f4e461
Temporarily disable tests.
epicadk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
app/src/androidTest/java/org/systers/mentorship/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,7 @@ import androidx.test.espresso.intent.Intents.intended | |
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent | ||
import androidx.test.espresso.intent.rule.IntentsTestRule | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import org.hamcrest.Description | ||
import org.hamcrest.Matcher | ||
import org.hamcrest.Matchers | ||
import org.hamcrest.TypeSafeMatcher | ||
import org.hamcrest.* | ||
import org.junit.After | ||
import org.junit.Before | ||
import org.junit.Rule | ||
|
@@ -75,7 +72,7 @@ class SignUpActivityTest { | |
*/ | ||
fun findEditTextInTextInputLayout(@IdRes textInputLayoutId: Int): ViewInteraction { | ||
|
||
return Espresso.onView(Matchers.allOf(ViewMatchers.isDescendantOfA(ViewMatchers.withId(textInputLayoutId)),ViewMatchers.isAssignableFrom(EditText::class.java))) | ||
return onView(Matchers.allOf(isDescendantOfA(withId(textInputLayoutId)), isAssignableFrom(EditText::class.java))) | ||
} | ||
|
||
|
||
|
@@ -127,8 +124,8 @@ class SignUpActivityTest { | |
} | ||
|
||
/** | ||
* This test method is defined to test that when all the fields are empty and the user | ||
* clicks the signUp button then the errors in all the fields are displayed or not | ||
* Input : All fields are empty | ||
* Expected : Button is disabled | ||
*/ | ||
@Test | ||
fun testSignUpClickedWhenAllFieldsAreEmpty() { | ||
|
@@ -142,12 +139,7 @@ class SignUpActivityTest { | |
|
||
onView(withId(R.id.btnSignUp)).perform(scrollTo(), click()) | ||
|
||
onView(withId(R.id.tiName)).check(matches(hasTextInputLayoutErrorText(EMPTY_NAME_ERROR))) | ||
onView(withId(R.id.tiUsername)).check(matches(hasTextInputLayoutErrorText(EMPTY_USERNAME_ERROR))) | ||
onView(withId(R.id.tiEmail)).check(matches(hasTextInputLayoutErrorText(EMPTY_EMAIL_ERROR))) | ||
onView(withId(R.id.tiPassword)).check(matches(hasTextInputLayoutErrorText(EMPTY_PASSWORD_ERROR))) | ||
onView(withId(R.id.tiConfirmPassword)).check(matches(hasTextInputLayoutErrorText(EMPTY_CONFIRM_PASSWORD_ERROR))) | ||
onView(withId(R.id.tvNoteSignUp)).check(matches(withEffectiveVisibility(Visibility.VISIBLE))) | ||
onView(withId(R.id.btnSignUp)).check(matches(CoreMatchers.not(isEnabled()))) | ||
|
||
} | ||
|
||
|
@@ -163,6 +155,7 @@ class SignUpActivityTest { | |
findEditTextInTextInputLayout(R.id.tiEmail).perform(typeText("[email protected]"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiPassword).perform(typeText("qwertz123!"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiConfirmPassword).perform(typeText("qwertz123!45"), closeSoftKeyboard()) | ||
onView(withId(R.id.cbMentor)).perform(click()) | ||
onView(withId(R.id.cbTC)).perform(click()) | ||
|
||
onView(withId(R.id.btnSignUp)).perform(scrollTo(), click()) | ||
|
@@ -183,7 +176,7 @@ class SignUpActivityTest { | |
findEditTextInTextInputLayout(R.id.tiPassword).perform(typeText("qwertz123!"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiConfirmPassword).perform(typeText("qwertz123!"), closeSoftKeyboard()) | ||
onView(withId(R.id.cbTC)).perform(click()) | ||
|
||
onView(withId(R.id.cbMentor)).perform(click()) | ||
onView(withId(R.id.btnSignUp)).perform(scrollTo(), click()) | ||
|
||
onView(withId(R.id.tiPassword)).check(matches(hasTextInputLayoutErrorText(TOO_WEAK_PASSWORD_ERROR))) | ||
|
@@ -201,6 +194,7 @@ class SignUpActivityTest { | |
findEditTextInTextInputLayout(R.id.tiEmail).perform(typeText("[email protected]"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiPassword).perform(typeText("Qwertz123"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiConfirmPassword).perform(typeText("Qwertz123"), closeSoftKeyboard()) | ||
onView(withId(R.id.cbMentor)).perform(click()) | ||
onView(withId(R.id.cbTC)).perform(click()) | ||
|
||
onView(withId(R.id.btnSignUp)).perform(scrollTo(), click()) | ||
|
@@ -225,10 +219,10 @@ class SignUpActivityTest { | |
@Test | ||
fun whenUsernameIsAlreadyRegistered() { | ||
findEditTextInTextInputLayout(R.id.tiName).perform(typeText("name"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiUsername).perform(typeText("Divyansh"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiEmail).perform(typeText("justdvnsh2208@gmail.com"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiPassword).perform(typeText("Divyansh@2001"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiConfirmPassword).perform(typeText("Divyansh@2001"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiUsername).perform(typeText("isabel"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiEmail).perform(typeText("random_emailid@gmail.com"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiPassword).perform(typeText("Password@2001"), closeSoftKeyboard()) | ||
findEditTextInTextInputLayout(R.id.tiConfirmPassword).perform(typeText("Password@2001"), closeSoftKeyboard()) | ||
onView(withId(R.id.cbBoth)).perform(click()) | ||
onView(withId(R.id.cbTC)).perform(click()) | ||
|
||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isabelcosta sorry I couldn't really think of any other username so I used your, if we do end up creating a user solely for testing we can update it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
username is fine ;)