Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
6002CEM_8918189/app/src/androidTest/java/com/example/booksharing21/RegisterActivityExpress.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
57 lines (39 sloc)
2.11 KB
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
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 RegisterActivityExpress { | |
private static final String VALID_Email = "john.doe@outlook.com"; | |
private static final String VALID_Password = "1234john"; | |
// https://developer.android.com/training/testing/espresso/intents testing view using express test | |
@Rule | |
public ActivityScenarioRule<RegisterActivity> activityRule = new ActivityScenarioRule<>(RegisterActivity.class); | |
@Test | |
public void bannerRegister (){ onView(withId(R.id.banner)); } | |
@Test | |
public void usernameRegister(){onView(withId(R.id.username)).perform(typeText("Jane"),closeSoftKeyboard());} | |
@Test | |
public void EmailRegister(){onView(withId(R.id.email)).perform(typeText(VALID_Email),closeSoftKeyboard()); } | |
@Test | |
public void passwordRegister(){onView(withId(R.id.password)).perform(typeText(VALID_Password), closeSoftKeyboard());} | |
@Test | |
public void password2Register(){onView(withId(R.id.password2)).perform(typeText(VALID_Password), closeSoftKeyboard());} | |
@Test | |
public void AddressRegister(){onView(withId(R.id.address)).perform(typeText("Priory Street"), closeSoftKeyboard());} | |
@Test | |
public void phoneRegister() {onView(withId(R.id.phone)).perform(typeText("29289343456"), closeSoftKeyboard());} | |
@Test | |
public void buttonRegister (){ onView(withId(R.id.reg1)).perform(click()).check(matches(isDisplayed())); } | |
} |