From 381732c582546368084eb22aeac9c85cdf0d7b3a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 20 Oct 2019 21:58:11 +0200 Subject: Fixed queue test --- .../java/de/test/antennapod/ui/QueueFragmentTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/src/androidTest/java/de/test/antennapod') diff --git a/app/src/androidTest/java/de/test/antennapod/ui/QueueFragmentTest.java b/app/src/androidTest/java/de/test/antennapod/ui/QueueFragmentTest.java index 7f0bf8fa2..37d76bb6d 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/QueueFragmentTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/QueueFragmentTest.java @@ -15,17 +15,20 @@ import org.junit.runner.RunWith; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.matcher.ViewMatchers.withClassName; import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription; import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.endsWith; /** - * User interface tests for queue fragment + * User interface tests for queue fragment. */ @RunWith(AndroidJUnit4.class) public class QueueFragmentTest { @Rule - public IntentsTestRule mActivityRule = new IntentsTestRule<>(MainActivity.class, false, false); + public IntentsTestRule activityRule = new IntentsTestRule<>(MainActivity.class, false, false); @Before public void setUp() { @@ -33,12 +36,13 @@ public class QueueFragmentTest { EspressoTestUtils.makeNotFirstRun(); EspressoTestUtils.clearDatabase(); EspressoTestUtils.setLastNavFragment(QueueFragment.TAG); - mActivityRule.launchActivity(new Intent()); + activityRule.launchActivity(new Intent()); } @Test public void testLockEmptyQueue() { onView(withContentDescription(R.string.lock_queue)).perform(click()); + onView(allOf(withClassName(endsWith("Button")), withText(R.string.lock_queue))).perform(click()); onView(withContentDescription(R.string.unlock_queue)).perform(click()); } -- cgit v1.2.3