diff options
author | Gerardo Vázquez <gerardolgvr0310@gmail.com> | 2020-06-26 18:52:48 -0500 |
---|---|---|
committer | Gerardo Vázquez <gerardolgvr0310@gmail.com> | 2020-06-26 18:52:48 -0500 |
commit | 5363b09f0067a61db5451b4c794c9a3ab919ece6 (patch) | |
tree | 3d33cabf794c574d8c23cb813f0a06f311fd17ff /app/src/androidTest/java | |
parent | b36078b8f198d166c31863558198510cf574e656 (diff) | |
download | AntennaPod-5363b09f0067a61db5451b4c794c9a3ab919ece6.zip |
fixing test and ShareEpisodeDialog
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java b/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java index c6133c59c..8b17b362e 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java @@ -23,6 +23,8 @@ import org.junit.runner.RunWith; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.clearText; import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.scrollTo; import static androidx.test.espresso.action.ViewActions.typeText; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.RootMatchers.isDialog; @@ -56,10 +58,12 @@ public class DialogsTest { String url = "https://omny.fm/shows/silence-is-not-an-option/why-not-being-racist-is-not-enough"; - onView(withId(R.id.btn_add_via_url)).perform(click()); + onView(withId(R.id.btn_add_via_url)).perform(scrollTo()).perform(click()); onView(withId(R.id.text)).perform(clearText(), typeText(url)); onView(withText(R.string.confirm_label)).inRoot(isDialog()) .check(matches(isDisplayed())) + .perform(closeSoftKeyboard()) + .perform(scrollTo()) .perform(click()); Thread.sleep(5000); onView(withId(R.id.butSubscribe)).perform(click()); @@ -72,21 +76,22 @@ public class DialogsTest { @Test public void testShareDialogDisplayed() { - onView(withText(R.string.share_label)).perform(click()); - onView(withText(R.string.share_episode_label)).check(matches(isDisplayed())); + onView(withText(R.string.share_label)).perform(scrollTo()).perform(click()); + onView(allOf(isDisplayed(), withText(R.string.share_episode_label))); } @Test public void testShareDialogShareButton() throws InterruptedException { - onView(withText(R.string.share_label)).perform(click()); - onView(withText(R.string.share_label)).check(matches(isDisplayed())); - onView(withText(R.string.share_label)).perform(click()); - Thread.sleep(3000); + onView(withText(R.string.share_label)).perform(scrollTo()).perform(click()); + onView(allOf(isDisplayed(), withText(R.string.share_label))); + Thread.sleep(1000); + onView(withText(R.string.share_episode_positive_label_button)).perform(scrollTo()).perform(click()); + Thread.sleep(2000); } @Test public void testShareDialogCancelButton() { - onView(withText(R.string.share_label)).perform(click()); + onView(withText(R.string.share_label)).perform(scrollTo()).perform(click()); onView(withText(R.string.cancel_label)).check(matches(isDisplayed())); } |