diff options
author | saqura <saqura@saqura.xyz> | 2016-04-03 20:22:03 +0200 |
---|---|---|
committer | saqura <saqura@saqura.xyz> | 2016-04-03 20:22:03 +0200 |
commit | e3408565dcc15cd97548b664773bc684dca4edeb (patch) | |
tree | d93433fa30434843a78fa41e30506772bbeb5b78 /app/src/androidTest | |
parent | e215e162ad6c833ad3d3c5953e35e294eea8f25d (diff) | |
download | AntennaPod-e3408565dcc15cd97548b664773bc684dca4edeb.zip |
Update compact notification buttons dialog
The preference dialog to select which buttons are shown in compact
notifications now provides feedback via a snackbar. The internal
preference storage handling has been cleaned up. A testcase for
the dialog has been added.
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java | 24 |
1 files changed, 24 insertions, 0 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 54741502c..040f4150b 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -90,6 +90,30 @@ public class PreferencesTest extends ActivityInstrumentationTestCase2<Preference assertTrue(solo.waitForCondition(() -> persistNotify == UserPreferences.isPersistNotify(), Timeout.getLargeTimeout())); } + public void testSetLockscreenButtons() { + String[] buttons = res.getStringArray(R.array.compact_notification_buttons_options); + solo.clickOnText(solo.getString(R.string.pref_compact_notification_buttons_title)); + solo.waitForDialogToOpen(1000); + // First uncheck every checkbox + for (int i=0; i<buttons.length; i++) { + assertTrue(solo.searchText(buttons[i])); + if (solo.isTextChecked(buttons[i])) { + solo.clickOnText(buttons[i]); + } + } + // Now try to check all checkboxes + solo.clickOnText(buttons[0]); + solo.clickOnText(buttons[1]); + solo.clickOnText(buttons[2]); + // Make sure that the third checkbox is unchecked + assertTrue(!solo.isTextChecked(buttons[2])); + solo.clickOnText(solo.getString(R.string.confirm_label)); + solo.waitForDialogToClose(1000); + assertTrue(solo.waitForCondition(() -> UserPreferences.showRewindOnCompactNotification(), Timeout.getLargeTimeout())); + assertTrue(solo.waitForCondition(() -> UserPreferences.showFastForwardOnCompactNotification(), Timeout.getLargeTimeout())); + assertTrue(solo.waitForCondition(() -> !UserPreferences.showSkipOnCompactNotification(), Timeout.getLargeTimeout())); + } + public void testEnqueueAtFront() { final boolean enqueueAtFront = UserPreferences.enqueueAtFront(); solo.clickOnText(solo.getString(R.string.pref_queueAddToFront_title)); |