UiAutomatorTestScopeKt
Added in 2.4.0-alpha07
public final class UiAutomatorTestScopeKt
Summary
Public methods |
|
|---|---|
static final void |
uiAutomator(@NonNull Function1<@NonNull UiAutomatorTestScope, Unit> block)Main entry point for ui automator tests. |
Public methods
uiAutomator
public static final void uiAutomator(@NonNull Function1<@NonNull UiAutomatorTestScope, Unit> block)
Main entry point for ui automator tests. It creates a UiAutomatorTestScope in which a test can be defined.
Example:
@Test
fun myTest() = uiAutomator {
startActivity(MyActivity::class.java)
onElement { id == "button" }.click()
onElement { id == "nested_elements" }
.apply {
onElement { text == "First Level" }
onElement { text == "Second Level" }
onElement { text == "Third Level" }
}
}
| Parameters | |
|---|---|
@NonNull Function1<@NonNull UiAutomatorTestScope, Unit> block |
A block containing the test to run within the |