Skip to content

Commit

Permalink
Merge pull request #17 from faiyaz103/bishal
Browse files Browse the repository at this point in the history
UI Test: Signup Button UI Test Completed
  • Loading branch information
IronDigger098 authored May 27, 2024
2 parents da9d178 + 3744c8f commit b632f19
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
1 change: 1 addition & 0 deletions .idea/androidTestResultsUserPreferences.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions app/src/androidTest/java/com/example/notemania/signUpTestUI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.example.notemania;

import androidx.test.espresso.Espresso;
import androidx.test.espresso.action.ViewActions;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.rules.ActivityScenarioRule;

import org.junit.Rule;
import org.junit.Test;

public class signUpTestUI {

@Rule
public ActivityScenarioRule<signup> activityScenarioRule = new ActivityScenarioRule<>(signup.class);

@Test
public void testwithoutinput()
{
Espresso.onView(ViewMatchers.withId(R.id.signup)).perform(ViewActions.click());
Espresso.onView(ViewMatchers.withText("All fields are required"));
}
@Test
public void testwithoutemail()
{
Espresso.onView(ViewMatchers.withId(R.id.signupemail)).perform(ViewActions.typeText(""));
Espresso.onView(ViewMatchers.withText("All fields are required"));
}
@Test
public void testwithoutpass()
{
Espresso.onView(ViewMatchers.withId(R.id.signuppassword)).perform(ViewActions.typeText(""));
Espresso.onView(ViewMatchers.withText("All fields are required"));
}
@Test
public void testwithallinputs()
{
Espresso.onView(ViewMatchers.withId(R.id.signupemail)).perform(ViewActions.typeText("test@gmail.com"));
Espresso.onView(ViewMatchers.withId(R.id.signuppassword)).perform(ViewActions.typeText("test"));
Espresso.onView(ViewMatchers.withText("Registration Successful"));
}
}

0 comments on commit b632f19

Please sign in to comment.