diff options
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java index 4dae53a15..e456f3891 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java @@ -51,6 +51,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv adapter.close(); // override first launch preference + // do this BEFORE calling getActivity()! prefs = getInstrumentation().getTargetContext().getSharedPreferences(MainActivity.PREF_NAME, Context.MODE_PRIVATE); prefs.edit().putBoolean(MainActivity.PREF_IS_FIRST_LAUNCH, false).commit(); @@ -71,7 +72,8 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } private void openNavDrawer() { - solo.clickOnScreen(50, 50); + solo.clickOnImageButton(0); + getInstrumentation().waitForIdleSync(); } public void testAddFeed() throws Exception { @@ -125,7 +127,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertEquals(solo.getString(R.string.add_feed_label), getActionbarTitle()); // podcasts - ListView list = (ListView)solo.getView(R.id.nav_list); + ListView list = (ListView) solo.getView(R.id.nav_list); for (int i = 0; i < uiTestUtils.hostedFeeds.size(); i++) { Feed f = uiTestUtils.hostedFeeds.get(i); solo.clickOnScreen(50, 50); // open nav drawer @@ -137,7 +139,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } private String getActionbarTitle() { - return ((MainActivity)solo.getCurrentActivity()).getMainActivtyActionBar().getTitle().toString(); + return ((MainActivity) solo.getCurrentActivity()).getSupportActionBar().getTitle().toString(); } @FlakyTest(tolerance = 3) @@ -185,14 +187,14 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv openNavDrawer(); solo.clickLongOnText(solo.getString(R.string.queue_label)); solo.waitForDialogToOpen(); - for(String title : titles) { + for (String title : titles) { solo.clickOnText(title); } solo.clickOnText(solo.getString(R.string.confirm_label)); solo.waitForDialogToClose(); List<String> hidden = UserPreferences.getHiddenDrawerItems(); assertEquals(titles.length, hidden.size()); - for(String tag : MainActivity.NAV_DRAWER_TAGS) { + for (String tag : MainActivity.NAV_DRAWER_TAGS) { assertTrue(hidden.contains(tag)); } } |