File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
mobile/src/androidTest/java/io/syslogic/demo/colorpicker Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import androidx.compose.ui.test.onNodeWithTag
12
12
import androidx.compose.ui.test.onRoot
13
13
import androidx.compose.ui.test.performMouseInput
14
14
import androidx.compose.ui.test.printToLog
15
+ import androidx.compose.ui.unit.DpRect
15
16
import androidx.test.ext.junit.rules.ActivityScenarioRule
16
17
import androidx.test.ext.junit.runners.AndroidJUnit4
17
18
@@ -147,13 +148,13 @@ class TestComposeActivity : TestSuite() {
147
148
@Override
148
149
@ExperimentalTestApi
149
150
private fun randomlyClick (interaction : SemanticsNodeInteraction ) {
150
- val rect = interaction.getBoundsInRoot()
151
+ val rect: DpRect = interaction.getBoundsInRoot()
151
152
val rnd = Random ()
152
- val coordinate = longArrayOf (
153
- ((rect.left.value + rnd.nextInt((rect.right.value - rect.left.value + 1 ).toInt())).toLong() ),
154
- ((rect.top.value + rnd.nextInt((rect.bottom.value - rect.top.value + 1 ).toInt())).toLong() )
153
+ val coordinate = floatArrayOf (
154
+ ((rect.left.value + rnd.nextInt((rect.right.value - rect.left.value + 1 ).toInt()))),
155
+ ((rect.top.value + rnd.nextInt((rect.bottom.value - rect.top.value + 1 ).toInt())))
155
156
)
156
- val position = Offset (coordinate[0 ].toFloat() , coordinate[1 ].toFloat() )
157
+ val position = Offset (coordinate[0 ], coordinate[1 ])
157
158
interaction.performMouseInput {
158
159
click(position)
159
160
}
You can’t perform that action at this time.
0 commit comments