summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorH. Lehmann <ByteHamster@users.noreply.github.com>2020-05-30 14:58:03 +0200
committerGitHub <noreply@github.com>2020-05-30 14:58:03 +0200
commit175abdc63a3e868d7e0e6872c959599b3bf7e755 (patch)
treee825320b67a5a89b0516a702d0c9fc4bfe34fcbf /app
parenta7b38bd152e6891d5ed7effb0302a9666cb52e0c (diff)
parentecf53e31a5abf499c24bbbbaf19f76625a0187ae (diff)
downloadAntennaPod-175abdc63a3e868d7e0e6872c959599b3bf7e755.zip
Merge pull request #4205 from ByteHamster/skip-icon
Feed settings skip icon
Diffstat (limited to 'app')
-rw-r--r--app/src/androidTest/java/de/test/antennapod/ui/FeedSettingsTest.java79
-rw-r--r--app/src/main/res/xml/feed_settings.xml1
2 files changed, 80 insertions, 0 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/FeedSettingsTest.java b/app/src/androidTest/java/de/test/antennapod/ui/FeedSettingsTest.java
new file mode 100644
index 000000000..b49be9a04
--- /dev/null
+++ b/app/src/androidTest/java/de/test/antennapod/ui/FeedSettingsTest.java
@@ -0,0 +1,79 @@
+package de.test.antennapod.ui;
+
+import android.content.Intent;
+import androidx.test.espresso.intent.rule.IntentsTestRule;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.activity.MainActivity;
+import de.danoeh.antennapod.core.feed.Feed;
+import de.test.antennapod.EspressoTestUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+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.isDescendantOfA;
+import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
+import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
+import static androidx.test.espresso.matcher.ViewMatchers.withId;
+import static androidx.test.espresso.matcher.ViewMatchers.withText;
+import static de.test.antennapod.EspressoTestUtils.clickPreference;
+import static de.test.antennapod.EspressoTestUtils.waitForView;
+import static org.hamcrest.Matchers.allOf;
+
+@RunWith(AndroidJUnit4.class)
+public class FeedSettingsTest {
+ private UITestUtils uiTestUtils;
+ private Feed feed;
+
+ @Rule
+ public IntentsTestRule<MainActivity> activityRule = new IntentsTestRule<>(MainActivity.class, false, false);
+
+ @Before
+ public void setUp() throws Exception {
+ uiTestUtils = new UITestUtils(InstrumentationRegistry.getInstrumentation().getTargetContext());
+ uiTestUtils.setup();
+
+ EspressoTestUtils.clearPreferences();
+ EspressoTestUtils.clearDatabase();
+
+ uiTestUtils.addLocalFeedData(false);
+ feed = uiTestUtils.hostedFeeds.get(0);
+ Intent intent = new Intent(InstrumentationRegistry.getInstrumentation().getTargetContext(), MainActivity.class);
+ intent.putExtra(MainActivity.EXTRA_FEED_ID, feed.getId());
+ activityRule.launchActivity(intent);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ uiTestUtils.tearDown();
+ }
+
+ @Test
+ public void testClickFeedSettings() {
+ onView(isRoot()).perform(waitForView(allOf(isDescendantOfA(withId(R.id.appBar)),
+ withText(feed.getTitle()), isDisplayed()), 1000));
+ onView(withId(R.id.butShowSettings)).perform(click());
+
+ clickPreference(R.string.keep_updated);
+
+ clickPreference(R.string.authentication_label);
+ onView(withText(R.string.cancel_label)).perform(click());
+
+ clickPreference(R.string.playback_speed);
+ onView(withText(R.string.cancel_label)).perform(click());
+
+ clickPreference(R.string.pref_feed_skip);
+ onView(withText(R.string.cancel_label)).perform(click());
+
+ clickPreference(R.string.auto_delete_label);
+ onView(withText(R.string.cancel_label)).perform(click());
+
+ clickPreference(R.string.feed_volume_reduction);
+ onView(withText(R.string.cancel_label)).perform(click());
+ }
+}
diff --git a/app/src/main/res/xml/feed_settings.xml b/app/src/main/res/xml/feed_settings.xml
index f85c9ef3c..9f8392f44 100644
--- a/app/src/main/res/xml/feed_settings.xml
+++ b/app/src/main/res/xml/feed_settings.xml
@@ -23,6 +23,7 @@
<Preference
android:key="feedAutoSkip"
+ android:icon="?attr/ic_settings_skip"
android:summary="@string/pref_feed_skip_sum"
android:title="@string/pref_feed_skip" />