@@ -3,33 +3,33 @@ import androidx.compose.runtime.*
33import androidx.compose.ui.Modifier
44import androidx.compose.ui.platform.testTag
55import androidx.compose.ui.test.*
6- import kotlin.test.Test
7-
8- class ExampleTest {
6+ import io.kotest.core.spec.style.FunSpec
97
8+ class ExampleTest : FunSpec ({
109 @OptIn(ExperimentalTestApi ::class )
11- @Test
12- fun myTest () = runComposeUiTest {
13- // Declares a mock UI to demonstrate API calls
14- //
15- // Replace with your own declarations to test the code of your project
16- setContent {
17- var text by remember { mutableStateOf(" Hello" ) }
18- Text (
19- text = text,
20- modifier = Modifier .testTag(" text" )
21- )
22- Button (
23- onClick = { text = " Compose" },
24- modifier = Modifier .testTag(" button" )
25- ) {
26- Text (" Click me" )
10+ test("smoke test") {
11+ runComposeUiTest {
12+ // Declares a mock UI to demonstrate API calls
13+ //
14+ // Replace with your own declarations to test the code of your project
15+ setContent {
16+ var text by remember { mutableStateOf("Hello ") }
17+ Text (
18+ text = text,
19+ modifier = Modifier .testTag("text")
20+ )
21+ Button (
22+ onClick = { text = "Compose " },
23+ modifier = Modifier .testTag("button")
24+ ) {
25+ Text ("Click me")
26+ }
2727 }
28- }
2928
30- // Tests the declared UI with assertions and actions of the Compose Multiplatform testing API
31- onNodeWithTag(" text" ).assertTextEquals(" Hello" )
32- onNodeWithTag(" button" ).performClick()
33- onNodeWithTag(" text" ).assertTextEquals(" Compose" )
29+ // Tests the declared UI with assertions and actions of the Compose Multiplatform testing API
30+ onNodeWithTag("text").assertTextEquals("Hello ")
31+ onNodeWithTag("button").performClick()
32+ onNodeWithTag("text").assertTextEquals("Compose ")
33+ }
3434 }
35- }
35+ })
0 commit comments