Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Changes in Xml files and Manifest // express testing in MainActivity
- Loading branch information
Showing
9 changed files
with
89 additions
and
20 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
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,66 @@ | ||
package com.example.booksharing21; | ||
|
||
|
||
import static androidx.test.espresso.Espresso.onView; | ||
import static androidx.test.espresso.action.ViewActions.click; | ||
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; | ||
import static androidx.test.espresso.action.ViewActions.typeText; | ||
import static androidx.test.espresso.assertion.ViewAssertions.matches; | ||
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; | ||
import static androidx.test.espresso.matcher.ViewMatchers.withId; | ||
|
||
import androidx.test.ext.junit.rules.ActivityScenarioRule; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.SmallTest; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@SmallTest | ||
public class MainActivityExpress { | ||
|
||
|
||
private static final String VALID_Email = "john.doe@outlook.com"; | ||
|
||
private static final String VALID_Password = "1234john"; | ||
|
||
@Rule | ||
public ActivityScenarioRule<MainActivity> activityRule = | ||
new ActivityScenarioRule<>(MainActivity.class); | ||
|
||
|
||
// android developers https://developer.android.com/training/testing/espresso/basics | ||
// checking users credentials | ||
|
||
@Test | ||
public void ValidCredentials() { | ||
onView(withId(R.id.email)).perform(typeText(VALID_Email), closeSoftKeyboard()); | ||
onView(withId(R.id.password)).perform(typeText(VALID_Password),closeSoftKeyboard()); } | ||
@Test | ||
public void WrongEmail(){ | ||
onView(withId(R.id.email)).perform(typeText("john"),closeSoftKeyboard()); | ||
onView(withId(R.id.password)).perform(typeText(VALID_Password),closeSoftKeyboard()); } | ||
|
||
@Test | ||
public void WrongPassword(){ | ||
onView(withId(R.id.email)).perform(typeText(VALID_Email),closeSoftKeyboard()); | ||
onView(withId(R.id.password)).perform(typeText("doe"),closeSoftKeyboard()); } | ||
|
||
@Test | ||
public void NoCredentials(){ | ||
onView(withId(R.id.email)).perform(typeText(""),closeSoftKeyboard()); | ||
onView(withId(R.id.password)).perform(typeText(""),closeSoftKeyboard()); } | ||
|
||
|
||
@Test | ||
public void RegButton(){ onView(withId(R.id.reg)).perform(click()); } | ||
@Test | ||
public void logButton(){ onView(withId(R.id.log)).perform(click()).check(matches(isDisplayed())); } | ||
|
||
|
||
|
||
|
||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -6,9 +6,7 @@ import static org.junit.Assert.assertTrue; | ||
import org.junit.Test; | ||
|
||
|
||
|
||
// Register Testing | ||
|
||
public class RegisterValidationTest { | ||
|
||
|
||