diff options
author | Matej Drobnič <matej@matejdro.com> | 2024-02-04 19:54:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-04 19:54:46 +0100 |
commit | 0f5600932d5894d5653993d48d925df437fe6d00 (patch) | |
tree | ee34151ac28bbe55dcec9c45de1cb5dbe92ad299 /app/src/androidTest | |
parent | f0e96a269233e85a452eabcbfe09899157024ab3 (diff) | |
download | AntennaPod-0f5600932d5894d5653993d48d925df437fe6d00.zip |
Add next chapter button to notification (#6276)
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java index 24c20242a..9ba4276be 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -3,6 +3,7 @@ package de.test.antennapod.ui; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources; + import androidx.annotation.StringRes; import androidx.preference.PreferenceManager; import androidx.test.filters.LargeTest; @@ -30,9 +31,7 @@ import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.scrollTo; import static androidx.test.espresso.action.ViewActions.swipeDown; import static androidx.test.espresso.action.ViewActions.swipeUp; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.isChecked; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static androidx.test.espresso.matcher.ViewMatchers.withId; @@ -40,7 +39,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText; import static de.test.antennapod.EspressoTestUtils.clickPreference; import static de.test.antennapod.EspressoTestUtils.waitForView; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -80,38 +78,22 @@ public class PreferencesTest { } @Test - public void testSetLockscreenButtons() { + public void testSetNotificationButtons() { clickPreference(R.string.user_interface_label); - String[] buttons = res.getStringArray(R.array.compact_notification_buttons_options); - clickPreference(R.string.pref_compact_notification_buttons_title); + String[] buttons = res.getStringArray(R.array.full_notification_buttons_options); + clickPreference(R.string.pref_full_notification_buttons_title); // First uncheck checkboxes - onView(withText(buttons[0])).perform(click()); - onView(withText(buttons[1])).perform(click()); - - // Now try to check all checkboxes - onView(withText(buttons[0])).perform(click()); onView(withText(buttons[1])).perform(click()); onView(withText(buttons[2])).perform(click()); - // Make sure that the third checkbox is unchecked - onView(withText(buttons[2])).check(matches(not(isChecked()))); - - String snackBarText = String.format(res.getString( - R.string.pref_compact_notification_buttons_dialog_error), 2); - Awaitility.await().ignoreExceptions().atMost(4000, MILLISECONDS) - .until(() -> { - onView(withText(snackBarText)).check(doesNotExist()); - return true; - }); - onView(withText(R.string.confirm_label)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) - .until(UserPreferences::showRewindOnCompactNotification); + .until(() -> UserPreferences.showSkipOnFullNotification()); Awaitility.await().atMost(1000, MILLISECONDS) - .until(UserPreferences::showFastForwardOnCompactNotification); + .until(() -> UserPreferences.showNextChapterOnFullNotification()); Awaitility.await().atMost(1000, MILLISECONDS) - .until(() -> !UserPreferences.showSkipOnCompactNotification()); + .until(() -> !UserPreferences.showPlaybackSpeedOnFullNotification()); } @Test |