appstore: scroll to the F-Droid card in SourcesPageTest
- Commit
a6ce18572d15c09277c0659a3afcf917491fa8a9- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-14 23:10 UTC (21 days ago)
- Parents
2c116ad
The sources page is a scrolling column; the F-Droid card is below the fold on the Robolectric display (further down when the ViewModel is showing a status line, e.g. after a sync on a host with network), so assertIsDisplayed failed even though the card renders. The play URL further down already only asserts existence for the same reason. Scroll the F-Droid node into view first, then keep the stronger displayed assertion. Verified: targeted :appstore:testDevUnitTest run (see final full-suite run).
Diff
appstore/src/test/java/com/vayunmathur/appstore/ui/SourcesPageTest.kt
diff --git a/appstore/src/test/java/com/vayunmathur/appstore/ui/SourcesPageTest.kt b/appstore/src/test/java/com/vayunmathur/appstore/ui/SourcesPageTest.ktindex 21a2a9e0b7..a25ec528f5 100644--- a/appstore/src/test/java/com/vayunmathur/appstore/ui/SourcesPageTest.kt+++ b/appstore/src/test/java/com/vayunmathur/appstore/ui/SourcesPageTest.kt@@ -5,6 +5,7 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick+import androidx.compose.ui.test.performScrollTo import androidx.room3.Room import androidx.sqlite.driver.bundled.BundledSQLiteDriver import androidx.test.core.app.ApplicationProvider@@ -50,7 +51,10 @@ class SourcesPageTest { rule.setContent { SourcesPage(viewModel = vm) } rule.onNodeWithText("Modern Apps", substring = true).assertIsDisplayed() rule.onNodeWithText("Automatically install updates", substring = true).assertIsDisplayed()- rule.onNodeWithText("F-Droid", substring = true).assertIsDisplayed()+ // The F-Droid card sits below the scroll fold on the Robolectric+ // display (further down when a status line is showing): scroll it+ // into view, then require it to actually be displayed.+ rule.onNodeWithText("F-Droid", substring = true).performScrollTo().assertIsDisplayed() rule.onNodeWithText("https://f-droid.org/repo", substring = true).assertExists() // Below the scroll fold on the Robolectric display; existence is what matters. rule.onNodeWithText("play.google.com", substring = true).assertExists()