mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 03:45:33 -04:00
Separated some functions to Robot
This commit is contained in:
parent
51a6595730
commit
13ed5ca34a
@ -27,19 +27,16 @@ class KiwixSettingsActivityTest : BaseActivityTest<KiwixSettingsActivity>() {
|
|||||||
override var activityRule = activityTestRule<KiwixSettingsActivity>()
|
override var activityRule = activityTestRule<KiwixSettingsActivity>()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testToggle() {
|
fun testToggling() {
|
||||||
settingsRobo {
|
settingsRobo {
|
||||||
clickOn(R.string.pref_back_to_top)
|
toggleButtons()
|
||||||
clickOn(R.string.pref_newtab_background_title)
|
|
||||||
clickOn(R.string.pref_external_link_popup_title)
|
|
||||||
clickOn(R.string.pref_wifi_only)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testLanguageDialog() {
|
fun testLanguageDialog() {
|
||||||
settingsRobo {
|
settingsRobo {
|
||||||
clickOn(R.string.device_default)
|
invokeLanguageDialog()
|
||||||
assertDisplayed(R.string.pref_language_title)
|
assertDisplayed(R.string.pref_language_title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,7 +44,7 @@ class KiwixSettingsActivityTest : BaseActivityTest<KiwixSettingsActivity>() {
|
|||||||
@Test
|
@Test
|
||||||
fun testStorageDialog() {
|
fun testStorageDialog() {
|
||||||
settingsRobo {
|
settingsRobo {
|
||||||
clickOn(R.string.internal_storage, R.string.external_storage)
|
invokeStorageDialog()
|
||||||
assertDisplayed(R.string.pref_storage)
|
assertDisplayed(R.string.pref_storage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,7 +52,7 @@ class KiwixSettingsActivityTest : BaseActivityTest<KiwixSettingsActivity>() {
|
|||||||
@Test
|
@Test
|
||||||
fun testHistoryDialog() {
|
fun testHistoryDialog() {
|
||||||
settingsRobo {
|
settingsRobo {
|
||||||
clickOn(R.string.pref_clear_all_history_title)
|
invokeHistoryDeletionDialog()
|
||||||
assertDisplayed(R.string.clear_all_history_dialog_title)
|
assertDisplayed(R.string.clear_all_history_dialog_title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +60,7 @@ class KiwixSettingsActivityTest : BaseActivityTest<KiwixSettingsActivity>() {
|
|||||||
@Test
|
@Test
|
||||||
fun testNightModeDialog() {
|
fun testNightModeDialog() {
|
||||||
settingsRobo {
|
settingsRobo {
|
||||||
clickOn(R.string.pref_night_mode)
|
invokeNightModeDialog()
|
||||||
for (nightModeString in nightModeStrings()) {
|
for (nightModeString in nightModeStrings()) {
|
||||||
assertDisplayed(nightModeString)
|
assertDisplayed(nightModeString)
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
|
|||||||
import org.hamcrest.Matcher
|
import org.hamcrest.Matcher
|
||||||
import org.hamcrest.Matchers
|
import org.hamcrest.Matchers
|
||||||
import org.kiwix.kiwixmobile.BaseRobot
|
import org.kiwix.kiwixmobile.BaseRobot
|
||||||
|
import org.kiwix.kiwixmobile.core.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authored by Ayush Shrivastava on 25/8/20
|
* Authored by Ayush Shrivastava on 25/8/20
|
||||||
@ -53,4 +54,27 @@ class SettingsRobot : BaseRobot() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun toggleButtons() {
|
||||||
|
clickOn(R.string.pref_back_to_top)
|
||||||
|
clickOn(R.string.pref_newtab_background_title)
|
||||||
|
clickOn(R.string.pref_external_link_popup_title)
|
||||||
|
clickOn(R.string.pref_wifi_only)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun invokeLanguageDialog() {
|
||||||
|
clickOn(R.string.device_default)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun invokeStorageDialog() {
|
||||||
|
clickOn(R.string.internal_storage, R.string.external_storage)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun invokeHistoryDeletionDialog() {
|
||||||
|
clickOn(R.string.pref_clear_all_history_title)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun invokeNightModeDialog() {
|
||||||
|
clickOn(R.string.pref_night_mode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user