mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Fixed: TopLevelDestinationTest
, and GetContentShortcutTest
test cases which was failing due to migration to jetpack.
This commit is contained in:
parent
4cdae0f601
commit
1debc8269c
@ -27,18 +27,22 @@ import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import org.kiwix.kiwixmobile.BaseRobot
|
||||
import org.kiwix.kiwixmobile.Findable.ViewId
|
||||
import org.kiwix.kiwixmobile.core.R.id
|
||||
import org.kiwix.kiwixmobile.core.R
|
||||
import org.kiwix.kiwixmobile.core.R.string
|
||||
import org.kiwix.kiwixmobile.core.help.HELP_SCREEN_ITEM_DESCRIPTION_TESTING_TAG
|
||||
import org.kiwix.kiwixmobile.core.help.HELP_SCREEN_ITEM_TITLE_TESTING_TAG
|
||||
import org.kiwix.kiwixmobile.core.ui.components.TOOLBAR_TITLE_TESTING_TAG
|
||||
import org.kiwix.kiwixmobile.testutils.TestUtils.testFlakyView
|
||||
|
||||
fun help(func: HelpRobot.() -> Unit) = HelpRobot().apply(func)
|
||||
|
||||
class HelpRobot : BaseRobot() {
|
||||
fun assertToolbarDisplayed() {
|
||||
isVisible(ViewId(id.toolbar))
|
||||
fun assertToolbarDisplayed(composeTestRule: ComposeContentTestRule) {
|
||||
composeTestRule.apply {
|
||||
waitForIdle()
|
||||
onNodeWithTag(TOOLBAR_TITLE_TESTING_TAG)
|
||||
.assertTextEquals(context.getString(R.string.menu_help))
|
||||
}
|
||||
}
|
||||
|
||||
fun clickOnWhatDoesKiwixDo(composeTestRule: ComposeContentTestRule) {
|
||||
|
@ -130,7 +130,7 @@ class TopLevelDestinationTest : BaseActivityTest() {
|
||||
}
|
||||
clickHostBooksOnSideNav(ZimHostRobot::assertMenuWifiHotspotDiplayed)
|
||||
clickSettingsOnSideNav(SettingsRobot::assertMenuSettingsDisplayed)
|
||||
clickHelpOnSideNav(HelpRobot::assertToolbarDisplayed)
|
||||
clickHelpOnSideNav { HelpRobot().assertToolbarDisplayed(composeTestRule) }
|
||||
clickSupportKiwixOnSideNav()
|
||||
pressBack()
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ class GetContentShortcutTest {
|
||||
}
|
||||
clickHostBooksOnSideNav(ZimHostRobot::assertMenuWifiHotspotDiplayed)
|
||||
clickSettingsOnSideNav(SettingsRobot::assertMenuSettingsDisplayed)
|
||||
clickHelpOnSideNav(HelpRobot::assertToolbarDisplayed)
|
||||
clickHelpOnSideNav { HelpRobot().assertToolbarDisplayed(composeTestRule) }
|
||||
clickSupportKiwixOnSideNav()
|
||||
pressBack()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user