InteractionRequest.Builder
public class InteractionRequest.Builder
Creates an instance of InteractionRequest from a View matcher and action.
Summary
Public methods |
|
|---|---|
InteractionRequest |
build()Builds an |
InteractionRequest.Builder |
setRequestProto(@NonNull byte[] protoByteArray)Set the result proto as a byte array. |
InteractionRequest.Builder |
setRootMatcher(@NonNull Matcher<Root> rootMatcher)Sets the root matcher for this |
InteractionRequest.Builder |
setViewAction(@NonNull ViewAction viewAction)Sets the |
InteractionRequest.Builder |
setViewAssertion(@NonNull ViewAssertion viewAssertion)Sets the |
InteractionRequest.Builder |
setViewMatcher(@NonNull Matcher<View> viewMatcher)Sets the view matcher for this |
Public methods
build
public InteractionRequest build()
Builds an InteractionRequest object.
| Returns | |
|---|---|
InteractionRequest |
an |
| Throws | |
|---|---|
java.lang.IllegalStateException |
when conflicting properties are set. You can either set a |
androidx.test.espresso.remote.RemoteProtocolException |
when the provided proto byte array cannot be parsed into a protocol buffer of type |
setRequestProto
public InteractionRequest.Builder setRequestProto(@NonNull byte[] protoByteArray)
Set the result proto as a byte array. This byte array will be parsed into an InteractionRequestProto. Providing an invalid byte array will result in a RemoteProtocolException when the build method is called!
| Parameters | |
|---|---|
@NonNull byte[] protoByteArray |
the proto byte array to set |
| Returns | |
|---|---|
InteractionRequest.Builder |
fluent interface |
setRootMatcher
public InteractionRequest.Builder setRootMatcher(@NonNull Matcher<Root> rootMatcher)
Sets the root matcher for this InteractionRequest
| Returns | |
|---|---|
InteractionRequest.Builder |
fluent interface |
| See also | |
|---|---|
Root |
setViewAction
public InteractionRequest.Builder setViewAction(@NonNull ViewAction viewAction)
Sets the ViewAction for this InteractionRequest
| Parameters | |
|---|---|
@NonNull ViewAction viewAction |
the view action to set |
| Returns | |
|---|---|
InteractionRequest.Builder |
fluent interface |
| Throws | |
|---|---|
java.lang.IllegalStateException |
if a |
setViewAssertion
public InteractionRequest.Builder setViewAssertion(@NonNull ViewAssertion viewAssertion)
Sets the ViewAssertion for this InteractionRequest
| Parameters | |
|---|---|
@NonNull ViewAssertion viewAssertion |
the view action to set |
| Returns | |
|---|---|
InteractionRequest.Builder |
fluent interface |
| Throws | |
|---|---|
java.lang.IllegalStateException |
if a |
setViewMatcher
public InteractionRequest.Builder setViewMatcher(@NonNull Matcher<View> viewMatcher)
Sets the view matcher for this InteractionRequest
| Returns | |
|---|---|
InteractionRequest.Builder |
fluent interface |