@@ -35,9 +35,9 @@ class UiDesignTest {
3535 permissions()
3636 ActivityScenario .launch(MainActivity ::class .java).use { scenario ->
3737 fun homeGeometry (): List <Int > {
38- compose.onNode(hasSetTextAction() ).assertIsDisplayed()
38+ compose.onNodeWithTag( " home-search-controls " ).assertIsDisplayed()
3939 compose.onNodeWithText(" 开始模拟" ).assertIsDisplayed()
40- val search = compose.onNode(hasSetTextAction() ).fetchSemanticsNode().boundsInRoot
40+ val search = compose.onNodeWithTag( " home-search-controls " ).fetchSemanticsNode().boundsInRoot
4141 val bottom = compose.onNodeWithText(" 开始模拟" ).fetchSemanticsNode().boundsInRoot
4242 var geometry = emptyList<Int >()
4343 scenario.onActivity { activity ->
@@ -111,7 +111,7 @@ class UiDesignTest {
111111 @Test fun edgeToEdgeKeepsMapFullSizeAndControlsInsideSafeInsets () {
112112 permissions()
113113 ActivityScenario .launch(MainActivity ::class .java).use { scenario ->
114- compose.onNode(hasSetTextAction() ).assertIsDisplayed()
114+ compose.onNodeWithTag( " home-search-controls " ).assertIsDisplayed()
115115 val insets = androidx.core.view.WindowInsetsCompat .Builder ()
116116 .setInsets(androidx.core.view.WindowInsetsCompat .Type .systemBars(), androidx.core.graphics.Insets .of(12 , 48 , 16 , 32 ))
117117 .build()
@@ -120,7 +120,7 @@ class UiDesignTest {
120120 compose.waitForIdle()
121121 }
122122 applyInsets()
123- val search = compose.onNode(hasSetTextAction() ).fetchSemanticsNode().boundsInRoot
123+ val search = compose.onNodeWithTag( " home-search-controls " ).fetchSemanticsNode().boundsInRoot
124124 val start = compose.onNodeWithText(" 开始模拟" ).fetchSemanticsNode().boundsInRoot
125125 var mapWidth = 0
126126 var mapHeight = 0
@@ -148,7 +148,7 @@ class UiDesignTest {
148148 assertTrue(" $description must not overlap the start action" , button.bottom <= start.top)
149149 }
150150 applyInsets()
151- assertEquals(search, compose.onNode(hasSetTextAction() ).fetchSemanticsNode().boundsInRoot)
151+ assertEquals(search, compose.onNodeWithTag( " home-search-controls " ).fetchSemanticsNode().boundsInRoot)
152152 assertEquals(start, compose.onNodeWithText(" 开始模拟" ).fetchSemanticsNode().boundsInRoot)
153153 compose.openPage(scenario, R .id.nav_mock)
154154 applyInsets()
@@ -342,7 +342,7 @@ class UiDesignTest {
342342 }
343343 compose.onNodeWithText(" 开始模拟" ).assertIsDisplayed()
344344 compose.onNodeWithContentDescription(" 选择模拟目标" ).assertIsDisplayed()
345- val search = compose.onNode(hasSetTextAction() ).fetchSemanticsNode().boundsInRoot
345+ val search = compose.onNodeWithTag( " home-search-controls " ).fetchSemanticsNode().boundsInRoot
346346 val panel = compose.onNodeWithTag(" home-runtime-panel" ).fetchSemanticsNode().boundsInRoot
347347 val root = compose.onNode(isRoot() and hasAnyDescendant(hasTestTag(" home-runtime-panel" )))
348348 .fetchSemanticsNode().boundsInRoot
0 commit comments