mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
#1593 Move CI from Travis to GitHub Action - update night mode automated test
This commit is contained in:
parent
d5995424d1
commit
fd6ae39763
@ -20,6 +20,7 @@ package org.kiwix.kiwixmobile.settings;
|
|||||||
|
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import androidx.test.rule.ActivityTestRule;
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.kiwix.kiwixmobile.core.R;
|
import org.kiwix.kiwixmobile.core.R;
|
||||||
@ -42,15 +43,6 @@ public class KiwixSettingsActivityTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testToggle() {
|
public void testToggle() {
|
||||||
enterSettings();
|
enterSettings();
|
||||||
//onData(allOf(
|
|
||||||
// is(instanceOf(Preference.class)),
|
|
||||||
// withKey("pref_nightmode")))
|
|
||||||
// .perform(click());
|
|
||||||
|
|
||||||
//onData(allOf(
|
|
||||||
// is(instanceOf(Preference.class)),
|
|
||||||
// withKey("pref_auto_nightmode")))
|
|
||||||
// .perform(click());
|
|
||||||
|
|
||||||
onData(allOf(
|
onData(allOf(
|
||||||
is(instanceOf(Preference.class)),
|
is(instanceOf(Preference.class)),
|
||||||
@ -136,5 +128,24 @@ public class KiwixSettingsActivityTest {
|
|||||||
|
|
||||||
assertDisplayed(R.string.clear_all_history_dialog_title);
|
assertDisplayed(R.string.clear_all_history_dialog_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNightModeDialog() {
|
||||||
|
enterSettings();
|
||||||
|
onData(allOf(
|
||||||
|
is(instanceOf(Preference.class)),
|
||||||
|
withKey("pref_night_mode")))
|
||||||
|
.perform(click());
|
||||||
|
|
||||||
|
for (String nightModeString : nightModeStrings()) {
|
||||||
|
assertDisplayed(nightModeString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull private String[] nightModeStrings() {
|
||||||
|
return activityTestRule.getActivity()
|
||||||
|
.getResources()
|
||||||
|
.getStringArray(R.array.pref_night_modes_entries);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user