AtomAction

public final class AtomAction
extends Object implements ViewAction

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


一个ViewAction,它可以在webview中对提供的Atom进行评估。

不建议直接使用AtomAction。

取而代之的是如何通过Atom与WebView内容交互的例子。

如果您必须直接使用AtomAction,请注意记住它们是有状态的(与大多数ViewActions不同),并且调用方必须调用{@ #get()}以确保操作已完成。

也可以看看:

Summary

Public constructors

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

创建一个AtomAction。

Public methods

E get(long val, TimeUnit unit)

直到原子通过可配置的超时完成执行为止。

E get()

阻塞直到原子完成执行。

Matcher<View> getConstraints()

ViewActions的一种机制来指定它们可以操作的视图类型。

String getDescription()

返回视图操作的描述。

Future<E> getFuture()

回报未来,这将从futureEval中设置和转化。

void perform(UiController controller, View view)

在给定视图上执行此操作。

Inherited methods

From class java.lang.Object
From interface android.support.test.espresso.ViewAction

Public constructors

AtomAction

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

创建一个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)

直到原子通过可配置的超时完成执行为止。

Parameters
val long
unit TimeUnit
Returns
E
Throws
ExecutionException
InterruptedException
TimeoutException

get

E get ()

阻塞直到原子完成执行。

Returns
E
Throws
ExecutionException
InterruptedException

getConstraints

Matcher<View> getConstraints ()

ViewActions的一种机制来指定它们可以操作的视图类型。 ViewAction可以要求传递的视图符合某些约束。 例如,它可能希望确保视图已经在设备的可视物理屏幕中或具有某种类型。

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

getDescription

String getDescription ()

返回视图操作的描述。 描述不应该太长,并且应该很好地适用于以下这样的句子:“对带ID的视图执行%description%动作...”

Returns
String

getFuture

Future<E> getFuture ()

回报未来,这将从futureEval中设置和转化。 Espresso的公共API在它的方法签名中不能有番石榴类型,所以返回Future而不是ListenableFuture或SettableFuture。

Returns
Future<E>

perform

void perform (UiController controller, 
                View view)

在给定视图上执行此操作。

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