From 1f0f5b816776df27e65d091564e0366265e853ff Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Sat, 13 Apr 2024 14:02:18 +0900 Subject: [PATCH] Find topic by onNodeWithContentDescription. Change-Id: I2423e3846c02169f6bf1fc30d9b4034b5f79efb3 --- .../com/google/samples/apps/nowinandroid/ui/NavigationTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt index f0efeffdc..38574e32e 100644 --- a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt +++ b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt @@ -128,7 +128,7 @@ class NavigationTest { fun navigationBar_navigateToPreviouslySelectedTab_restoresContent() { composeTestRule.apply { // GIVEN the user follows a topic - onNodeWithText(sampleTopic).performClick() + onNodeWithContentDescription(sampleTopic).performClick() // WHEN the user navigates to the Interests destination onNodeWithText(interests).performClick() // AND the user navigates to the For You destination @@ -152,7 +152,7 @@ class NavigationTest { fun navigationBar_reselectTab_keepsState() { composeTestRule.apply { // GIVEN the user follows a topic - onNodeWithText(sampleTopic).performClick() + onNodeWithContentDescription(sampleTopic).performClick() // WHEN the user taps the For You navigation bar item onNodeWithText(forYou).performClick() // THEN the state of the For You destination is restored