Fixed the order of tests
This commit is contained in:
		
							parent
							
								
									45ede0cbd5
								
							
						
					
					
						commit
						2ea28277c3
					
				
					 7 changed files with 124 additions and 0 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								OlympusServices/.idea/caches/build_file_checksums.ser
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								OlympusServices/.idea/caches/build_file_checksums.ser
									
										
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -29,10 +29,13 @@ dependencies {
 | 
			
		|||
    implementation 'com.android.support:design:28.0.0'
 | 
			
		||||
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 | 
			
		||||
    testImplementation 'junit:junit:4.12'
 | 
			
		||||
    testImplementation 'androidx.test:core:1.0.0'
 | 
			
		||||
    testImplementation 'org.mockito:mockito-core:1.10.19'
 | 
			
		||||
    testImplementation 'org.robolectric:robolectric:4.0-alpha-3-SNAPSHOT'
 | 
			
		||||
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
 | 
			
		||||
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
 | 
			
		||||
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
 | 
			
		||||
    androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
 | 
			
		||||
    implementation 'com.jaredrummler:material-spinner:1.2.5'
 | 
			
		||||
    implementation 'com.android.support:design:28.0.0-alpha3'
 | 
			
		||||
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.support.test.rule.ActivityTestRule;
 | 
			
		||||
import android.support.test.runner.AndroidJUnit4;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import org.junit.Rule;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@RunWith(AndroidJUnit4.class)
 | 
			
		||||
public class LogInTest {
 | 
			
		||||
 | 
			
		||||
    @Rule
 | 
			
		||||
    public ActivityTestRule<LogIn> mActivityTestRule = new ActivityTestRule<LogIn>(LogIn.class);
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void checkSignIn() throws Exception{
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,27 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.support.test.annotation.UiThreadTest;
 | 
			
		||||
import android.support.test.rule.ActivityTestRule;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Rule;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
 | 
			
		||||
public class ServiceProviderTest {
 | 
			
		||||
    /*@Rule
 | 
			
		||||
    public ActivityTestRule<ServiceProvider> mActivityTestRule2 = new ActivityTestRule<ServiceProvider>(ServiceProvider.class);
 | 
			
		||||
    private ServiceProvider mActivity2 = null;
 | 
			
		||||
    private TextView text;
 | 
			
		||||
 | 
			
		||||
    @Before
 | 
			
		||||
    public void setUp() throws Exception{
 | 
			
		||||
        mActivity2=mActivityTestRule2.getActivity();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @UiThreadTest
 | 
			
		||||
    public void checkServices() throws Exception{
 | 
			
		||||
 | 
			
		||||
    }*/
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
public class ServiceTest {
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
public class ServiceTest2 {
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,64 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.support.test.rule.ActivityTestRule;
 | 
			
		||||
import android.support.test.runner.AndroidJUnit4;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
 | 
			
		||||
import org.junit.After;
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Rule;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
 | 
			
		||||
import static android.support.test.espresso.Espresso.onData;
 | 
			
		||||
import static android.support.test.espresso.Espresso.onView;
 | 
			
		||||
import static android.support.test.espresso.action.ViewActions.click;
 | 
			
		||||
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
 | 
			
		||||
import static android.support.test.espresso.action.ViewActions.typeText;
 | 
			
		||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
 | 
			
		||||
import static android.support.test.espresso.matcher.ViewMatchers.withSpinnerText;
 | 
			
		||||
import static java.util.regex.Pattern.matches;
 | 
			
		||||
import static org.hamcrest.CoreMatchers.containsString;
 | 
			
		||||
import static org.hamcrest.CoreMatchers.instanceOf;
 | 
			
		||||
import static org.hamcrest.CoreMatchers.is;
 | 
			
		||||
import static org.hamcrest.core.AllOf.allOf;
 | 
			
		||||
import static org.junit.Assert.*;
 | 
			
		||||
 | 
			
		||||
@RunWith(AndroidJUnit4.class)
 | 
			
		||||
public class SignUpTest {
 | 
			
		||||
 | 
			
		||||
    @Rule
 | 
			
		||||
    public ActivityTestRule<SignUp> mActivityTestRule = new ActivityTestRule<SignUp>(SignUp.class);
 | 
			
		||||
    private SignUp mActivity=null;
 | 
			
		||||
    private TextView text;
 | 
			
		||||
 | 
			
		||||
    @Before
 | 
			
		||||
    public void setUp() throws Exception {
 | 
			
		||||
        mActivity = mActivityTestRule.getActivity();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void checkSignUp1() throws Exception{
 | 
			
		||||
        onView(withId(R.id.UsernameInput)).perform(typeText("John123"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.PasswordInput)).perform(typeText("1234567890"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.FirstNameInput)).perform(typeText("John"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.LastNameInput)).perform(typeText("Doe"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.SignUp)).perform(click());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void checkSignUp2() throws Exception{
 | 
			
		||||
        onView(withId(R.id.RoleInput)).perform(click());
 | 
			
		||||
        onData(allOf(is(instanceOf(String.class)), is("Service Provider"))).perform(click());
 | 
			
		||||
        onView(withId(R.id.UsernameInput)).perform(typeText("Service123"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.PasswordInput)).perform(typeText("1234567890"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.FirstNameInput)).perform(typeText("Jane"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.LastNameInput)).perform(typeText("Doe"), closeSoftKeyboard());
 | 
			
		||||
        onView(withId(R.id.SignUp)).perform(click());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @After
 | 
			
		||||
    public void tearDown() throws Exception {
 | 
			
		||||
        mActivity=null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue