@@ -18,10 +18,10 @@ package com.example.owl.ui
18
18
19
19
import androidx.activity.ComponentActivity
20
20
import androidx.compose.runtime.Providers
21
- import androidx.compose.ui.test.hasLabel
21
+ import androidx.compose.ui.test.hasContentDescription
22
22
import androidx.compose.ui.test.hasSubstring
23
23
import androidx.compose.ui.test.junit4.createAndroidComposeRule
24
- import androidx.compose.ui.test.onNodeWithLabel
24
+ import androidx.compose.ui.test.onNodeWithContentDescription
25
25
import androidx.compose.ui.test.onNodeWithSubstring
26
26
import androidx.compose.ui.test.performClick
27
27
import androidx.test.platform.app.InstrumentationRegistry
@@ -72,7 +72,7 @@ class NavigationTest {
72
72
startActivity()
73
73
// The first screen should be the onboarding screen.
74
74
// Assert that the FAB label for the onboarding screen exists:
75
- composeTestRule.onNodeWithLabel (getOnboardingFabLabel()).assertExists()
75
+ composeTestRule.onNodeWithContentDescription (getOnboardingFabLabel()).assertExists()
76
76
}
77
77
78
78
@Test
@@ -82,7 +82,7 @@ class NavigationTest {
82
82
83
83
// Navigate to the next screen by clicking on the FAB
84
84
val fabLabel = getOnboardingFabLabel()
85
- composeTestRule.onNodeWithLabel (fabLabel).performClick()
85
+ composeTestRule.onNodeWithContentDescription (fabLabel).performClick()
86
86
87
87
// The first course should be shown
88
88
composeTestRule.onNodeWithSubstring(courses.first().name).assertExists()
@@ -95,7 +95,7 @@ class NavigationTest {
95
95
96
96
// Navigate to the first course
97
97
composeTestRule.onNode(
98
- hasLabel (getFeaturedCourseLabel()).and (hasSubstring(courses.first().name))
98
+ hasContentDescription (getFeaturedCourseLabel()).and (hasSubstring(courses.first().name))
99
99
).performClick()
100
100
101
101
// Assert navigated to the course details
0 commit comments