Skip to content

Commit

Permalink
Tests on the Current Pregnancy
Browse files Browse the repository at this point in the history
  • Loading branch information
Naima-Bashir committed Aug 2, 2024
1 parent e3c5a7d commit 68a8fcc
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.vijay.jsonwizard.activities.JsonFormActivity;

import org.junit.AfterClass;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -64,7 +65,32 @@ public void B_StartContactVisitAndNavigateToProfile() throws Throwable {
onView(withText("Primary")).perform(click());
onView(withText("Married or living together")).perform(scrollTo(), click());
onView(withText("Formal employment")).perform(scrollTo(), click());
onView(withText("NEXT")).perform(scrollTo(), click());

onView(withText("Current Pregnancy")).check(matches(isDisplayed()));
onView(withId(Utils.getViewId((JsonFormActivity) activity, "step1:lmp_known")));
onView(withSubstring("Yes")).perform(click());
onView(withText("08-03-2024")).perform(click());

onView(withId(Utils.getViewId((JsonFormActivity) activity, "step2:ultrasound_done")));
onView(withSubstring("Yes")).perform(scrollTo(), click());
onView(withText("22-04-2024")).perform(click());

onView(withSubstring("GA from ultrasound-weeks")).perform(scrollTo(), typeText("6"), ViewActions.closeSoftKeyboard());
onView(withSubstring("GA from ultrasound-days")).perform(scrollTo(), typeText("3"), ViewActions.closeSoftKeyboard());

onView(withText("Select preferred gestational age")).check(matches(isDisplayed()));
onView(withSubstring("Using LMP")).perform(scrollTo(), click());

onView(withText("NEXT")).perform(scrollTo(), click());
Thread.sleep(2000);
}
@AfterClass
public static void tearDown() throws InterruptedException {
// Perform logout
onView(withContentDescription("Me")).perform(click());
onView(withId(R.id.logout_text)).perform(click());
Thread.sleep(1500);
onView(withId(R.id.login_login_btn)).check(matches(isDisplayed()));
}
}

0 comments on commit 68a8fcc

Please sign in to comment.