Skip to content

Commit

Permalink
added tests to access anc registration form and user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
murayakarina committed Jun 26, 2024
1 parent b78809c commit fd62e1e
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isClickable;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withSubstring;

Expand Down Expand Up @@ -46,22 +47,24 @@ public void B_SearchBarPresent() {
onView(withId(R.id.search_bar_layout)).check(matches(isDisplayed()));

}

@Test
public void C_SearchPatientByName() throws InterruptedException {

onView(withId(R.id.edt_search)).perform(typeText(Configs.TestDataConfigs.clientName), ViewActions.closeSoftKeyboard());
onView(withId(R.id.patient_name)).check(matches(isDisplayed()));
Thread.sleep(1000);
onView(withId(R.id.btn_search_cancel)).perform(click());
}
@Test
}

@Test
public void C_SearchPatientByID() throws InterruptedException {

onView(withId(R.id.edt_search)).perform(typeText(Configs.TestDataConfigs.clientID), ViewActions.closeSoftKeyboard());
onView(withId(R.id.patient_name)).check(matches(isDisplayed()));
Thread.sleep(1000);
onView(withId(R.id.btn_search_cancel)).perform(click());
}
}

@Test
public void D_AdvancedSearch() throws InterruptedException {
Expand All @@ -78,12 +81,25 @@ public void D_AdvancedSearch() throws InterruptedException {
public void E_OpenLibrary() throws InterruptedException {
onView(withId(R.id.action_library)).perform(click());
Thread.sleep(2000);
// onView(withId(R.id.library_item_layout)).atPosition(1).perform(click());
// onView(withId(R.id.library_item_layout)).atPosition(1).perform(click());
Thread.sleep(2000);
onView(withId(R.id.library_toolbar_title)).check(matches(isDisplayed()));
onView(withId(R.id.action_clients)).perform(click());


}
@Test
public void userCanAccessANCRegistrationForm() throws InterruptedException {
onView(withContentDescription("Register")).perform(click());
Thread.sleep(1500);
onView(withId(R.id.scan_button)).check(matches(isDisplayed()));
}
@Test
public void userCanAccessProfile() throws InterruptedException {
onView(withContentDescription("Me")).perform(click());
Thread.sleep(1500);
onView(withId(R.id.locationImageView)).check(matches(isDisplayed()));
}
}


0 comments on commit fd62e1e

Please sign in to comment.