Summary: Ctors | Methods | Inherited Methods | [Expand All]

# AtomAction

`public final class AtomAction`
`extends Object` `implements ViewAction`

java.lang.Object
↳ | android.support.test.espresso.web.action.AtomAction<E>

A ViewAction which causes the provided Atom to be evaluated within a webview.

It is not recommended to use AtomAction directly.

Instead for examples of how to interact with a WebView's content through Atoms.

If you must use AtomAction directly, take care to remember that they are Stateful (unlike most ViewActions) and the caller must call {@ #get()} to ensure that the action has completed.

See also:

- `Web`

## Summary

### Public constructors
`AtomAction(Atom<E> atom, WindowReference window, ElementReference element)` Creates an AtomAction.

### Public methods
`E` | `get(long val, TimeUnit unit)` Blocks until the atom has completed execution with a configurable timeout.
`E` | `get()` Blocks until the atom has completed execution.
`Matcher<View>` | `getConstraints()` A mechanism for ViewActions to specify what type of views they can operate on.
`String` | `getDescription()` Returns a description of the view action.
`Future<E>` | `getFuture()` Return a Future, which will be set and transformed from futureEval.
`void` | `perform(UiController controller, View view)` Performs this action on the given view.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()`
`boolean` | `equals(Object arg0)`
`void` | `finalize()`
`final Class<?>` | `getClass()`
`int` | `hashCode()`
`final void` | `notify()`
`final void` | `notifyAll()`
`String` | `toString()`
`final void` | `wait(long arg0, int arg1)`
`final void` | `wait(long arg0)`
`final void` | `wait()`
From interface `android.support.test.espresso.ViewAction`
`abstract Matcher<View>` | `getConstraints()` A mechanism for ViewActions to specify what type of views they can operate on.
`abstract String` | `getDescription()` Returns a description of the view action.
`abstract void` | `perform(UiController uiController, View view)` Performs this action on the given view.

## Public constructors

### AtomAction

    AtomAction (Atom<E> atom,
                    WindowReference window,
                    ElementReference element)

Creates an AtomAction.

Parameters
`atom` | `Atom`: the atom to execute
`window` | `WindowReference`: (optional/nullable) the window context to execute on.
`element` | `ElementReference`: (optional/nullable) the element to execute on.

## Public methods

### get

    E get (long val,
                    TimeUnit unit)

Blocks until the atom has completed execution with a configurable timeout.

Parameters
`val` | `long`
`unit` | `TimeUnit`

Returns
`E` |

Throws
`ExecutionException` |
`InterruptedException` |
`TimeoutException` |

### get

    E get ()

Blocks until the atom has completed execution.

Returns
`E` |

Throws
`ExecutionException` |
`InterruptedException` |

### getConstraints

    Matcher<View> getConstraints ()

A mechanism for ViewActions to specify what type of views they can operate on. A ViewAction can demand that the view passed to perform meets certain constraints. For example it may want to ensure the view is already in the viewable physical screen of the device or is of a certain type.

Returns
`Matcher<View>` | a `Matcher` that will be tested prior to calling perform.

### getDescription

    String getDescription ()

Returns a description of the view action. The description should not be overly long and should fit nicely in a sentence like: "performing %description% action on view with id ..."

Returns
`String` |

### getFuture

    Future<E> getFuture ()

Return a Future, which will be set and transformed from futureEval. Espresso's public API cannot have guava types in its method signatures, so return Future instead of ListenableFuture or SettableFuture.

Returns
`Future<E>` |

### perform

    void perform (UiController controller,
                    View view)

Performs this action on the given view.

Parameters
`controller` | `UiController`: the controller to use to interact with the UI.
`view` | `View`: the view to act upon. never null.

- ## Classes

  - AtomAction
  - EnableJavascriptAction