summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/de/test/antennapod/service
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2019-11-28 23:34:26 +0100
committerByteHamster <info@bytehamster.com>2019-12-12 09:47:15 +0100
commite51a107083101b64614b30324ae6cc2226a3f835 (patch)
tree0be0b9134f48e3bd3689f8881b81b0b55a6b47fe /app/src/androidTest/java/de/test/antennapod/service
parentf7ae08325b35498beb56d71d64aef316ac1ec818 (diff)
downloadAntennaPod-e51a107083101b64614b30324ae6cc2226a3f835.zip
Fixed tests on small screens
In general, made some tests more stable
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/service')
-rw-r--r--app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java b/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java
index d0e14d70a..6b020efcb 100644
--- a/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java
+++ b/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java
@@ -5,6 +5,7 @@ import androidx.annotation.Nullable;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
+import de.test.antennapod.EspressoTestUtils;
import org.awaitility.Awaitility;
import org.awaitility.core.ConditionTimeoutException;
import org.junit.After;
@@ -53,6 +54,8 @@ public class DownloadServiceTest {
@Before
public void setUp() throws Exception {
+ EspressoTestUtils.clearDatabase();
+ EspressoTestUtils.clearPreferences();
origFactory = DownloadService.getDownloaderFactory();
testFeed = setUpTestFeeds();
testMedia11 = testFeed.getItemAtIndex(0).getMedia();
@@ -171,7 +174,7 @@ public class DownloadServiceTest {
final int totalNumEventsExpected = itemAlreadyInQueue ? 1 : 3;
Awaitility.await("item dequeue event + download termination event")
.atMost(1000, TimeUnit.MILLISECONDS)
- .until(() ->feedItemEventListener.getEvents().size() >= totalNumEventsExpected);
+ .until(() -> feedItemEventListener.getEvents().size() >= totalNumEventsExpected);
assertFalse("The download should have been canceled",
DBReader.getFeedMedia(testMedia11.getId()).isDownloaded());
if (itemAlreadyInQueue) {