Skip to content

Commit a6907c5

Browse files
committedMay 18, 2020
Fix test for dev11 API changes.
1 parent 8126d42 commit a6907c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎JetNews/app/src/androidTest/java/com/example/jetnews/JetnewsUiTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class JetnewsUiTest {
5050
@Ignore("Ignoring because of https://issuetracker.google.com/154617105")
5151
@Test
5252
fun app_opensArticle() {
53-
findAllBySubstring("Manuel Vivo").first().doClick()
54-
findAllBySubstring("July 30 • 3 min read").first().assertIsDisplayed()
53+
findAllBySubstring("Manuel Vivo")[0].doClick()
54+
findAllBySubstring("July 30 • 3 min read")[0].assertIsDisplayed()
5555
}
5656
}

‎JetNews/app/src/androidTest/java/com/example/jetnews/TestHelper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import androidx.compose.Composable
2121
import androidx.ui.material.MaterialTheme
2222
import androidx.ui.material.Surface
2323
import androidx.ui.test.ComposeTestRule
24-
import androidx.ui.test.SemanticsNodeInteraction
24+
import androidx.ui.test.SemanticsNodeInteractionCollection
2525
import androidx.ui.test.findAll
2626
import androidx.ui.test.hasSubstring
2727
import com.example.jetnews.ui.JetnewsApp
@@ -60,7 +60,7 @@ fun ComposeTestRule.setMaterialContent(children: @Composable() () -> Unit) {
6060
}
6161
}
6262

63-
fun findAllBySubstring(text: String, ignoreCase: Boolean = false): List<SemanticsNodeInteraction> {
63+
fun findAllBySubstring(text: String, ignoreCase: Boolean = false): SemanticsNodeInteractionCollection {
6464
return findAll(
6565
hasSubstring(text, ignoreCase)
6666
)

0 commit comments

Comments
 (0)