Package-level declarations

Types

Link copied to clipboard
@IviExperimental(reasons = [])
class ActiveDisplayScope(displayId: DisplayId)

Scope which provides necessary data and useful routines for writing multi-display tests. It provides:

Link copied to clipboard
@IviExperimental(reasons = [])
data class DisplayId(val id: Int)

Represents a display ID.

Link copied to clipboard
@IviExperimental(reasons = [])
class OnDisplayContext(val primaryActivityScenarioStateProvider: () -> Lifecycle.State, val moveFocusToDisplay: (DisplayId) -> Unit, val displayIdProvider: () -> DisplayId)

The context for onDisplay invocation.

Functions

Link copied to clipboard
Link copied to clipboard

Creates an OnDisplayContext for a secondary display. The display ID of the secondary display is provided by displayIdProvider.

Link copied to clipboard

Force to finish passenger activity. Passenger activity will be destroyed before any other activities lifecycle status changes.

Launches debug menu activity on secondary display using debug menu on primary screen.

Launches passenger's activity on secondary display using debug menu.

Link copied to clipboard

Move focus to ivi activity on primary display.

Link copied to clipboard

Move focus to ivi activity on secondary display.

Link copied to clipboard

Obtains the list of all available secondary displays. Throws IllegalStateException if there are no secondary displays available.

Link copied to clipboard

Prevents contraptions like:

@IviExperimental(reasons = [])
fun onDisplay(context: OnDisplayContext, action: ActiveDisplayScope.() -> Unit)

Activates Activity on the display specified in context and introduces a scope for actions and assertions. Lambda action is supplied with ActiveDisplayScope as a receiver. In this lambda it is important to always use ActiveDisplayScope.rootMatcher when obtaining a ViewInteraction.

Link copied to clipboard
@IviExperimental(reasons = [])
fun thatDoesNotMatchesPrimaryDisplay(): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to any non primary display. Convenient to use if you have primary and one secondary display only.

Link copied to clipboard
@IviExperimental(reasons = [])
fun thatMatchesActivity(activityClass: KClass<out Activity>): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to the given type-safe activityClass.

Link copied to clipboard
@IviExperimental(reasons = [])
fun thatMatchesActivityNamed(activityClassName: String): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to the given arbitrary string activityClassName, which must contain a fully qualified class name, such as com.example.application.internal.TestActivity.

Link copied to clipboard
@IviExperimental(reasons = [])
fun thatMatchesPrimaryDisplay(): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to primary display.

Link copied to clipboard
@IviExperimental(reasons = [])
fun thatMatchesSpecificDisplay(displayId: DisplayId): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to display with the given displayId.