File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
app/src/androidTest/java/com/google/samples/apps/nowinandroid/ui Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,11 @@ package com.google.samples.apps.nowinandroid.ui
1919import androidx.compose.ui.test.assertCountEquals
2020import androidx.compose.ui.test.assertIsOn
2121import androidx.compose.ui.test.assertIsSelected
22+ import androidx.compose.ui.test.hasAnyAncestor
23+ import androidx.compose.ui.test.hasTestTag
24+ import androidx.compose.ui.test.hasText
2225import androidx.compose.ui.test.junit4.createAndroidComposeRule
2326import androidx.compose.ui.test.onAllNodesWithText
24- import androidx.compose.ui.test.onLast
2527import androidx.compose.ui.test.onNodeWithContentDescription
2628import androidx.compose.ui.test.onNodeWithText
2729import androidx.compose.ui.test.performClick
@@ -213,7 +215,12 @@ class NavigationTest {
213215 onNodeWithText(ok).performClick()
214216
215217 // Check that the saved screen is still visible and selected.
216- onAllNodesWithText(saved).onLast().assertIsSelected()
218+ onNode(
219+ hasText(saved) and
220+ hasAnyAncestor(
221+ hasTestTag(" NiaBottomBar" ) or hasTestTag(" NiaNavRail" ),
222+ ),
223+ ).assertIsSelected()
217224 }
218225 }
219226
You can’t perform that action at this time.
0 commit comments