diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.kt index ea31bc3cf..ac36359c3 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.kt @@ -27,33 +27,15 @@ class KiwixSettingsActivityTest : BaseActivityTest() { override var activityRule = activityTestRule() @Test - fun testToggling() { + fun executeSettingsActivity() { settingsRobo { toggleButtons() - } - } - - @Test - fun testLanguageDialog() { - settingsRobo { - invokeLanguageDialog() - assertDisplayed(R.string.pref_language_title) - } - } - - @Test - fun testStorageDialog() { - settingsRobo { - invokeStorageDialog() - assertDisplayed(R.string.pref_storage) - } - } - - @Test - fun testHistoryDialog() { - settingsRobo { + invokeContributorsDialog() invokeHistoryDeletionDialog() - assertDisplayed(R.string.clear_all_history_dialog_title) + invokeLanguageDialog() + // invokeNightModeDialog() + invokeStorageDialog() + checkRemainingTextViews() } } @@ -67,20 +49,6 @@ class KiwixSettingsActivityTest : BaseActivityTest() { } } - @Test - fun testCreditsDialog() { - settingsRobo { - invokeContributorsDialog() - } - } - - @Test - fun testVersionTextView() { - settingsRobo { - checkRemainingTextViews() - } - } - private fun nightModeStrings(): Array = activityRule.activity.resources.getStringArray(R.array.pref_night_modes_entries) } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/SettingsRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/SettingsRobot.kt index 5805c6d66..df35414b8 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/SettingsRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/SettingsRobot.kt @@ -27,6 +27,7 @@ import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem import androidx.test.espresso.matcher.ViewMatchers.hasDescendant import androidx.test.espresso.matcher.ViewMatchers.withClassName import androidx.test.espresso.matcher.ViewMatchers.withText +import com.schibsted.spain.barista.assertion.BaristaVisibilityAssertions.assertDisplayed import org.hamcrest.Matcher import org.hamcrest.Matchers import org.kiwix.kiwixmobile.BaseRobot @@ -65,14 +66,17 @@ class SettingsRobot : BaseRobot() { fun invokeLanguageDialog() { clickRecyclerViewItems(R.string.device_default) + assertDisplayed(R.string.pref_language_title) } fun invokeStorageDialog() { clickRecyclerViewItems(R.string.internal_storage, R.string.external_storage) + assertDisplayed(R.string.pref_storage) } fun invokeHistoryDeletionDialog() { clickRecyclerViewItems(R.string.pref_clear_all_history_title) + assertDisplayed(R.string.clear_all_history_dialog_title) } fun invokeNightModeDialog() { @@ -85,6 +89,7 @@ class SettingsRobot : BaseRobot() { } fun checkRemainingTextViews() { - clickRecyclerViewItems(R.string.pref_info_version, R.string.pref_text_zoom_title) + clickRecyclerViewItems(R.string.pref_info_version) + clickRecyclerViewItems(R.string.pref_text_zoom_title) } }