Android Studio Sign in

UiAutomatorTestScopeKt

Added in 2.4.0

public final class UiAutomatorTestScopeKt


Summary

Public methods

static final void

Main entry point for ui automator tests.

Public methods

public static final void uiAutomator(@NonNull Function1<@NonNull UiAutomatorTestScopeUnit> 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 UiAutomatorTestScopeUnit> block

A block containing the test to run within the UiAutomatorTestScope.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.