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