diff --git a/app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.java b/app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.java index a791f835f..2619bf085 100644 --- a/app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.java +++ b/app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.java @@ -39,6 +39,7 @@ import static org.kiwix.kiwixmobile.utils.StandardActions.enterSettings; @LargeTest @RunWith(AndroidJUnit4.class) public class IntroActivityTest { + @Rule public BaristaRule activityTestRule = BaristaRule.create(IntroActivity.class); @Rule @@ -47,12 +48,28 @@ public class IntroActivityTest { public GrantPermissionRule writePermissionRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE); @Test - public void FinalSimple() { + public void testUIHierarchy(){ + activityTestRule.launchActivity(); + BaristaSleepInteractions.sleep(TEST_PAUSE_MS); + ViewInteraction customViewPager = onView(withId(R.id.view_pager)); + // Verify that the sliding view is working properly + customViewPager.perform(swipeLeft()); + onView(allOf(withId(R.id.heading), withText(R.string.save_books_offline), isDisplayed())) + .check(matches(notNullValue())); + onView(allOf(withId(R.id.subheading), withText(R.string.download_books_message), isDisplayed())) + .check(matches(notNullValue())); + + BaristaSleepInteractions.sleep(TEST_PAUSE_MS); + customViewPager.perform(swipeRight()); + onView(allOf(withId(R.id.heading), withText(R.string.welcome_to_the_family), isDisplayed())) + .check(matches(notNullValue())); + onView(allOf(withId(R.id.subheading), withText(R.string.human_kind_knowledge), isDisplayed())) + .check(matches(notNullValue())); } @Test - public void navigateHelp() { + public void testIntentCreated() { activityTestRule.launchActivity(); BaristaSleepInteractions.sleep(TEST_PAUSE_MS); Intents.init(); @@ -65,25 +82,4 @@ public class IntroActivityTest { // Test the intent generated for MainActivity intended(hasComponent(MainActivity.class.getName())); } - - @Test - public void test2(){ - activityTestRule.launchActivity(); - BaristaSleepInteractions.sleep(TEST_PAUSE_MS); - ViewInteraction customViewPager = onView(withId(R.id.view_pager)); - - // Verify that the sliding view is working properly - customViewPager.perform(swipeLeft()); - onView(allOf(withId(R.id.heading), withText("Save books offline"), isDisplayed())) - .check(matches(notNullValue())); - onView(allOf(withId(R.id.subheading), withText("Download books and read wherever you are."), isDisplayed())) - .check(matches(notNullValue())); - - BaristaSleepInteractions.sleep(TEST_PAUSE_MS); - customViewPager.perform(swipeRight()); - onView(allOf(withId(R.id.heading), withText("Welcome to the family"), isDisplayed())) - .check(matches(notNullValue())); - onView(allOf(withId(R.id.subheading), withText("Human kind's knowledge, on your phone."), isDisplayed())) - .check(matches(notNullValue())); - } }