Skip to content

Commit 9aaeb1e

Browse files
committed
tests updated.
1 parent bb6ab4a commit 9aaeb1e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mobile/src/androidTest/java/io/syslogic/demo/colorpicker/TestComposeActivity.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.ui.test.onNodeWithTag
1212
import androidx.compose.ui.test.onRoot
1313
import androidx.compose.ui.test.performMouseInput
1414
import androidx.compose.ui.test.printToLog
15+
import androidx.compose.ui.unit.DpRect
1516
import androidx.test.ext.junit.rules.ActivityScenarioRule
1617
import androidx.test.ext.junit.runners.AndroidJUnit4
1718

@@ -147,13 +148,13 @@ class TestComposeActivity : TestSuite() {
147148
@Override
148149
@ExperimentalTestApi
149150
private fun randomlyClick(interaction: SemanticsNodeInteraction) {
150-
val rect = interaction.getBoundsInRoot()
151+
val rect: DpRect = interaction.getBoundsInRoot()
151152
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())))
155156
)
156-
val position = Offset(coordinate[0].toFloat(), coordinate[1].toFloat())
157+
val position = Offset(coordinate[0], coordinate[1])
157158
interaction.performMouseInput {
158159
click(position)
159160
}

0 commit comments

Comments
 (0)