Skip to content

Commit

Permalink
[JetNews] Fix the broken test case
Browse files Browse the repository at this point in the history
  • Loading branch information
rayworks committed Sep 14, 2023
1 parent 7b75a50 commit 79d2277
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.example.jetnews

import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithText
Expand Down Expand Up @@ -50,11 +51,11 @@ class JetnewsTests {
fun app_opensArticle() {

println(composeTestRule.onRoot().printToString())
composeTestRule.onNodeWithText(text = "Manuel Vivo", substring = true).performClick()
composeTestRule.onAllNodes(hasText("Manuel Vivo"))[0].performClick()

println(composeTestRule.onRoot().printToString())
try {
composeTestRule.onNodeWithText("3 min read", substring = true).assertExists()
composeTestRule.onAllNodes(hasText("3 min read", substring = true))[0].assertExists()
} catch (e: AssertionError) {
println(composeTestRule.onRoot().printToString())
throw e
Expand Down

0 comments on commit 79d2277

Please sign in to comment.