forked from KakaoCup/Compose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request KakaoCup#36 from fobo66/gesture-deprecated
Deprecated `performGesture` and added `performTouchInput`
- Loading branch information
Showing
3 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
sample/src/androidTest/java/io/github/kakaocup/compose/test/GestureTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.kakaocup.compose.test | ||
|
||
import androidx.compose.ui.test.click | ||
import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
import io.github.kakaocup.compose.MainActivity | ||
import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen | ||
import io.github.kakaocup.compose.screen.MainActivityScreen | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class GestureTest { | ||
|
||
@get:Rule | ||
val composeTestRule = createAndroidComposeRule<MainActivity>() | ||
|
||
@Test | ||
fun gestureTest() { | ||
onComposeScreen<MainActivityScreen>(composeTestRule) { | ||
myButton { | ||
performGesture { | ||
click() | ||
} | ||
assertTextContains("Button 1") | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
sample/src/androidTest/java/io/github/kakaocup/compose/test/TouchInputTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.kakaocup.compose.test | ||
|
||
import androidx.compose.ui.test.click | ||
import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
import io.github.kakaocup.compose.MainActivity | ||
import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen | ||
import io.github.kakaocup.compose.screen.MainActivityScreen | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class TouchInputTest { | ||
|
||
@get:Rule | ||
val composeTestRule = createAndroidComposeRule<MainActivity>() | ||
|
||
@Test | ||
fun touchInputTest() { | ||
onComposeScreen<MainActivityScreen>(composeTestRule) { | ||
myButton { | ||
performTouchInput { | ||
click() | ||
} | ||
assertTextContains("Button 1") | ||
} | ||
} | ||
} | ||
} |