-
-
Save valokafor/fd72b699af0a4b4e07102964fb64792a to your computer and use it in GitHub Desktop.
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
package com.theozgurr.apparchitecture.common | |
import androidx.compose.animation.ExperimentalAnimationApi | |
import androidx.compose.ui.ExperimentalComposeUiApi | |
import androidx.compose.ui.test.junit4.AndroidComposeTestRule | |
import androidx.compose.ui.test.onNodeWithTag | |
import androidx.compose.ui.test.performClick | |
import androidx.compose.ui.test.performTextInput | |
import androidx.test.ext.junit.rules.ActivityScenarioRule | |
import com.theozgurr.apparchitecture.ui.MainActivity | |
@OptIn( | |
ExperimentalComposeUiApi::class, | |
ExperimentalAnimationApi::class | |
) | |
private typealias MainActivityRule = AndroidComposeTestRule<ActivityScenarioRule<MainActivity>, MainActivity> | |
@OptIn(ExperimentalAnimationApi::class) | |
@ExperimentalComposeUiApi | |
fun MainActivityRule.typeInputToTextFieldWithTag( | |
input: String, | |
tag: String | |
) { | |
onNodeWithTag(tag) | |
.performTextInput(input) | |
} | |
@OptIn(ExperimentalAnimationApi::class) | |
@ExperimentalComposeUiApi | |
fun MainActivityRule.clickToTagOwner( | |
tag: String | |
) { | |
onNodeWithTag(tag) | |
.performClick() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment