diff options
Diffstat (limited to 'src/instrumentationTest/de/test/antennapod')
3 files changed, 9 insertions, 2 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java b/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java index 85994b152..23fc224c8 100644 --- a/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java +++ b/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java @@ -66,7 +66,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv public void testClickNavDrawer() throws Exception { uiTestUtils.addLocalFeedData(false); - final View home = solo.getView(R.id.home); + final View home = solo.getView(UITestUtils.HOME_VIEW); // all episodes solo.waitForView(android.R.id.list); diff --git a/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java b/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java index 719d43a73..98d93a35d 100644 --- a/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java +++ b/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java @@ -78,7 +78,7 @@ public class PlaybackTest extends ActivityInstrumentationTestCase2<MainActivity> private void startLocalPlaybackFromQueue() { assertTrue(solo.waitForActivity(MainActivity.class)); - solo.clickOnView(solo.getView(R.id.home)); + solo.clickOnView(solo.getView(UITestUtils.HOME_VIEW)); solo.clickOnText(solo.getString(R.string.queue_label)); assertTrue(solo.waitForView(solo.getView(R.id.butSecondaryAction))); solo.clickOnImageButton(0); diff --git a/src/instrumentationTest/de/test/antennapod/ui/UITestUtils.java b/src/instrumentationTest/de/test/antennapod/ui/UITestUtils.java index a02d4e55c..8877d46d6 100644 --- a/src/instrumentationTest/de/test/antennapod/ui/UITestUtils.java +++ b/src/instrumentationTest/de/test/antennapod/ui/UITestUtils.java @@ -1,7 +1,11 @@ package instrumentationTest.de.test.antennapod.ui; +import android.annotation.TargetApi; import android.content.Context; import android.graphics.Bitmap; +import android.os.Build; + +import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.*; import de.danoeh.antennapod.storage.DBWriter; import de.danoeh.antennapod.storage.PodDBAdapter; @@ -24,6 +28,7 @@ import java.util.List; * Utility methods for UI tests. * Starts a web server that hosts feeds, episodes and images. */ +@TargetApi(Build.VERSION_CODES.HONEYCOMB) public class UITestUtils { private static final String DATA_FOLDER = "test/UITestUtils"; @@ -31,6 +36,8 @@ public class UITestUtils { public static final int NUM_FEEDS = 5; public static final int NUM_ITEMS_PER_FEED = 10; + public static final int HOME_VIEW = (Build.VERSION.SDK_INT >= 11) ? android.R.id.home : R.id.home; + private Context context; private HTTPBin server = new HTTPBin(); |