From 489218c3eda7f77e99425989981714a16dded5c1 Mon Sep 17 00:00:00 2001 From: Quddus Chong Date: Thu, 26 Feb 2015 16:38:46 -0800 Subject: [PATCH] docs: Added overview page and Javadocs for the Android Testing Support Library. Change-Id: I645d3a302ce0d1d4cd389c6a58709a11a0426aed --- .../support/test/InstrumentationRegistry.html | 1378 +++++ ...AmbiguousViewMatcherException.Builder.html | 1533 +++++ .../AmbiguousViewMatcherException.html | 1429 +++++ .../test/espresso/AppNotIdleException.html | 1485 +++++ .../test/espresso/DataInteraction.html | 1513 +++++ .../support/test/espresso/Espresso.html | 1831 ++++++ .../test/espresso/EspressoException.html | 936 ++++ .../support/test/espresso/FailureHandler.html | 950 ++++ .../support/test/espresso/GraphHolder.html | 1227 ++++ .../support/test/espresso/IdlingPolicies.html | 1372 +++++ .../support/test/espresso/IdlingPolicy.html | 1264 +++++ .../IdlingResource.ResourceCallback.html | 887 +++ .../support/test/espresso/IdlingResource.html | 1106 ++++ .../IdlingResourceTimeoutException.html | 1460 +++++ .../InjectEventSecurityException.html | 1527 +++++ .../espresso/NoActivityResumedException.html | 1503 +++++ .../espresso/NoMatchingRootException.html | 1454 +++++ .../NoMatchingViewException.Builder.html | 1485 +++++ .../espresso/NoMatchingViewException.html | 1503 +++++ .../espresso/PerformException.Builder.html | 1390 +++++ .../test/espresso/PerformException.html | 1535 +++++ .../support/test/espresso/Root.Builder.html | 1290 +++++ .../android/support/test/espresso/Root.html | 1259 +++++ .../support/test/espresso/UiController.html | 1205 ++++ .../support/test/espresso/ViewAction.html | 1230 ++++ .../support/test/espresso/ViewAssertion.html | 917 +++ .../support/test/espresso/ViewFinder.html | 966 ++++ .../test/espresso/ViewInteraction.html | 1355 +++++ .../action/AdapterDataLoaderAction.html | 1499 +++++ ...apterViewProtocol.AdaptedData.Builder.html | 1339 +++++ .../AdapterViewProtocol.AdaptedData.html | 1335 +++++ .../AdapterViewProtocol.DataFunction.html | 884 +++ .../espresso/action/AdapterViewProtocol.html | 1259 +++++ .../espresso/action/AdapterViewProtocols.html | 1144 ++++ .../espresso/action/CloseKeyboardAction.html | 1449 +++++ .../espresso/action/CoordinatesProvider.html | 961 ++++ .../test/espresso/action/EditorAction.html | 1449 +++++ .../espresso/action/EspressoKey.Builder.html | 1416 +++++ .../test/espresso/action/EspressoKey.html | 1256 +++++ .../espresso/action/GeneralClickAction.html | 1497 +++++ .../test/espresso/action/GeneralLocation.html | 1966 +++++++ .../espresso/action/GeneralSwipeAction.html | 1449 +++++ .../test/espresso/action/KeyEventAction.html | 1449 +++++ .../test/espresso/action/OpenLinkAction.html | 1451 +++++ .../espresso/action/PrecisionDescriber.html | 952 ++++ .../support/test/espresso/action/Press.html | 1665 ++++++ .../espresso/action/ReplaceTextAction.html | 1449 +++++ .../test/espresso/action/ScrollToAction.html | 1449 +++++ .../support/test/espresso/action/Swipe.html | 1623 ++++++ .../test/espresso/action/Swiper.Status.html | 1563 ++++++ .../support/test/espresso/action/Swiper.html | 1003 ++++ .../support/test/espresso/action/Tap.html | 1665 ++++++ .../test/espresso/action/Tapper.Status.html | 1610 ++++++ .../support/test/espresso/action/Tapper.html | 997 ++++ .../test/espresso/action/TypeTextAction.html | 1538 +++++ .../test/espresso/action/ViewActions.html | 2545 +++++++++ .../test/espresso/action/package-summary.html | 1033 ++++ .../espresso/assertion/LayoutAssertions.html | 1287 +++++ .../assertion/PositionAssertions.html | 1663 ++++++ .../espresso/assertion/ViewAssertions.html | 1228 ++++ .../espresso/assertion/package-summary.html | 702 +++ .../test/espresso/base/ActiveRootLister.html | 882 +++ .../BaseLayerModule.FailureHandlerHolder.html | 1228 ++++ .../test/espresso/base/BaseLayerModule.html | 1640 ++++++ .../support/test/espresso/base/Default.html | 927 ++++ .../espresso/base/DefaultFailureHandler.html | 1254 +++++ .../espresso/base/IdlingResourceRegistry.html | 1353 +++++ .../test/espresso/base/MainThread.html | 927 ++++ .../test/espresso/base/RootViewPicker.html | 1170 ++++ .../test/espresso/base/ViewFinderImpl.html | 1200 ++++ .../test/espresso/base/package-summary.html | 803 +++ .../contrib/CountingIdlingResource.html | 1738 ++++++ .../test/espresso/contrib/DrawerActions.html | 1177 ++++ .../test/espresso/contrib/DrawerMatchers.html | 1174 ++++ .../test/espresso/contrib/PickerActions.html | 1176 ++++ ...ctions.PositionableRecyclerViewAction.html | 1024 ++++ .../espresso/contrib/RecyclerViewActions.html | 1574 ++++++ .../espresso/contrib/package-summary.html | 755 +++ .../test/espresso/matcher/BoundedMatcher.html | 1510 +++++ .../test/espresso/matcher/CursorMatchers.html | 3688 ++++++++++++ .../test/espresso/matcher/LayoutMatchers.html | 1174 ++++ .../espresso/matcher/PreferenceMatchers.html | 1491 +++++ .../test/espresso/matcher/RootMatchers.html | 1407 +++++ .../matcher/ViewMatchers.Visibility.html | 1627 ++++++ .../test/espresso/matcher/ViewMatchers.html | 3800 +++++++++++++ .../espresso/matcher/package-summary.html | 765 +++ .../test/espresso/package-summary.html | 1025 ++++ .../espresso/util/ActivityLifecycles.html | 1207 ++++ .../test/espresso/util/HumanReadables.html | 1253 +++++ .../util/TreeIterables.ViewAndDistance.html | 1148 ++++ .../test/espresso/util/TreeIterables.html | 1306 +++++ .../test/espresso/util/package-summary.html | 714 +++ .../support/test/filters/FlakyTest.html | 916 +++ .../support/test/filters/RequiresDevice.html | 915 +++ .../support/test/filters/SdkSuppress.html | 915 +++ .../support/test/filters/package-summary.html | 702 +++ .../android/support/test/package-summary.html | 679 +++ .../support/test/runner/AndroidJUnit4.html | 2213 ++++++++ .../test/runner/AndroidJUnitRunner.html | 3044 ++++++++++ ...oringInstrumentation.ActivityFinisher.html | 1222 ++++ .../runner/MonitoringInstrumentation.html | 3150 +++++++++++ .../lifecycle/ActivityLifecycleCallback.html | 875 +++ .../lifecycle/ActivityLifecycleMonitor.html | 1137 ++++ .../support/test/runner/lifecycle/Stage.html | 1793 ++++++ .../runner/lifecycle/package-summary.html | 716 +++ .../support/test/runner/package-summary.html | 717 +++ .../android/support/test/uiautomator/By.html | 3058 ++++++++++ .../support/test/uiautomator/BySelector.html | 3563 ++++++++++++ .../test/uiautomator/Configurator.html | 1842 ++++++ .../support/test/uiautomator/Direction.html | 1697 ++++++ .../test/uiautomator/EventCondition.html | 1131 ++++ .../test/uiautomator/IAutomationSupport.html | 891 +++ .../test/uiautomator/SearchCondition.html | 1129 ++++ .../uiautomator/StaleObjectException.html | 1442 +++++ .../UiAutomatorInstrumentationTestRunner.html | 2787 ++++++++++ .../test/uiautomator/UiAutomatorTestCase.html | 2577 +++++++++ .../test/uiautomator/UiCollection.html | 2703 +++++++++ .../support/test/uiautomator/UiDevice.html | 4889 ++++++++++++++++ .../support/test/uiautomator/UiObject.html | 4932 +++++++++++++++++ .../support/test/uiautomator/UiObject2.html | 3829 +++++++++++++ .../test/uiautomator/UiObject2Condition.html | 1131 ++++ .../UiObjectNotFoundException.html | 1511 +++++ .../test/uiautomator/UiScrollable.html | 4623 +++++++++++++++ .../support/test/uiautomator/UiSelector.html | 3328 +++++++++++ .../support/test/uiautomator/UiWatcher.html | 909 +++ .../support/test/uiautomator/Until.html | 2824 ++++++++++ .../test/uiautomator/package-summary.html | 964 ++++ docs/html/tools/help/index.jd | 24 - .../tools/testing-support-library/index.jd | 625 +++ docs/html/tools/testing/testing-tools.jd | 56 + docs/html/tools/tools_toc.cs | 56 +- 131 files changed, 196345 insertions(+), 52 deletions(-) create mode 100644 docs/html/reference/android/support/test/InstrumentationRegistry.html create mode 100644 docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.Builder.html create mode 100644 docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.html create mode 100644 docs/html/reference/android/support/test/espresso/AppNotIdleException.html create mode 100644 docs/html/reference/android/support/test/espresso/DataInteraction.html create mode 100644 docs/html/reference/android/support/test/espresso/Espresso.html create mode 100644 docs/html/reference/android/support/test/espresso/EspressoException.html create mode 100644 docs/html/reference/android/support/test/espresso/FailureHandler.html create mode 100644 docs/html/reference/android/support/test/espresso/GraphHolder.html create mode 100644 docs/html/reference/android/support/test/espresso/IdlingPolicies.html create mode 100644 docs/html/reference/android/support/test/espresso/IdlingPolicy.html create mode 100644 docs/html/reference/android/support/test/espresso/IdlingResource.ResourceCallback.html create mode 100644 docs/html/reference/android/support/test/espresso/IdlingResource.html create mode 100644 docs/html/reference/android/support/test/espresso/IdlingResourceTimeoutException.html create mode 100644 docs/html/reference/android/support/test/espresso/InjectEventSecurityException.html create mode 100644 docs/html/reference/android/support/test/espresso/NoActivityResumedException.html create mode 100644 docs/html/reference/android/support/test/espresso/NoMatchingRootException.html create mode 100644 docs/html/reference/android/support/test/espresso/NoMatchingViewException.Builder.html create mode 100644 docs/html/reference/android/support/test/espresso/NoMatchingViewException.html create mode 100644 docs/html/reference/android/support/test/espresso/PerformException.Builder.html create mode 100644 docs/html/reference/android/support/test/espresso/PerformException.html create mode 100644 docs/html/reference/android/support/test/espresso/Root.Builder.html create mode 100644 docs/html/reference/android/support/test/espresso/Root.html create mode 100644 docs/html/reference/android/support/test/espresso/UiController.html create mode 100644 docs/html/reference/android/support/test/espresso/ViewAction.html create mode 100644 docs/html/reference/android/support/test/espresso/ViewAssertion.html create mode 100644 docs/html/reference/android/support/test/espresso/ViewFinder.html create mode 100644 docs/html/reference/android/support/test/espresso/ViewInteraction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/AdapterDataLoaderAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.Builder.html create mode 100644 docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.html create mode 100644 docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.DataFunction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.html create mode 100644 docs/html/reference/android/support/test/espresso/action/AdapterViewProtocols.html create mode 100644 docs/html/reference/android/support/test/espresso/action/CloseKeyboardAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/CoordinatesProvider.html create mode 100644 docs/html/reference/android/support/test/espresso/action/EditorAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/EspressoKey.Builder.html create mode 100644 docs/html/reference/android/support/test/espresso/action/EspressoKey.html create mode 100644 docs/html/reference/android/support/test/espresso/action/GeneralClickAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/GeneralLocation.html create mode 100644 docs/html/reference/android/support/test/espresso/action/GeneralSwipeAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/KeyEventAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/OpenLinkAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/PrecisionDescriber.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Press.html create mode 100644 docs/html/reference/android/support/test/espresso/action/ReplaceTextAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/ScrollToAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Swipe.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Swiper.Status.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Swiper.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Tap.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Tapper.Status.html create mode 100644 docs/html/reference/android/support/test/espresso/action/Tapper.html create mode 100644 docs/html/reference/android/support/test/espresso/action/TypeTextAction.html create mode 100644 docs/html/reference/android/support/test/espresso/action/ViewActions.html create mode 100644 docs/html/reference/android/support/test/espresso/action/package-summary.html create mode 100644 docs/html/reference/android/support/test/espresso/assertion/LayoutAssertions.html create mode 100644 docs/html/reference/android/support/test/espresso/assertion/PositionAssertions.html create mode 100644 docs/html/reference/android/support/test/espresso/assertion/ViewAssertions.html create mode 100644 docs/html/reference/android/support/test/espresso/assertion/package-summary.html create mode 100644 docs/html/reference/android/support/test/espresso/base/ActiveRootLister.html create mode 100644 docs/html/reference/android/support/test/espresso/base/BaseLayerModule.FailureHandlerHolder.html create mode 100644 docs/html/reference/android/support/test/espresso/base/BaseLayerModule.html create mode 100644 docs/html/reference/android/support/test/espresso/base/Default.html create mode 100644 docs/html/reference/android/support/test/espresso/base/DefaultFailureHandler.html create mode 100644 docs/html/reference/android/support/test/espresso/base/IdlingResourceRegistry.html create mode 100644 docs/html/reference/android/support/test/espresso/base/MainThread.html create mode 100644 docs/html/reference/android/support/test/espresso/base/RootViewPicker.html create mode 100644 docs/html/reference/android/support/test/espresso/base/ViewFinderImpl.html create mode 100644 docs/html/reference/android/support/test/espresso/base/package-summary.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/CountingIdlingResource.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/DrawerActions.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/DrawerMatchers.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/PickerActions.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.html create mode 100644 docs/html/reference/android/support/test/espresso/contrib/package-summary.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/BoundedMatcher.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/CursorMatchers.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/LayoutMatchers.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/PreferenceMatchers.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/RootMatchers.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.Visibility.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.html create mode 100644 docs/html/reference/android/support/test/espresso/matcher/package-summary.html create mode 100644 docs/html/reference/android/support/test/espresso/package-summary.html create mode 100644 docs/html/reference/android/support/test/espresso/util/ActivityLifecycles.html create mode 100644 docs/html/reference/android/support/test/espresso/util/HumanReadables.html create mode 100644 docs/html/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance.html create mode 100644 docs/html/reference/android/support/test/espresso/util/TreeIterables.html create mode 100644 docs/html/reference/android/support/test/espresso/util/package-summary.html create mode 100644 docs/html/reference/android/support/test/filters/FlakyTest.html create mode 100644 docs/html/reference/android/support/test/filters/RequiresDevice.html create mode 100644 docs/html/reference/android/support/test/filters/SdkSuppress.html create mode 100644 docs/html/reference/android/support/test/filters/package-summary.html create mode 100644 docs/html/reference/android/support/test/package-summary.html create mode 100644 docs/html/reference/android/support/test/runner/AndroidJUnit4.html create mode 100644 docs/html/reference/android/support/test/runner/AndroidJUnitRunner.html create mode 100644 docs/html/reference/android/support/test/runner/MonitoringInstrumentation.ActivityFinisher.html create mode 100644 docs/html/reference/android/support/test/runner/MonitoringInstrumentation.html create mode 100644 docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleCallback.html create mode 100644 docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleMonitor.html create mode 100644 docs/html/reference/android/support/test/runner/lifecycle/Stage.html create mode 100644 docs/html/reference/android/support/test/runner/lifecycle/package-summary.html create mode 100644 docs/html/reference/android/support/test/runner/package-summary.html create mode 100644 docs/html/reference/android/support/test/uiautomator/By.html create mode 100644 docs/html/reference/android/support/test/uiautomator/BySelector.html create mode 100644 docs/html/reference/android/support/test/uiautomator/Configurator.html create mode 100644 docs/html/reference/android/support/test/uiautomator/Direction.html create mode 100644 docs/html/reference/android/support/test/uiautomator/EventCondition.html create mode 100644 docs/html/reference/android/support/test/uiautomator/IAutomationSupport.html create mode 100644 docs/html/reference/android/support/test/uiautomator/SearchCondition.html create mode 100644 docs/html/reference/android/support/test/uiautomator/StaleObjectException.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiAutomatorTestCase.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiCollection.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiDevice.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiObject.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiObject2.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiObject2Condition.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiObjectNotFoundException.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiScrollable.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiSelector.html create mode 100644 docs/html/reference/android/support/test/uiautomator/UiWatcher.html create mode 100644 docs/html/reference/android/support/test/uiautomator/Until.html create mode 100644 docs/html/reference/android/support/test/uiautomator/package-summary.html create mode 100644 docs/html/tools/testing-support-library/index.jd create mode 100644 docs/html/tools/testing/testing-tools.jd diff --git a/docs/html/reference/android/support/test/InstrumentationRegistry.html b/docs/html/reference/android/support/test/InstrumentationRegistry.html new file mode 100644 index 00000000000..fa657d5be6a --- /dev/null +++ b/docs/html/reference/android/support/test/InstrumentationRegistry.html @@ -0,0 +1,1378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +InstrumentationRegistry | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

InstrumentationRegistry

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.InstrumentationRegistry
+ + + + + + + +
+ + +

Class Overview

+

An exposed registry instance that holds a reference to the instrumentation running in the + process and it's arguments. Also provides an easy way for callers to get a hold of + instrumentation, application context and instrumentation arguments Bundle. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Bundle + + getArguments() + +
+ Returns a copy of instrumentation arguments Bundle. + + + +
+ +
+ + + + static + + Context + + getContext() + +
+ Return the Context of this instrumentation's package. + + + +
+ +
+ + + + static + + Instrumentation + + getInstrumentation() + +
+ Returns the instrumentation currently running. + + + +
+ +
+ + + + static + + Context + + getTargetContext() + +
+ Return a Context for the target application being instrumented. + + + +
+ +
+ + + + static + + void + + registerInstance(Instrumentation instrumentation, Bundle arguments) + +
+ Records/exposes the instrumentation currently running and stores a copy of the + instrumentation arguments Bundle in the registry. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Bundle + + getArguments + () +

+
+
+ + + +
+
+ + + + +

Returns a copy of instrumentation arguments Bundle. Use this to get a Bundle + containing the command line arguments passed to Instrumentation into your test. +

+ This Bundle is not guaranteed to be present under all instrumentations. +

+
+
Returns
+
  • Bundle the arguments for this instrumentation.
+
+
+
Throws
+ + + + +
IllegalStateException + if no argument Bundle has been registered. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Context + + getContext + () +

+
+
+ + + +
+
+ + + + +

Return the Context of this instrumentation's package. Use this to get a + Context representing getContext() into your test. +

+ +
+
+ + + + +
+

+ + public + static + + + + Instrumentation + + getInstrumentation + () +

+
+
+ + + +
+
+ + + + +

Returns the instrumentation currently running. Use this to get an Instrumentation + into your test.

+
+
Throws
+ + + + +
IllegalStateException + if instrumentation hasn't been registered +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Context + + getTargetContext + () +

+
+
+ + + +
+
+ + + + +

Return a Context for the target application being instrumented. Use this to get a + Context representing getTargetContext() into your test. +

+ +
+
+ + + + +
+

+ + public + static + + + + void + + registerInstance + (Instrumentation instrumentation, Bundle arguments) +

+
+
+ + + +
+
+ + + + +

Records/exposes the instrumentation currently running and stores a copy of the + instrumentation arguments Bundle in the registry. +

+ This is a global registry - so be aware of the impact of calling this method! +

+
+
Parameters
+ + + + + + + +
instrumentation + the instrumentation currently running.
arguments + the arguments for this application. Null deregisters any existing arguments. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.Builder.html b/docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.Builder.html new file mode 100644 index 00000000000..0fd333dbdea --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.Builder.html @@ -0,0 +1,1533 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AmbiguousViewMatcherException.Builder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

AmbiguousViewMatcherException.Builder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.AmbiguousViewMatcherException.Builder
+ + + + + + + +
+ + +

Class Overview

+

Builder for AmbiguousViewMatcherException.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + AmbiguousViewMatcherException.Builder() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + AmbiguousViewMatcherException + + build() + +
+ + + + + + AmbiguousViewMatcherException.Builder + + from(AmbiguousViewMatcherException exception) + +
+ + + + + + AmbiguousViewMatcherException.Builder + + includeViewHierarchy(boolean includeViewHierarchy) + +
+ + + + + + AmbiguousViewMatcherException.Builder + + withOtherAmbiguousViews(View... others) + +
+ + + + + + AmbiguousViewMatcherException.Builder + + withRootView(View rootView) + +
+ + + + + + AmbiguousViewMatcherException.Builder + + withView1(View view1) + +
+ + + + + + AmbiguousViewMatcherException.Builder + + withView2(View view2) + +
+ + + + + + AmbiguousViewMatcherException.Builder + + withViewMatcher(Matcher<? super View> viewMatcher) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + AmbiguousViewMatcherException.Builder + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + AmbiguousViewMatcherException + + build + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + from + (AmbiguousViewMatcherException exception) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + includeViewHierarchy + (boolean includeViewHierarchy) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + withOtherAmbiguousViews + (View... others) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + withRootView + (View rootView) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + withView1 + (View view1) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + withView2 + (View view2) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AmbiguousViewMatcherException.Builder + + withViewMatcher + (Matcher<? super View> viewMatcher) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.html b/docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.html new file mode 100644 index 00000000000..0ced441e2a2 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/AmbiguousViewMatcherException.html @@ -0,0 +1,1429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AmbiguousViewMatcherException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

AmbiguousViewMatcherException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.AmbiguousViewMatcherException
+ + + + + + + +
+ + +

Class Overview

+

An exception which indicates that a Matcher matched multiple views in the hierarchy when + only one view was expected. It should be called only from the main thread. +

+ Contains details about the matcher and the current view hierarchy to aid in debugging. +

+

+ Since this is usually an unrecoverable error this exception is a runtime exception. +

+

+ References to the view and failing matcher are purposefully not included in the state of this + object - since it will most likely be created on the UI thread and thrown on the instrumentation + thread, it would be invalid to touch the view on the instrumentation thread. Also the view + hierarchy may have changed since exception creation (leading to more confusion). +

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classAmbiguousViewMatcherException.Builder + Builder for AmbiguousViewMatcherException.  + + + +
+ + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/AppNotIdleException.html b/docs/html/reference/android/support/test/espresso/AppNotIdleException.html new file mode 100644 index 00000000000..30736b6d619 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/AppNotIdleException.html @@ -0,0 +1,1485 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AppNotIdleException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

AppNotIdleException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.AppNotIdleException
+ + + + + + + +
+ + +

Class Overview

+

An exception which indicates that the App has not become idle even after the specified duration. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + AppNotIdleException + + create(List<String> idleConditions, int loopCount, int seconds) + +
+ Creates a new AppNotIdleException suitable for erroring out a test case. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + AppNotIdleException + + create + (List<String> idleConditions, int loopCount, int seconds) +

+
+
+ + + +
+
+ + + + +

Creates a new AppNotIdleException suitable for erroring out a test case. + + This should be called only from the main thread if the app does not idle out within the + specified duration.

+
+
Parameters
+ + + + + + + + + + +
idleConditions + list of idleConditions that failed to become idle.
loopCount + number of times it was tried to check if they became idle.
seconds + number of seconds that was tried before giving up.
+
+
+
Returns
+
  • a AppNotIdleException suitable to be thrown on the instrumentation thread. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/DataInteraction.html b/docs/html/reference/android/support/test/espresso/DataInteraction.html new file mode 100644 index 00000000000..c5028ed464d --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/DataInteraction.html @@ -0,0 +1,1513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +DataInteraction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

DataInteraction

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.DataInteraction
+ + + + + + + +
+ + +

Class Overview

+

An interface to interact with data displayed in AdapterViews. +

+ This interface builds on top of ViewInteraction and should be the preferred way to + interact with elements displayed inside AdapterViews. +

+

+ This is necessary because an AdapterView may not load all the data held by its Adapter into the + view hierarchy until a user interaction makes it necessary. Also it is more fluent / less brittle + to match upon the data object being rendered into the display then the rendering itself. +

+

+ By default, a DataInteraction takes place against any AdapterView found within the current + screen, if you have multiple AdapterView objects displayed, you will need to narrow the selection + by using the inAdapterView method. +

+

+ The check and perform method operate on the top level child of the adapter view, if you need to + operate on a subview (eg: a Button within the list) use the onChildView method before calling + perform or check. +

+ +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + DataInteraction + + atPosition(Integer atPosition) + +
+ Selects the view which matches the nth position on the adapter + based on the data matcher. + + + +
+ +
+ + + + + + ViewInteraction + + check(ViewAssertion assertion) + +
+ Performs an assertion on the state of the view after we force the data to be loaded. + + + +
+ +
+ + + + + + DataInteraction + + inAdapterView(Matcher<View> adapterMatcher) + +
+ Selects a particular adapter view to operate on, by default we operate on any adapter view + on the screen. + + + +
+ +
+ + + + + + DataInteraction + + inRoot(Matcher<Root> rootMatcher) + +
+ Causes this data interaction to work within the Root specified by the given root matcher. + + + +
+ +
+ + + + + + DataInteraction + + onChildView(Matcher<View> childMatcher) + +
+ Causes perform and check methods to take place on a specific child view of the view returned + by Adapter.getView() + + + + +
+ +
+ + + + + + ViewInteraction + + perform(ViewAction... actions) + +
+ Performs an action on the view after we force the data to be loaded. + + + +
+ +
+ + + + + + DataInteraction + + usingAdapterViewProtocol(AdapterViewProtocol adapterViewProtocol) + +
+ Use a different AdapterViewProtocol if the Adapter implementation does not + satisfy the AdapterView contract like (@code ExpandableListView) + + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + DataInteraction + + atPosition + (Integer atPosition) +

+
+
+ + + +
+
+ + + + +

Selects the view which matches the nth position on the adapter + based on the data matcher. +

+ +
+
+ + + + +
+

+ + public + + + + + ViewInteraction + + check + (ViewAssertion assertion) +

+
+
+ + + +
+
+ + + + +

Performs an assertion on the state of the view after we force the data to be loaded.

+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + DataInteraction + + inAdapterView + (Matcher<View> adapterMatcher) +

+
+
+ + + +
+
+ + + + +

Selects a particular adapter view to operate on, by default we operate on any adapter view + on the screen. +

+ +
+
+ + + + +
+

+ + public + + + + + DataInteraction + + inRoot + (Matcher<Root> rootMatcher) +

+
+
+ + + +
+
+ + + + +

Causes this data interaction to work within the Root specified by the given root matcher. +

+ +
+
+ + + + +
+

+ + public + + + + + DataInteraction + + onChildView + (Matcher<View> childMatcher) +

+
+
+ + + +
+
+ + + + +

Causes perform and check methods to take place on a specific child view of the view returned + by Adapter.getView() +

+ +
+
+ + + + +
+

+ + public + + + + + ViewInteraction + + perform + (ViewAction... actions) +

+
+
+ + + +
+
+ + + + +

Performs an action on the view after we force the data to be loaded.

+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + DataInteraction + + usingAdapterViewProtocol + (AdapterViewProtocol adapterViewProtocol) +

+
+
+ + + +
+
+ + + + +

Use a different AdapterViewProtocol if the Adapter implementation does not + satisfy the AdapterView contract like (@code ExpandableListView) +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/Espresso.html b/docs/html/reference/android/support/test/espresso/Espresso.html new file mode 100644 index 00000000000..0694747a28f --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/Espresso.html @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Espresso | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

Espresso

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.Espresso
+ + + + + + + +
+ + +

Class Overview

+

Entry point to the Espresso framework. Test authors can initiate testing by using one of the on* + methods (e.g. onView) or perform top-level user actions (e.g. pressBack). +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + void + + closeSoftKeyboard() + +
+ Closes soft keyboard if open. + + + +
+ +
+ + + + static + + List<IdlingResource> + + getIdlingResources() + +
+ Returns a list of all currently registered IdlingResources. + + + +
+ +
+ + + + static + + DataInteraction + + onData(Matcher<Object> dataMatcher) + +
+ Creates an DataInteraction for a data object displayed by the application. + + + +
+ +
+ + + + static + + ViewInteraction + + onView(Matcher<View> viewMatcher) + +
+ Creates a ViewInteraction for a given view. + + + +
+ +
+ + + + static + + void + + openActionBarOverflowOrOptionsMenu(Context context) + +
+ Opens the overflow menu displayed within an ActionBar. + + + +
+ +
+ + + + static + + void + + openContextualActionModeOverflowMenu() + +
+ Opens the overflow menu displayed in the contextual options of an ActionMode. + + + +
+ +
+ + + + static + + void + + pressBack() + +
+ Press on the back button. + + + +
+ +
+ + + + static + + boolean + + registerIdlingResources(IdlingResource... resources) + +
+ Registers one or more IdlingResources with the framework. + + + +
+ +
+ + + + static + + void + + registerLooperAsIdlingResource(Looper looper, boolean considerWaitIdle) + +
+ Registers a Looper for idle checking with the framework. + + + +
+ +
+ + + + static + + void + + registerLooperAsIdlingResource(Looper looper) + +
+ Registers a Looper for idle checking with the framework. + + + +
+ +
+ + + + static + + void + + setFailureHandler(FailureHandler failureHandler) + +
+ Changes the default FailureHandler to the given one. + + + +
+ +
+ + + + static + + boolean + + unregisterIdlingResources(IdlingResource... resources) + +
+ Unregisters one or more IdlingResources. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + void + + closeSoftKeyboard + () +

+
+
+ + + +
+
+ + + + +

Closes soft keyboard if open. +

+ +
+
+ + + + +
+

+ + public + static + + + + List<IdlingResource> + + getIdlingResources + () +

+
+
+ + + +
+
+ + + + +

Returns a list of all currently registered IdlingResources. +

+ +
+
+ + + + +
+

+ + public + static + + + + DataInteraction + + onData + (Matcher<Object> dataMatcher) +

+
+
+ + + +
+
+ + + + +

Creates an DataInteraction for a data object displayed by the application. Use this + method to load (into the view hierarchy) items from AdapterView widgets (e.g. ListView).

+
+
Parameters
+ + + + +
dataMatcher + a matcher used to find the data object. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewInteraction + + onView + (Matcher<View> viewMatcher) +

+
+
+ + + +
+
+ + + + +

Creates a ViewInteraction for a given view. Note: the view has + to be part of the view hierarchy. This may not be the case if it is rendered as part of + an AdapterView (e.g. ListView). If this is the case, use Espresso.onData to load the view + first.

+
+
Parameters
+ + + + +
viewMatcher + used to select the view.
+
+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + void + + openActionBarOverflowOrOptionsMenu + (Context context) +

+
+
+ + + +
+
+ + + + +

Opens the overflow menu displayed within an ActionBar. + +

This works with both native and SherlockActionBar ActionBars. + +

Note the significant differences of UX between ActionMode and ActionBars with respect to + overflows. If a hardware menu key is present, the overflow icon is never displayed in + ActionBars and can only be interacted with via menu key presses. +

+ +
+
+ + + + +
+

+ + public + static + + + + void + + openContextualActionModeOverflowMenu + () +

+
+
+ + + +
+
+ + + + +

Opens the overflow menu displayed in the contextual options of an ActionMode. + +

This works with both native and SherlockActionBar action modes. + +

Note the significant difference in UX between ActionMode and ActionBar overflows - + ActionMode will always present an overflow icon and that icon only responds to clicks. + The menu button (if present) has no impact on it. +

+ +
+
+ + + + +
+

+ + public + static + + + + void + + pressBack + () +

+
+
+ + + +
+
+ + + + +

Press on the back button.

+
+
Throws
+ + + + +
PerformException + if currently displayed activity is root activity, since pressing back + button would result in application closing. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + boolean + + registerIdlingResources + (IdlingResource... resources) +

+
+
+ + + +
+
+ + + + +

Registers one or more IdlingResources with the framework. It is expected, although not + strictly required, that this method will be called at test setup time prior to any interaction + with the application under test. When registering more than one resource, ensure that each has + a unique name. If any of the given resources is already registered, a warning is logged.

+ +
+
+ + + + +
+

+ + public + static + + + + void + + registerLooperAsIdlingResource + (Looper looper, boolean considerWaitIdle) +

+
+
+ + + +
+
+ + + + +

Registers a Looper for idle checking with the framework. This is intended for use with + non-UI thread loopers. + +

This method allows the caller to consider Thread.State.WAIT to be 'idle'. + +

This is useful in the case where a looper is sending a message to the UI thread + synchronously through a wait/notify mechanism.

+
+
Throws
+ + + + +
IllegalArgumentException + if looper is the main looper. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + void + + registerLooperAsIdlingResource + (Looper looper) +

+
+
+ + + +
+
+ + + + +

Registers a Looper for idle checking with the framework. This is intended for use with + non-UI thread loopers.

+
+
Throws
+ + + + +
IllegalArgumentException + if looper is the main looper. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + void + + setFailureHandler + (FailureHandler failureHandler) +

+
+
+ + + +
+
+ + + + +

Changes the default FailureHandler to the given one. +

+ +
+
+ + + + +
+

+ + public + static + + + + boolean + + unregisterIdlingResources + (IdlingResource... resources) +

+
+
+ + + +
+
+ + + + +

Unregisters one or more IdlingResources. If any of the given resources are not already + registered, a warning is logged.

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/EspressoException.html b/docs/html/reference/android/support/test/espresso/EspressoException.html new file mode 100644 index 00000000000..b2dbe42fd75 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/EspressoException.html @@ -0,0 +1,936 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EspressoException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

EspressoException

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.EspressoException
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Used for identifying an exception as coming from the Espresso framework. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/FailureHandler.html b/docs/html/reference/android/support/test/espresso/FailureHandler.html new file mode 100644 index 00000000000..c79bcb4e0f7 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/FailureHandler.html @@ -0,0 +1,950 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +FailureHandler | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

FailureHandler

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.FailureHandler
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Handles failures that happen during test execution. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + void + + handle(Throwable error, Matcher<View> viewMatcher) + +
+ Handle the given error in a manner that makes sense to the environment in which the test is + executed (e.g. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + void + + handle + (Throwable error, Matcher<View> viewMatcher) +

+
+
+ + + +
+
+ + + + +

Handle the given error in a manner that makes sense to the environment in which the test is + executed (e.g. take a screenshot, output extra debug info, etc). Upon handling, most handlers + will choose to propagate the error. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/GraphHolder.html b/docs/html/reference/android/support/test/espresso/GraphHolder.html new file mode 100644 index 00000000000..0ab18fa728c --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/GraphHolder.html @@ -0,0 +1,1227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GraphHolder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

GraphHolder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.GraphHolder
+ + + + + + + +
+ + +

Class Overview

+

Holds Espresso's ObjectGraph. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + <T> + T + + espressoGet(Class<T> type) + +
+ + + + static + <T> + T + + espressoInject(T instance) + +
+ + + + static + + void + + initialize(Object... modules) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + T + + espressoGet + (Class<T> type) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + T + + espressoInject + (T instance) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + void + + initialize + (Object... modules) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/IdlingPolicies.html b/docs/html/reference/android/support/test/espresso/IdlingPolicies.html new file mode 100644 index 00000000000..b1173886783 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/IdlingPolicies.html @@ -0,0 +1,1372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IdlingPolicies | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

IdlingPolicies

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.IdlingPolicies
+ + + + + + + +
+ + +

Class Overview

+

Allows users fine grain control over idling policies. + + Espresso's default idling policies are suitable for most usecases - however + certain execution environments (like the ARM emulator) might be very slow. + This class allows users the ability to adjust defaults to sensible values + for their environments. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + IdlingPolicy + + getDynamicIdlingResourceErrorPolicy() + +
+ + + + static + + IdlingPolicy + + getDynamicIdlingResourceWarningPolicy() + +
+ + + + static + + IdlingPolicy + + getMasterIdlingPolicy() + +
+ + + + static + + void + + setIdlingResourceTimeout(long timeout, TimeUnit unit) + +
+ Updates the IdlingPolicy used by IdlingResourceRegistry to determine when IdlingResources + timeout. + + + +
+ +
+ + + + static + + void + + setMasterPolicyTimeout(long timeout, TimeUnit unit) + +
+ Updates the IdlingPolicy used in UiController.loopUntil to detect AppNotIdleExceptions. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + IdlingPolicy + + getDynamicIdlingResourceErrorPolicy + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + IdlingPolicy + + getDynamicIdlingResourceWarningPolicy + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + IdlingPolicy + + getMasterIdlingPolicy + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + void + + setIdlingResourceTimeout + (long timeout, TimeUnit unit) +

+
+
+ + + +
+
+ + + + +

Updates the IdlingPolicy used by IdlingResourceRegistry to determine when IdlingResources + timeout.

+
+
Parameters
+ + + + + + + +
timeout + the timeout before an IdlingResourceTimeoutException is created.
unit + the unit of the timeout value. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + void + + setMasterPolicyTimeout + (long timeout, TimeUnit unit) +

+
+
+ + + +
+
+ + + + +

Updates the IdlingPolicy used in UiController.loopUntil to detect AppNotIdleExceptions.

+
+
Parameters
+ + + + + + + +
timeout + the timeout before an AppNotIdleException is created.
unit + the unit of the timeout value. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/IdlingPolicy.html b/docs/html/reference/android/support/test/espresso/IdlingPolicy.html new file mode 100644 index 00000000000..7e3a538bfe0 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/IdlingPolicy.html @@ -0,0 +1,1264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IdlingPolicy | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

IdlingPolicy

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.IdlingPolicy
+ + + + + + + +
+ + +

Class Overview

+

Allows users to control idling idleTimeouts in Espresso. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + long + + getIdleTimeout() + +
+ The amount of time the policy allows a resource to be non-idle. + + + +
+ +
+ + + + + + TimeUnit + + getIdleTimeoutUnit() + +
+ The unit for {@linkgetIdleTimeout }. + + + +
+ +
+ + + + + + void + + handleTimeout(List<String> busyResources, String message) + +
+ Invoked when the idle idleTimeout has been exceeded. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + long + + getIdleTimeout + () +

+
+
+ + + +
+
+ + + + +

The amount of time the policy allows a resource to be non-idle. +

+ +
+
+ + + + +
+

+ + public + + + + + TimeUnit + + getIdleTimeoutUnit + () +

+
+
+ + + +
+
+ + + + +

The unit for {@linkgetIdleTimeout }. +

+ +
+
+ + + + +
+

+ + public + + + + + void + + handleTimeout + (List<String> busyResources, String message) +

+
+
+ + + +
+
+ + + + +

Invoked when the idle idleTimeout has been exceeded.

+
+
Parameters
+ + + + + + + +
busyResources + the resources that are not idle.
message + an additional message to include in an exception. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/IdlingResource.ResourceCallback.html b/docs/html/reference/android/support/test/espresso/IdlingResource.ResourceCallback.html new file mode 100644 index 00000000000..0bf235d4a46 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/IdlingResource.ResourceCallback.html @@ -0,0 +1,887 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IdlingResource.ResourceCallback | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + interface +

IdlingResource.ResourceCallback

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.IdlingResource.ResourceCallback
+ + + + + + + +
+ + +

Class Overview

+

Registered by an IdlingResource to notify Espresso of a transition to idle. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + void + + onTransitionToIdle() + +
+ Called when the resource goes from busy to idle. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + void + + onTransitionToIdle + () +

+
+
+ + + +
+
+ + + + +

Called when the resource goes from busy to idle. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/IdlingResource.html b/docs/html/reference/android/support/test/espresso/IdlingResource.html new file mode 100644 index 00000000000..7c6a83aa8d7 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/IdlingResource.html @@ -0,0 +1,1106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IdlingResource | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

IdlingResource

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.IdlingResource
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Represents a resource of an application under test which can cause asynchronous background work + to happen during test execution (e.g. an intent service that processes a button click). By + default, Espresso synchronizes all view operations with the UI thread as well as + AsyncTasks; however, it has no way of doing so with "hand-made" resources. In such cases, test + authors can register the custom resource and Espresso will wait for the resource to + become idle prior to executing a view operation. +

+ Important Note: it is assumed that the resource stays idle most of the time. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + interfaceIdlingResource.ResourceCallback + Registered by an IdlingResource to notify Espresso of a transition to idle.  + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + String + + getName() + +
+ Returns the name of the resources (used for logging and idempotency of registration). + + + +
+ +
+ abstract + + + + + boolean + + isIdleNow() + +
+ Returns true if resource is currently idle. + + + +
+ +
+ abstract + + + + + void + + registerIdleTransitionCallback(IdlingResource.ResourceCallback callback) + +
+ Registers the given IdlingResource.ResourceCallback with the resource. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + String + + getName + () +

+
+
+ + + +
+
+ + + + +

Returns the name of the resources (used for logging and idempotency of registration). +

+ +
+
+ + + + +
+

+ + public + + + abstract + + boolean + + isIdleNow + () +

+
+
+ + + +
+
+ + + + +

Returns true if resource is currently idle. Espresso will always call this + method from the main thread, therefore it should be non-blocking and return immediately. +

+ +
+
+ + + + +
+

+ + public + + + abstract + + void + + registerIdleTransitionCallback + (IdlingResource.ResourceCallback callback) +

+
+
+ + + +
+
+ + + + +

Registers the given IdlingResource.ResourceCallback with the resource. Espresso will call this method: +

    +
  • with its implementation of IdlingResource.ResourceCallback so it can be notified asynchronously + that your resource is idle +
  • from the main thread, but you are free to execute the callback's onTransitionToIdle from + any thread +
  • once (when it is initially given a reference to your IdlingResource) +
+
+ You only need to call this upon transition from busy to idle - if the resource is already idle + when the method is called invoking the call back is optional and has no significant impact. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/IdlingResourceTimeoutException.html b/docs/html/reference/android/support/test/espresso/IdlingResourceTimeoutException.html new file mode 100644 index 00000000000..a936b74e219 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/IdlingResourceTimeoutException.html @@ -0,0 +1,1460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IdlingResourceTimeoutException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

IdlingResourceTimeoutException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.IdlingResourceTimeoutException
+ + + + + + + +
+ + +

Class Overview

+

Indicates that an IdlingResource, which has been registered with the framework, has not + idled within the allowed time. + + Since it is not safe to proceed with test execution while the registered resource is busy (as it + is likely to cause inconsistent results in the test), this is an unrecoverable error. The test + author should verify that the IdlingResource interface has been implemented correctly. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + IdlingResourceTimeoutException(List<String> resourceNames) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + IdlingResourceTimeoutException + (List<String> resourceNames) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/InjectEventSecurityException.html b/docs/html/reference/android/support/test/espresso/InjectEventSecurityException.html new file mode 100644 index 00000000000..dd1b7e86f55 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/InjectEventSecurityException.html @@ -0,0 +1,1527 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +InjectEventSecurityException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

InjectEventSecurityException

+ + + + + + + + + + + + + extends Exception
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳android.support.test.espresso.InjectEventSecurityException
+ + + + + + + +
+ + +

Class Overview

+

An checked Exception indicating that event injection failed with a + SecurityException. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + InjectEventSecurityException(String message) + +
+ + + + + + + + InjectEventSecurityException(Throwable cause) + +
+ + + + + + + + InjectEventSecurityException(String message, Throwable cause) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + InjectEventSecurityException + (String message) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + + + InjectEventSecurityException + (Throwable cause) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + + + InjectEventSecurityException + (String message, Throwable cause) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/NoActivityResumedException.html b/docs/html/reference/android/support/test/espresso/NoActivityResumedException.html new file mode 100644 index 00000000000..2e611a82a67 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/NoActivityResumedException.html @@ -0,0 +1,1503 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +NoActivityResumedException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

NoActivityResumedException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.NoActivityResumedException
+ + + + + + + +
+ + +

Class Overview

+

An exception which indicates that there are no activities in stage RESUMED. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + NoActivityResumedException(String description) + +
+ + + + + + + + NoActivityResumedException(String description, Throwable cause) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + NoActivityResumedException + (String description) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + + + NoActivityResumedException + (String description, Throwable cause) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/NoMatchingRootException.html b/docs/html/reference/android/support/test/espresso/NoMatchingRootException.html new file mode 100644 index 00000000000..97f40699e4c --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/NoMatchingRootException.html @@ -0,0 +1,1454 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +NoMatchingRootException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

NoMatchingRootException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.NoMatchingRootException
+ + + + + + + +
+ + +

Class Overview

+

Indicates that a given matcher did not match any Roots (windows) from those that are + currently available. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + NoMatchingRootException + + create(Matcher<Root> rootMatcher, List<Root> roots) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + NoMatchingRootException + + create + (Matcher<Root> rootMatcher, List<Root> roots) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/NoMatchingViewException.Builder.html b/docs/html/reference/android/support/test/espresso/NoMatchingViewException.Builder.html new file mode 100644 index 00000000000..b68ea180f1a --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/NoMatchingViewException.Builder.html @@ -0,0 +1,1485 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +NoMatchingViewException.Builder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

NoMatchingViewException.Builder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.NoMatchingViewException.Builder
+ + + + + + + +
+ + +

Class Overview

+

Builder for NoMatchingViewException.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + NoMatchingViewException.Builder() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + NoMatchingViewException + + build() + +
+ + + + + + NoMatchingViewException.Builder + + from(NoMatchingViewException exception) + +
+ + + + + + NoMatchingViewException.Builder + + includeViewHierarchy(boolean includeViewHierarchy) + +
+ + + + + + NoMatchingViewException.Builder + + withAdapterViewWarning(Optional<String> adapterViewWarning) + +
+ + + + + + NoMatchingViewException.Builder + + withAdapterViews(List<View> adapterViews) + +
+ + + + + + NoMatchingViewException.Builder + + withRootView(View rootView) + +
+ + + + + + NoMatchingViewException.Builder + + withViewMatcher(Matcher<? super View> viewMatcher) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + NoMatchingViewException.Builder + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + NoMatchingViewException + + build + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + NoMatchingViewException.Builder + + from + (NoMatchingViewException exception) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + NoMatchingViewException.Builder + + includeViewHierarchy + (boolean includeViewHierarchy) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + NoMatchingViewException.Builder + + withAdapterViewWarning + (Optional<String> adapterViewWarning) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + NoMatchingViewException.Builder + + withAdapterViews + (List<View> adapterViews) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + NoMatchingViewException.Builder + + withRootView + (View rootView) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + NoMatchingViewException.Builder + + withViewMatcher + (Matcher<? super View> viewMatcher) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/NoMatchingViewException.html b/docs/html/reference/android/support/test/espresso/NoMatchingViewException.html new file mode 100644 index 00000000000..1141e9dcf97 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/NoMatchingViewException.html @@ -0,0 +1,1503 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +NoMatchingViewException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

NoMatchingViewException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.NoMatchingViewException
+ + + + + + + +
+ + +

Class Overview

+

Indicates that a given matcher did not match any elements in the view hierarchy. +

+ Contains details about the matcher and the current view hierarchy to aid in debugging. +

+

+ Since this is usually an unrecoverable error this exception is a runtime exception. +

+

+ References to the view and failing matcher are purposefully not included in the state of this + object - since it will most likely be created on the UI thread and thrown on the instrumentation + thread, it would be invalid to touch the view on the instrumentation thread. Also the view + hierarchy may have changed since exception creation (leading to more confusion). +

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classNoMatchingViewException.Builder + Builder for NoMatchingViewException.  + + + +
+ + + + + + + + + + +
Public Methods
+ + + + + + String + + getViewMatcherDescription() + +
+ Returns a string description of the ViewMatcher that did not match any view + in the hierarchy. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + String + + getViewMatcherDescription + () +

+
+
+ + + +
+
+ + + + +

Returns a string description of the ViewMatcher that did not match any view + in the hierarchy. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/PerformException.Builder.html b/docs/html/reference/android/support/test/espresso/PerformException.Builder.html new file mode 100644 index 00000000000..5c4d87db618 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/PerformException.Builder.html @@ -0,0 +1,1390 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PerformException.Builder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

PerformException.Builder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.PerformException.Builder
+ + + + + + + +
+ + +

Class Overview

+

Builder for PerformException. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + PerformException.Builder() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + PerformException + + build() + +
+ + + + + + PerformException.Builder + + from(PerformException instance) + +
+ + + + + + PerformException.Builder + + withActionDescription(String actionDescription) + +
+ + + + + + PerformException.Builder + + withCause(Throwable cause) + +
+ + + + + + PerformException.Builder + + withViewDescription(String viewDescription) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + PerformException.Builder + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + PerformException + + build + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + PerformException.Builder + + from + (PerformException instance) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + PerformException.Builder + + withActionDescription + (String actionDescription) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + PerformException.Builder + + withCause + (Throwable cause) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + PerformException.Builder + + withViewDescription + (String viewDescription) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/PerformException.html b/docs/html/reference/android/support/test/espresso/PerformException.html new file mode 100644 index 00000000000..fe45800cdf7 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/PerformException.html @@ -0,0 +1,1535 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PerformException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

PerformException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + implements + + EspressoException + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.espresso.PerformException
+ + + + + + + +
+ + +

Class Overview

+

Indicates that an exception occurred while performing a ViewAction on the UI thread. + + A description of the ViewAction, the view being performed on and the cause are included + in the error. Note: FailureHandlers can mutate the exception later to make it more user + friendly. + + This is generally not recoverable so it is thrown on the instrumentation thread. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classPerformException.Builder + Builder for PerformException.  + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + String + + getActionDescription() + +
+ + + + + + String + + getViewDescription() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + String + + getActionDescription + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + String + + getViewDescription + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/Root.Builder.html b/docs/html/reference/android/support/test/espresso/Root.Builder.html new file mode 100644 index 00000000000..d910ddffcdf --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/Root.Builder.html @@ -0,0 +1,1290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Root.Builder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

Root.Builder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.Root.Builder
+ + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + Root.Builder() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + Root + + build() + +
+ + + + + + Root.Builder + + withDecorView(View view) + +
+ + + + + + Root.Builder + + withWindowLayoutParams(WindowManager.LayoutParams windowLayoutParams) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + Root.Builder + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + Root + + build + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Root.Builder + + withDecorView + (View view) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Root.Builder + + withWindowLayoutParams + (WindowManager.LayoutParams windowLayoutParams) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/Root.html b/docs/html/reference/android/support/test/espresso/Root.html new file mode 100644 index 00000000000..75fd2bdaf8d --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/Root.html @@ -0,0 +1,1259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Root | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

Root

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.Root
+ + + + + + + +
+ + +

Class Overview

+

Represents a root view in the application and optionally the layout params of the window holding + it. + + This class is used internally to determine which view root to run user provided matchers against + it is not part of the public api. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classRoot.Builder +   + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + View + + getDecorView() + +
+ + + + + + Optional<WindowManager.LayoutParams> + + getWindowLayoutParams() + +
+ + + + + + String + + toString() + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + View + + getDecorView + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Optional<WindowManager.LayoutParams> + + getWindowLayoutParams + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + String + + toString + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/UiController.html b/docs/html/reference/android/support/test/espresso/UiController.html new file mode 100644 index 00000000000..b1b8f7e3016 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/UiController.html @@ -0,0 +1,1205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiController | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

UiController

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.UiController
+ + + + + + + +
+ + +

Class Overview

+

Provides base-level UI operations (such as injection of MotionEvents) that can be used to + build user actions such as clicks, scrolls, swipes, etc. This replaces parts of the android + Instrumentation class that provides similar functionality. However, it provides a more advanced + synchronization mechanism for test actions. The key differentiators are: +

    +
  • test actions are assumed to be called on the main thread +
  • after a test action is initiated, execution blocks until all messages in the main message + queue have been cleared. +
+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + boolean + + injectKeyEvent(KeyEvent event) + +
+ Injects a key event into the application. + + + +
+ +
+ abstract + + + + + boolean + + injectMotionEvent(MotionEvent event) + +
+ Injects a motion event into the application. + + + +
+ +
+ abstract + + + + + boolean + + injectString(String str) + +
+ Types a string into the application using series of KeyEvents. + + + +
+ +
+ abstract + + + + + void + + loopMainThreadForAtLeast(long millisDelay) + +
+ Loops the main thread for a specified period of time. + + + +
+ +
+ abstract + + + + + void + + loopMainThreadUntilIdle() + +
+ Loops the main thread until the application goes idle. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + boolean + + injectKeyEvent + (KeyEvent event) +

+
+
+ + + +
+
+ + + + +

Injects a key event into the application.

+
+
Parameters
+ + + + +
event + the (non-null!) event to inject
+
+
+
Returns
+
  • true if the event was injected, false otherwise
+
+
+
Throws
+ + + + +
InjectEventSecurityException + if the event couldn't be injected because it would + interact with another application. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + boolean + + injectMotionEvent + (MotionEvent event) +

+
+
+ + + +
+
+ + + + +

Injects a motion event into the application.

+
+
Parameters
+ + + + +
event + the (non-null!) event to inject
+
+
+
Returns
+
  • true if the event was injected, false otherwise
+
+
+
Throws
+ + + + +
InjectEventSecurityException + if the event couldn't be injected because it would + interact with another application. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + boolean + + injectString + (String str) +

+
+
+ + + +
+
+ + + + +

Types a string into the application using series of KeyEvents. It is up to the + implementor to decide how to map the string to KeyEvent objects. if you need specific + control over the key events generated use injectKeyEvent(KeyEvent).

+
+
Parameters
+ + + + +
str + the (non-null!) string to type
+
+
+
Returns
+
  • true if the string was injected, false otherwise
+
+
+
Throws
+ + + + +
InjectEventSecurityException + if the events couldn't be injected because it would + interact with another application. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + void + + loopMainThreadForAtLeast + (long millisDelay) +

+
+
+ + + +
+
+ + + + +

Loops the main thread for a specified period of time. + + Control may not return immediately, instead it'll return after the time has passed and the + queue is in an idle state again.

+
+
Parameters
+ + + + +
millisDelay + time to spend in looping the main thread +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + void + + loopMainThreadUntilIdle + () +

+
+
+ + + +
+
+ + + + +

Loops the main thread until the application goes idle. + + An empty task is immediately inserted into the task queue to ensure that if we're idle at this + moment we'll return instantly. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/ViewAction.html b/docs/html/reference/android/support/test/espresso/ViewAction.html new file mode 100644 index 00000000000..5e41d8c3f24 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/ViewAction.html @@ -0,0 +1,1230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

ViewAction

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.ViewAction
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Responsible for performing an interaction on the given View element.
+

+ This is part of the test framework public API - developers are free to write their own ViewAction + implementations when necessary. When implementing a new ViewAction, follow these rules: +

    +
  • Inject motion events or key events via the UiController to simulate user interactions. +
  • Do not mutate the view directly via setter methods and other state changing methods on the + view parameter. +
  • Do not throw AssertionErrors. Assertions belong in ViewAssertion classes. +
  • View action code will executed on the UI thread, therefore you should not block, perform + sleeps, or perform other expensive computations. +
  • The test framework will wait for the UI thread to be idle both before and after perform() is + called. This means that the action is guaranteed to be synchronized with any other view + operations. +
  • Downcasting the View object to an expected subtype is allowed, so long as the object + expresses the subtype matches the constraints as specified in getConstraints. +
+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ 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 Methods

+ + + + + +
+

+ + public + + + abstract + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + abstract + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/ViewAssertion.html b/docs/html/reference/android/support/test/espresso/ViewAssertion.html new file mode 100644 index 00000000000..848a4165d79 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/ViewAssertion.html @@ -0,0 +1,917 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewAssertion | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

ViewAssertion

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.ViewAssertion
+ + + + + + + +
+ + +

Class Overview

+

Responsible for performing assertions on a View element.
+

+ This is considered part of the test framework public API - developers are free to write their own + assertions as long as they meet the following requirements: +

    +
  • Do not mutate the passed in view. +
  • Throw junit.framework.AssertionError when the view assertion does not hold. +
  • Implementation runs on the UI thread - so it should not do any blocking operations +
  • Downcasting the view to a specific type is allowed, provided there is a test that view is an + instance of that type before downcasting. If not, an AssertionError should be thrown. +
  • It is encouraged to access non-mutating methods on the view to perform assertion. +
+
+

+ Strongly consider using a existing ViewAssertion via the ViewAssertions utility class before + writing your own assertion. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + void + + check(View view, NoMatchingViewException noViewFoundException) + +
+ Checks the state of the given view (if such a view is present). + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + void + + check + (View view, NoMatchingViewException noViewFoundException) +

+
+
+ + + +
+
+ + + + +

Checks the state of the given view (if such a view is present).

+
+
Parameters
+ + + + + + + +
view + the view, if one was found during the view interaction or null if it was not + (which may be an acceptable option for an assertion)
noViewFoundException + an exception detailing why the view could not be found or null if + the view was found +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/ViewFinder.html b/docs/html/reference/android/support/test/espresso/ViewFinder.html new file mode 100644 index 00000000000..7bf1284a96d --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/ViewFinder.html @@ -0,0 +1,966 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewFinder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

ViewFinder

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.ViewFinder
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Uses matchers to locate particular views within the view hierarchy. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + View + + getView() + +
+ Immediately locates a single view within the provided view hierarchy. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + View + + getView + () +

+
+
+ + + +
+
+ + + + +

Immediately locates a single view within the provided view hierarchy. + + If multiple views match, or if no views match the appropriate exception is thrown.

+
+
Returns
+
  • A singular view which matches the matcher we were constructed with.
+
+
+
Throws
+ + + + + + + +
AmbiguousViewMatcherException + when multiple views match
NoMatchingViewException + when no views match. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/ViewInteraction.html b/docs/html/reference/android/support/test/espresso/ViewInteraction.html new file mode 100644 index 00000000000..b771faf7382 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/ViewInteraction.html @@ -0,0 +1,1355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewInteraction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ViewInteraction

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.ViewInteraction
+ + + + + + + +
+ + +

Class Overview

+

Provides the primary interface for test authors to perform actions or asserts on views. +

+ Each interaction is associated with a view identified by a view matcher. All view actions and + asserts are performed on the UI thread (thus ensuring sequential execution). The same goes for + retrieval of views (this is done to ensure that view state is "fresh" prior to execution of each + operation). +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + ViewInteraction + + check(ViewAssertion viewAssert) + +
+ Checks the given ViewAssertion on the the view selected by the current view matcher. + + + +
+ +
+ + + + + + ViewInteraction + + inRoot(Matcher<Root> rootMatcher) + +
+ Makes this ViewInteraction scoped to the root selected by the given root matcher. + + + +
+ +
+ + + + + + ViewInteraction + + perform(ViewAction... viewActions) + +
+ Performs the given action(s) on the view selected by the current view matcher. + + + +
+ +
+ + + + + + ViewInteraction + + withFailureHandler(FailureHandler failureHandler) + +
+ Replaces the default failure handler (@see Espresso.setFailureHandler) with a custom + failurehandler for this particular interaction. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + ViewInteraction + + check + (ViewAssertion viewAssert) +

+
+
+ + + +
+
+ + + + +

Checks the given ViewAssertion on the the view selected by the current view matcher.

+
+
Parameters
+ + + + +
viewAssert + the assertion to check.
+
+
+
Returns
+
  • this interaction for further perform/verification calls. +
+
+ +
+
+ + + + +
+

+ + public + + + + + ViewInteraction + + inRoot + (Matcher<Root> rootMatcher) +

+
+
+ + + +
+
+ + + + +

Makes this ViewInteraction scoped to the root selected by the given root matcher. +

+ +
+
+ + + + +
+

+ + public + + + + + ViewInteraction + + perform + (ViewAction... viewActions) +

+
+
+ + + +
+
+ + + + +

Performs the given action(s) on the view selected by the current view matcher. If more than one + action is provided, actions are executed in the order provided with precondition checks running + prior to each action.

+
+
Parameters
+ + + + +
viewActions + one or more actions to execute.
+
+
+
Returns
+
  • this interaction for further perform/verification calls. +
+
+ +
+
+ + + + +
+

+ + public + + + + + ViewInteraction + + withFailureHandler + (FailureHandler failureHandler) +

+
+
+ + + +
+
+ + + + +

Replaces the default failure handler (@see Espresso.setFailureHandler) with a custom + failurehandler for this particular interaction.

+
+
Parameters
+ + + + +
failureHandler + a non-null failurehandler to use to report failures.
+
+
+
Returns
+
  • this interaction for further perform/verification calls. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/AdapterDataLoaderAction.html b/docs/html/reference/android/support/test/espresso/action/AdapterDataLoaderAction.html new file mode 100644 index 00000000000..3578e163a21 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/AdapterDataLoaderAction.html @@ -0,0 +1,1499 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AdapterDataLoaderAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

AdapterDataLoaderAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.AdapterDataLoaderAction
+ + + + + + + +
+ + +

Class Overview

+

Forces an AdapterView to ensure that the data matching a provided data matcher + is loaded into the current view hierarchy. + +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + AdapterDataLoaderAction(Matcher<Object> dataToLoadMatcher, Optional<Integer> atPosition, AdapterViewProtocol adapterViewProtocol) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + AdapterViewProtocol.AdaptedData + + getAdaptedData() + +
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + AdapterDataLoaderAction + (Matcher<Object> dataToLoadMatcher, Optional<Integer> atPosition, AdapterViewProtocol adapterViewProtocol) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + AdapterViewProtocol.AdaptedData + + getAdaptedData + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.Builder.html b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.Builder.html new file mode 100644 index 00000000000..373c6914930 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.Builder.html @@ -0,0 +1,1339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AdapterViewProtocol.AdaptedData.Builder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

AdapterViewProtocol.AdaptedData.Builder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.AdapterViewProtocol.AdaptedData.Builder
+ + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + AdapterViewProtocol.AdaptedData.Builder() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + AdapterViewProtocol.AdaptedData + + build() + +
+ + + + + + AdapterViewProtocol.AdaptedData.Builder + + withData(Object data) + +
+ + + + + + AdapterViewProtocol.AdaptedData.Builder + + withDataFunction(AdapterViewProtocol.DataFunction dataFunction) + +
+ + + + + + AdapterViewProtocol.AdaptedData.Builder + + withOpaqueToken(Object opaqueToken) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + AdapterViewProtocol.AdaptedData.Builder + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + AdapterViewProtocol.AdaptedData + + build + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AdapterViewProtocol.AdaptedData.Builder + + withData + (Object data) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AdapterViewProtocol.AdaptedData.Builder + + withDataFunction + (AdapterViewProtocol.DataFunction dataFunction) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AdapterViewProtocol.AdaptedData.Builder + + withOpaqueToken + (Object opaqueToken) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.html b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.html new file mode 100644 index 00000000000..9c28131745f --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.html @@ -0,0 +1,1335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AdapterViewProtocol.AdaptedData | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

AdapterViewProtocol.AdaptedData

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.AdapterViewProtocol.AdaptedData
+ + + + + + + +
+ + +

Class Overview

+

A holder that associates a data object from an AdapterView with a token the + AdapterViewProtocol can use to force that data object to be rendered as a child or deeper + descendant of the adapter view. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classAdapterViewProtocol.AdaptedData.Builder +   + + + +
+ + + + + + + + + + + + + + + + + + +
Fields
+ public + + final + Objectdata + + This field is deprecated. + use getData() instead. + + + + +
+ public + + final + ObjectopaqueToken + A token the implementor of AdapterViewProtocol can use to force the adapterView to display + this data object as a child or deeper descendant in it. + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + Object + + getData() + +
+ + + + + + String + + toString() + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Fields

+ + + + + + +
+

+ + public + + final + Object + + data +

+
+ + + + +
+
+ + + +

+

+ This field is deprecated.
+ use getData() instead. + +

+

One of the objects the AdapterView is exposing to the user.

+ + +
+
+ + + + + +
+

+ + public + + final + Object + + opaqueToken +

+
+ + + + +
+
+ + + + +

A token the implementor of AdapterViewProtocol can use to force the adapterView to display + this data object as a child or deeper descendant in it. Equal opaqueToken point to the same + data object on the AdapterView. +

+ + +
+
+ + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + Object + + getData + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + String + + toString + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.DataFunction.html b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.DataFunction.html new file mode 100644 index 00000000000..2d4f4651f4a --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.DataFunction.html @@ -0,0 +1,884 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AdapterViewProtocol.DataFunction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + interface +

AdapterViewProtocol.DataFunction

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.action.AdapterViewProtocol.DataFunction
+ + + + + + + +
+ + +

Class Overview

+

A custom function that is applied when getData() is executed.

+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + Object + + getData() + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + Object + + getData + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.html b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.html new file mode 100644 index 00000000000..1fa8d074eb1 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocol.html @@ -0,0 +1,1259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AdapterViewProtocol | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

AdapterViewProtocol

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.action.AdapterViewProtocol
+ + + + + + + +
+ + +

Class Overview

+

A sadly necessary layer of indirection to interact with AdapterViews. +

+ Generally any subclass should respect the contracts and behaviors of its superclass. Otherwise + it becomes impossible to work generically with objects that all claim to share a supertype - you + need special cases to perform the same operation 'owned' by the supertype for each sub-type. The + 'is - a' relationship is broken. +

+ +

+ Android breaks the Liskov substitution principal with ExpandableListView - you can't use + getAdapter(), getItemAtPosition(), and other methods common to AdapterViews on an + ExpandableListView because an ExpandableListView isn't an adapterView - they just share a lot of + code. +

+ +

+ This interface exists to work around this wart (which sadly is copied in other projects too) and + lets the implementor translate Espresso's needs and manipulations of the AdapterView into calls + that make sense for the given subtype and context. +

+ +

+ If you have to implement this to talk to widgets your own project defines - I'm sorry. +

+ +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classAdapterViewProtocol.AdaptedData + A holder that associates a data object from an AdapterView with a token the + AdapterViewProtocol can use to force that data object to be rendered as a child or deeper + descendant of the adapter view.  + + + +
+ + + + + interfaceAdapterViewProtocol.DataFunction + A custom function that is applied when getData() is executed.  + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + Iterable<AdapterViewProtocol.AdaptedData> + + getDataInAdapterView(AdapterView<? extends Adapter> adapterView) + +
+ Returns all data this AdapterViewProtocol can find within the given AdapterView. + + + +
+ +
+ abstract + + + + + Optional<AdapterViewProtocol.AdaptedData> + + getDataRenderedByView(AdapterView<? extends Adapter> adapterView, View descendantView) + +
+ Returns the data object this particular view is rendering if possible. + + + +
+ +
+ abstract + + + + + boolean + + isDataRenderedWithinAdapterView(AdapterView<? extends Adapter> adapterView, AdapterViewProtocol.AdaptedData adaptedData) + +
+ Indicates whether or not there now exists a descendant view within adapterView that + is rendering this data. + + + +
+ +
+ abstract + + + + + void + + makeDataRenderedWithinAdapterView(AdapterView<? extends Adapter> adapterView, AdapterViewProtocol.AdaptedData data) + +
+ Requests that a particular piece of data held in this AdapterView is actually rendered by it. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + Iterable<AdapterViewProtocol.AdaptedData> + + getDataInAdapterView + (AdapterView<? extends Adapter> adapterView) +

+
+
+ + + +
+
+ + + + +

Returns all data this AdapterViewProtocol can find within the given AdapterView. + +

+ Any AdaptedData returned by this method can be passed to makeDataRenderedWithinView and the + implementation should make the AdapterView bring that data item onto the screen. +

+
+
Parameters
+ + + + +
adapterView + the AdapterView we want to interrogate the contents of.
+
+
+
Returns
+
  • an Iterable of AdaptedDatas representing all data the implementation sees in + this view
+
+
+
Throws
+ + + + +
IllegalArgumentException + if the implementation doesn't know how to manipulate the given + adapter view. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + Optional<AdapterViewProtocol.AdaptedData> + + getDataRenderedByView + (AdapterView<? extends Adapter> adapterView, View descendantView) +

+
+
+ + + +
+
+ + + + +

Returns the data object this particular view is rendering if possible. + +

+ Implementations are expected to create a relationship between the data in the AdapterView and + the descendant views of the AdapterView that obeys the following conditions: +

+ +
    +
  • For each descendant view there exists either 0 or 1 data objects it is rendering.
  • +
  • For each data object the AdapterView there exists either 0 or 1 descendant views which + claim to be rendering it.
  • +
+ +

For example - if a PersonObject is rendered into:

+ + LinearLayout + ImageView picture + TextView firstName + TextView lastName + + +

+ It would be expected that getDataRenderedByView(adapter, LinearLayout) would return the + PersonObject. If it were called instead with the TextView or ImageView it would return + Object.absent(). +

+
+
Parameters
+ + + + + + + +
adapterView + the adapterview hosting the data.
descendantView + a view which is a child, grand-child, or deeper descendant of adapterView
+
+
+
Returns
+
  • an optional data object the descendant view is rendering.
+
+
+
Throws
+ + + + +
IllegalArgumentException + if this protocol cannot interrogate this class of adapterView +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + boolean + + isDataRenderedWithinAdapterView + (AdapterView<? extends Adapter> adapterView, AdapterViewProtocol.AdaptedData adaptedData) +

+
+
+ + + +
+
+ + + + +

Indicates whether or not there now exists a descendant view within adapterView that + is rendering this data.

+
+
Parameters
+ + + + + + + +
adapterView + the AdapterView hosting this data.
adaptedData + the data we are checking the display state for.
+
+
+
Returns
+
  • true if the data is rendered by a view in the adapterView, false otherwise. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + void + + makeDataRenderedWithinAdapterView + (AdapterView<? extends Adapter> adapterView, AdapterViewProtocol.AdaptedData data) +

+
+
+ + + +
+
+ + + + +

Requests that a particular piece of data held in this AdapterView is actually rendered by it. + +

+ After calling this method it expected that there will exist some descendant view of adapterView + for which calling getDataRenderedByView(adapterView, descView).get() == data.data is true. +

+ +

+ Note: this need not happen immediately. EG: an implementor handling ListView may call + listView.smoothScrollToPosition(data.opaqueToken) - which kicks off an animated scroll over + the list to the given position. The animation may be in progress after this call returns. The + only guarantee is that eventually - with no further interaction necessary - this data item + will be rendered as a child or deeper descendant of this AdapterView. +

+
+
Parameters
+ + + + + + + +
adapterView + the adapterView hosting the data.
data + an AdaptedData instance retrieved by a prior call to getDataInAdapterView
+
+
+
Throws
+ + + + +
IllegalArgumentException + if this protocol cannot manipulate adapterView or if data is + not owned by this AdapterViewProtocol. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocols.html b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocols.html new file mode 100644 index 00000000000..4e58f998dcf --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/AdapterViewProtocols.html @@ -0,0 +1,1144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AdapterViewProtocols | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

AdapterViewProtocols

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.AdapterViewProtocols
+ + + + + + + +
+ + +

Class Overview

+

Implementations of AdapterViewProtocol for standard SDK Widgets. + +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + AdapterViewProtocol + + standardProtocol() + +
+ Creates an implementation of AdapterViewProtocol that can work with AdapterViews that do not + break method contracts on AdapterView. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + AdapterViewProtocol + + standardProtocol + () +

+
+
+ + + +
+
+ + + + +

Creates an implementation of AdapterViewProtocol that can work with AdapterViews that do not + break method contracts on AdapterView. + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/CloseKeyboardAction.html b/docs/html/reference/android/support/test/espresso/action/CloseKeyboardAction.html new file mode 100644 index 00000000000..2dc7705188b --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/CloseKeyboardAction.html @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +CloseKeyboardAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

CloseKeyboardAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.CloseKeyboardAction
+ + + + + + + +
+ + +

Class Overview

+

Closes soft keyboard. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + CloseKeyboardAction() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + CloseKeyboardAction + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/CoordinatesProvider.html b/docs/html/reference/android/support/test/espresso/action/CoordinatesProvider.html new file mode 100644 index 00000000000..41c74254590 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/CoordinatesProvider.html @@ -0,0 +1,961 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +CoordinatesProvider | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

CoordinatesProvider

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.action.CoordinatesProvider
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Interface to implement calculation of Coordinates. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + float[] + + calculateCoordinates(View view) + +
+ Calculates coordinates of given view. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + float[] + + calculateCoordinates + (View view) +

+
+
+ + + +
+
+ + + + +

Calculates coordinates of given view.

+
+
Parameters
+ + + + +
view + the View which is used for the calculation.
+
+
+
Returns
+
  • a float[] with x and y values of the calculated coordinates. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/EditorAction.html b/docs/html/reference/android/support/test/espresso/action/EditorAction.html new file mode 100644 index 00000000000..f30461a6c0a --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/EditorAction.html @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EditorAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

EditorAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.EditorAction
+ + + + + + + +
+ + +

Class Overview

+

Performs whatever editor (IME) action is available on a view. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + EditorAction() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + EditorAction + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/EspressoKey.Builder.html b/docs/html/reference/android/support/test/espresso/action/EspressoKey.Builder.html new file mode 100644 index 00000000000..e27e87bc910 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/EspressoKey.Builder.html @@ -0,0 +1,1416 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EspressoKey.Builder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

EspressoKey.Builder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.EspressoKey.Builder
+ + + + + + + +
+ + +

Class Overview

+

Builder for the EspressoKey class. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + EspressoKey.Builder() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + EspressoKey + + build() + +
+ + + + + + EspressoKey.Builder + + withAltPressed(boolean altPressed) + +
+ Sets the ALT_ON meta state of the resulting key. + + + +
+ +
+ + + + + + EspressoKey.Builder + + withCtrlPressed(boolean ctrlPressed) + +
+ On Honeycomb and above, sets the CTRL_ON meta state of the resulting key. + + + +
+ +
+ + + + + + EspressoKey.Builder + + withKeyCode(int keyCode) + +
+ + + + + + EspressoKey.Builder + + withShiftPressed(boolean shiftPressed) + +
+ Sets the SHIFT_ON meta state of the resulting key. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + EspressoKey.Builder + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + EspressoKey + + build + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + EspressoKey.Builder + + withAltPressed + (boolean altPressed) +

+
+
+ + + +
+
+ + + + +

Sets the ALT_ON meta state of the resulting key. +

+ +
+
+ + + + +
+

+ + public + + + + + EspressoKey.Builder + + withCtrlPressed + (boolean ctrlPressed) +

+
+
+ + + +
+
+ + + + +

On Honeycomb and above, sets the CTRL_ON meta state of the resulting key. On Gingerbread and + below, this is a noop. +

+ +
+
+ + + + +
+

+ + public + + + + + EspressoKey.Builder + + withKeyCode + (int keyCode) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + EspressoKey.Builder + + withShiftPressed + (boolean shiftPressed) +

+
+
+ + + +
+
+ + + + +

Sets the SHIFT_ON meta state of the resulting key. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/EspressoKey.html b/docs/html/reference/android/support/test/espresso/action/EspressoKey.html new file mode 100644 index 00000000000..ea5ff706240 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/EspressoKey.html @@ -0,0 +1,1256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EspressoKey | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

EspressoKey

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.EspressoKey
+ + + + + + + +
+ + +

Class Overview

+

Class that wraps the key code and meta state of the desired key press. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classEspressoKey.Builder + Builder for the EspressoKey class.  + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + int + + getKeyCode() + +
+ + + + + + int + + getMetaState() + +
+ + + + + + String + + toString() + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + int + + getKeyCode + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + int + + getMetaState + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + String + + toString + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/GeneralClickAction.html b/docs/html/reference/android/support/test/espresso/action/GeneralClickAction.html new file mode 100644 index 00000000000..95ba1746057 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/GeneralClickAction.html @@ -0,0 +1,1497 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GeneralClickAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

GeneralClickAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.GeneralClickAction
+ + + + + + + +
+ + +

Class Overview

+

Enables clicking on views. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + GeneralClickAction(Tapper tapper, CoordinatesProvider coordinatesProvider, PrecisionDescriber precisionDescriber) + +
+ + + + + + + + GeneralClickAction(Tapper tapper, CoordinatesProvider coordinatesProvider, PrecisionDescriber precisionDescriber, ViewAction rollbackAction) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + GeneralClickAction + (Tapper tapper, CoordinatesProvider coordinatesProvider, PrecisionDescriber precisionDescriber) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + + + GeneralClickAction + (Tapper tapper, CoordinatesProvider coordinatesProvider, PrecisionDescriber precisionDescriber, ViewAction rollbackAction) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/GeneralLocation.html b/docs/html/reference/android/support/test/espresso/action/GeneralLocation.html new file mode 100644 index 00000000000..4adcb05d9e3 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/GeneralLocation.html @@ -0,0 +1,1966 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GeneralLocation | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + enum +

GeneralLocation

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + implements + + CoordinatesProvider + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.action.GeneralLocation
+ + + + + + + +
+ + +

Class Overview

+

Calculates coordinate position for general locations. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
GeneralLocation BOTTOM_CENTER  +   + + + +
GeneralLocation BOTTOM_LEFT  +   + + + +
GeneralLocation BOTTOM_RIGHT  +   + + + +
GeneralLocation CENTER  +   + + + +
GeneralLocation CENTER_LEFT  +   + + + +
GeneralLocation CENTER_RIGHT  +   + + + +
GeneralLocation TOP_CENTER  +   + + + +
GeneralLocation TOP_LEFT  +   + + + +
GeneralLocation TOP_RIGHT  +   + + + +
GeneralLocation VISIBLE_CENTER  +   + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + GeneralLocation + + valueOf(String name) + +
+ + + final + static + + GeneralLocation[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.action.CoordinatesProvider + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + GeneralLocation + + BOTTOM_CENTER +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + BOTTOM_LEFT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + BOTTOM_RIGHT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + CENTER +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + CENTER_LEFT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + CENTER_RIGHT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + TOP_CENTER +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + TOP_LEFT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + TOP_RIGHT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + GeneralLocation + + VISIBLE_CENTER +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + GeneralLocation + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + GeneralLocation[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/GeneralSwipeAction.html b/docs/html/reference/android/support/test/espresso/action/GeneralSwipeAction.html new file mode 100644 index 00000000000..c49b4899a34 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/GeneralSwipeAction.html @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GeneralSwipeAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

GeneralSwipeAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.GeneralSwipeAction
+ + + + + + + +
+ + +

Class Overview

+

Enables swiping across a view. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + GeneralSwipeAction(Swiper swiper, CoordinatesProvider startCoordinatesProvider, CoordinatesProvider endCoordinatesProvider, PrecisionDescriber precisionDescriber) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + GeneralSwipeAction + (Swiper swiper, CoordinatesProvider startCoordinatesProvider, CoordinatesProvider endCoordinatesProvider, PrecisionDescriber precisionDescriber) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/KeyEventAction.html b/docs/html/reference/android/support/test/espresso/action/KeyEventAction.html new file mode 100644 index 00000000000..7fd3bc6089b --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/KeyEventAction.html @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +KeyEventAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

KeyEventAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.KeyEventAction
+ + + + + + + +
+ + +

Class Overview

+

Enables pressing KeyEvents on views. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + KeyEventAction(EspressoKey key) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + KeyEventAction + (EspressoKey key) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/OpenLinkAction.html b/docs/html/reference/android/support/test/espresso/action/OpenLinkAction.html new file mode 100644 index 00000000000..bf0e7d92398 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/OpenLinkAction.html @@ -0,0 +1,1451 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +OpenLinkAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

OpenLinkAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.OpenLinkAction
+ + + + + + + +
+ + +

Class Overview

+

Invokes onClick of a link within a TextView (made with Linkify or via another method). + Why not issue a real click event to the screen? Unfortunately, it does not seem to be possible + (at least using public APIs) to determine the location of the link on the screen. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + OpenLinkAction(Matcher<String> linkTextMatcher, Matcher<Uri> uriMatcher) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + OpenLinkAction + (Matcher<String> linkTextMatcher, Matcher<Uri> uriMatcher) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/PrecisionDescriber.html b/docs/html/reference/android/support/test/espresso/action/PrecisionDescriber.html new file mode 100644 index 00000000000..2f39f7eb278 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/PrecisionDescriber.html @@ -0,0 +1,952 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PrecisionDescriber | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

PrecisionDescriber

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.action.PrecisionDescriber
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Interface to implement size of click area. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + float[] + + describePrecision() + +
+ Different touch target sizes. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + float[] + + describePrecision + () +

+
+
+ + + +
+
+ + + + +

Different touch target sizes.

+
+
Returns
+
  • a float[] with x and y values of size of click area. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Press.html b/docs/html/reference/android/support/test/espresso/action/Press.html new file mode 100644 index 00000000000..6080bc4a78e --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Press.html @@ -0,0 +1,1665 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Press | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + enum +

Press

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + implements + + PrecisionDescriber + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.action.Press
+ + + + + + + +
+ + +

Class Overview

+

Returns different touch target sizes. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Press FINGER  +   + + + +
Press PINPOINT  +   + + + +
Press THUMB  +   + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Press + + valueOf(String name) + +
+ + + final + static + + Press[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.action.PrecisionDescriber + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Press + + FINGER +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Press + + PINPOINT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Press + + THUMB +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Press + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Press[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/ReplaceTextAction.html b/docs/html/reference/android/support/test/espresso/action/ReplaceTextAction.html new file mode 100644 index 00000000000..7ca0ae113ad --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/ReplaceTextAction.html @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ReplaceTextAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ReplaceTextAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.ReplaceTextAction
+ + + + + + + +
+ + +

Class Overview

+

Replaces view text by setting EditTexts text property to given String. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + ReplaceTextAction(String value) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + ReplaceTextAction + (String value) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/ScrollToAction.html b/docs/html/reference/android/support/test/espresso/action/ScrollToAction.html new file mode 100644 index 00000000000..a3633b5dbf1 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/ScrollToAction.html @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ScrollToAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ScrollToAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.ScrollToAction
+ + + + + + + +
+ + +

Class Overview

+

Enables scrolling to the given view. View must be a descendant of a ScrollView. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + ScrollToAction() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + ScrollToAction + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Swipe.html b/docs/html/reference/android/support/test/espresso/action/Swipe.html new file mode 100644 index 00000000000..000fd42aa36 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Swipe.html @@ -0,0 +1,1623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Swipe | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + enum +

Swipe

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + implements + + Swiper + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.action.Swipe
+ + + + + + + +
+ + +

Class Overview

+

Executes different swipe types to given positions. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Swipe FAST  + Swipes quickly between the co-ordinates.  + + + +
Swipe SLOW  + Swipes deliberately slowly between the co-ordinates, to aid in visual debugging.  + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Swipe + + valueOf(String name) + +
+ + + final + static + + Swipe[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.action.Swiper + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Swipe + + FAST +

+
+ + + + +
+
+ + + + +

Swipes quickly between the co-ordinates.

+ + +
+
+ + + + + +
+

+ + public + static + final + Swipe + + SLOW +

+
+ + + + +
+
+ + + + +

Swipes deliberately slowly between the co-ordinates, to aid in visual debugging.

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Swipe + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Swipe[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Swiper.Status.html b/docs/html/reference/android/support/test/espresso/action/Swiper.Status.html new file mode 100644 index 00000000000..e6c4bec33dd --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Swiper.Status.html @@ -0,0 +1,1563 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Swiper.Status | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + final + + enum +

Swiper.Status

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.action.Swiper.Status
+ + + + + + + +
+ + +

Class Overview

+

The result of the swipe. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Swiper.Status FAILURE  + Injecting the event was a complete failure.  + + + +
Swiper.Status SUCCESS  + The swipe action completed successfully.  + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Swiper.Status + + valueOf(String name) + +
+ + + final + static + + Status[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Swiper.Status + + FAILURE +

+
+ + + + +
+
+ + + + +

Injecting the event was a complete failure. +

+ + +
+
+ + + + + +
+

+ + public + static + final + Swiper.Status + + SUCCESS +

+
+ + + + +
+
+ + + + +

The swipe action completed successfully. +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Swiper.Status + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Status[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Swiper.html b/docs/html/reference/android/support/test/espresso/action/Swiper.html new file mode 100644 index 00000000000..cf67b19354b --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Swiper.html @@ -0,0 +1,1003 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Swiper | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

Swiper

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.action.Swiper
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Interface to implement different swipe types. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + enumSwiper.Status + The result of the swipe.  + + + +
+ + + + + + + + + + +
Public Methods
+ abstract + + + + + Swiper.Status + + sendSwipe(UiController uiController, float[] startCoordinates, float[] endCoordinates, float[] precision) + +
+ Swipes from startCoordinates to endCoordinates using the given + uiController to send MotionEvents. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + Swiper.Status + + sendSwipe + (UiController uiController, float[] startCoordinates, float[] endCoordinates, float[] precision) +

+
+
+ + + +
+
+ + + + +

Swipes from startCoordinates to endCoordinates using the given + uiController to send MotionEvents.

+
+
Parameters
+ + + + + + + + + + + + + +
uiController + a UiController to use to send MotionEvents to the screen.
startCoordinates + a float[] with x and y co-ordinates of the start of the swipe.
endCoordinates + a float[] with x and y co-ordinates of the end of the swipe.
precision + a float[] with x and y values of precision of the tap.
+
+
+
Returns
+
  • The status of the swipe. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Tap.html b/docs/html/reference/android/support/test/espresso/action/Tap.html new file mode 100644 index 00000000000..7779cdefb29 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Tap.html @@ -0,0 +1,1665 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Tap | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + enum +

Tap

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + implements + + Tapper + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.action.Tap
+ + + + + + + +
+ + +

Class Overview

+

Executes different click types to given position. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Tap DOUBLE  +   + + + +
Tap LONG  +   + + + +
Tap SINGLE  +   + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Tap + + valueOf(String name) + +
+ + + final + static + + Tap[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.action.Tapper + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Tap + + DOUBLE +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Tap + + LONG +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Tap + + SINGLE +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Tap + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Tap[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Tapper.Status.html b/docs/html/reference/android/support/test/espresso/action/Tapper.Status.html new file mode 100644 index 00000000000..35fe92872f6 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Tapper.Status.html @@ -0,0 +1,1610 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Tapper.Status | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + final + + enum +

Tapper.Status

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.action.Tapper.Status
+ + + + + + + +
+ + +

Class Overview

+

The result of the tap. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Tapper.Status FAILURE  + Injecting the event was a complete failure.  + + + +
Tapper.Status SUCCESS  + The Tap action completed successfully.  + + + +
Tapper.Status WARNING  + The action seemed to have completed - but may have been misinterpreted + by the application.  + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Tapper.Status + + valueOf(String name) + +
+ + + final + static + + Status[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Tapper.Status + + FAILURE +

+
+ + + + +
+
+ + + + +

Injecting the event was a complete failure. +

+ + +
+
+ + + + + +
+

+ + public + static + final + Tapper.Status + + SUCCESS +

+
+ + + + +
+
+ + + + +

The Tap action completed successfully. +

+ + +
+
+ + + + + +
+

+ + public + static + final + Tapper.Status + + WARNING +

+
+ + + + +
+
+ + + + +

The action seemed to have completed - but may have been misinterpreted + by the application. (For Example a TAP became a LONG PRESS by measuring + its time between the down and up events). +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Tapper.Status + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Status[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/Tapper.html b/docs/html/reference/android/support/test/espresso/action/Tapper.html new file mode 100644 index 00000000000..fced46e28f4 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/Tapper.html @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Tapper | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

Tapper

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.action.Tapper
+ + + + + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

Interface to implement different click types. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + enumTapper.Status + The result of the tap.  + + + +
+ + + + + + + + + + +
Public Methods
+ abstract + + + + + Tapper.Status + + sendTap(UiController uiController, float[] coordinates, float[] precision) + +
+ Sends a MotionEvent to the given UiController. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + Tapper.Status + + sendTap + (UiController uiController, float[] coordinates, float[] precision) +

+
+
+ + + +
+
+ + + + +

Sends a MotionEvent to the given UiController.

+
+
Parameters
+ + + + + + + + + + +
uiController + a UiController to use to send MotionEvents to the screen.
coordinates + a float[] with x and y values of center of the tap.
precision + a float[] with x and y values of precision of the tap.
+
+
+
Returns
+
  • The status of the tap. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/TypeTextAction.html b/docs/html/reference/android/support/test/espresso/action/TypeTextAction.html new file mode 100644 index 00000000000..3ffef113448 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/TypeTextAction.html @@ -0,0 +1,1538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +TypeTextAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

TypeTextAction

+ + + + + extends Object
+ + + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.TypeTextAction
+ + + + + + + +
+ + +

Class Overview

+

Enables typing text on views. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + TypeTextAction(String stringToBeTyped) + +
+ Constructs TypeTextAction with given string. + + + +
+ +
+ + + + + + + + TypeTextAction(String stringToBeTyped, boolean tapToFocus) + +
+ Constructs TypeTextAction with given string. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + 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. + + + +
+ +
+ + + + + + void + + perform(UiController uiController, View view) + +
+ Performs this action on the given view. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + TypeTextAction + (String stringToBeTyped) +

+
+
+ + + +
+
+ + + + +

Constructs TypeTextAction with given string. If the string is empty it results in no-op + (nothing is typed). By default this action sends a tap event to the center of the view to + attain focus before typing.

+
+
Parameters
+ + + + +
stringToBeTyped + String To be typed by TypeTextAction +
+
+ +
+
+ + + + +
+

+ + public + + + + + + + TypeTextAction + (String stringToBeTyped, boolean tapToFocus) +

+
+
+ + + +
+
+ + + + +

Constructs TypeTextAction with given string. If the string is empty it results in no-op + (nothing is typed).

+
+
Parameters
+ + + + + + + +
stringToBeTyped + String To be typed by TypeTextAction
tapToFocus + indicates whether a tap should be sent to the underlying view before typing. +
+
+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + 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
+
  • a + Matcher that will be tested prior to calling perform. +
+
+ +
+
+ + + + +
+

+ + public + + + + + 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 ..." +

+ +
+
+ + + + +
+

+ + public + + + + + void + + perform + (UiController uiController, View view) +

+
+
+ + + +
+
+ + + + +

Performs this action on the given view.

+
+
Parameters
+ + + + + + + +
uiController + the controller to use to interact with the UI.
view + the view to act upon. never null. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/ViewActions.html b/docs/html/reference/android/support/test/espresso/action/ViewActions.html new file mode 100644 index 00000000000..ae65ab9eb2a --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/ViewActions.html @@ -0,0 +1,2545 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewActions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ViewActions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.action.ViewActions
+ + + + + + + +
+ + +

Class Overview

+

A collection of common ViewActions. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + ViewAction + + clearText() + +
+ Returns an action that clears text on the view. + + + +
+ +
+ + + + static + + ViewAction + + click(ViewAction rollbackAction) + +
+ Returns an action that performs a single click on the view. + + + +
+ +
+ + + + static + + ViewAction + + click() + +
+ Returns an action that clicks the view. + + + +
+ +
+ + + + static + + ViewAction + + closeSoftKeyboard() + +
+ Returns an action that closes soft keyboard. + + + +
+ +
+ + + + static + + ViewAction + + doubleClick() + +
+ Returns an action that double clicks the view. + + + +
+ +
+ + + + static + + ViewAction + + longClick() + +
+ Returns an action that long clicks the view. + + + +
+ +
+ + + + static + + ViewAction + + openLink(Matcher<String> linkTextMatcher, Matcher<Uri> uriMatcher) + +
+ Returns an action that opens a link matching the given link text and uri matchers. + + + +
+ +
+ + + + static + + ViewAction + + openLinkWithText(Matcher<String> linkTextMatcher) + +
+ Same as openLink(Matcher linkTextMatcher, Matcher uriMatcher), but uses + any(Uri.class) as the uriMatcher. + + + +
+ +
+ + + + static + + ViewAction + + openLinkWithText(String linkText) + +
+ Same as openLinkWithText(Matcher linkTextMatcher), but uses + is(linkText) as the linkTextMatcher. + + + +
+ +
+ + + + static + + ViewAction + + openLinkWithUri(String uri) + +
+ Same as openLinkWithUri(Matcher uriMatcher), but uses is(uri) as the + uriMatcher. + + + +
+ +
+ + + + static + + ViewAction + + openLinkWithUri(Matcher<Uri> uriMatcher) + +
+ Same as openLink(Matcher linkTextMatcher, Matcher uriMatcher), but uses + any(String.class) as the linkTextMatcher. + + + +
+ +
+ + + + static + + ViewAction + + pressBack() + +
+ Returns an action that clicks the back button. + + + +
+ +
+ + + + static + + ViewAction + + pressImeActionButton() + +
+ Returns an action that presses the current action button (next, done, search, etc) on the IME + (Input Method Editor). + + + +
+ +
+ + + + static + + ViewAction + + pressKey(EspressoKey key) + +
+ Returns an action that presses the specified key with the specified modifiers. + + + +
+ +
+ + + + static + + ViewAction + + pressKey(int keyCode) + +
+ Returns an action that presses the key specified by the keyCode (eg. + + + +
+ +
+ + + + static + + ViewAction + + pressMenuKey() + +
+ Returns an action that presses the hardware menu key. + + + +
+ +
+ + + + static + + ViewAction + + replaceText(String stringToBeSet) + +
+ Returns an action that updates the text attribute of a view. + + + +
+ +
+ + + + static + + ViewAction + + scrollTo() + +
+ Returns an action that scrolls to the view. + + + +
+ +
+ + + + static + + ViewAction + + swipeDown() + +
+ Returns an action that performs a swipe top-to-bottom across the horizontal center of the view. + + + +
+ +
+ + + + static + + ViewAction + + swipeLeft() + +
+ Returns an action that performs a swipe right-to-left across the vertical center of the + view. + + + +
+ +
+ + + + static + + ViewAction + + swipeRight() + +
+ Returns an action that performs a swipe left-to-right across the vertical center of the + view. + + + +
+ +
+ + + + static + + ViewAction + + swipeUp() + +
+ Returns an action that performs a swipe bottom-to-top across the horizontal center of the view. + + + +
+ +
+ + + + static + + ViewAction + + typeText(String stringToBeTyped) + +
+ Returns an action that selects the view (by clicking on it) and types the provided string into + the view. + + + +
+ +
+ + + + static + + ViewAction + + typeTextIntoFocusedView(String stringToBeTyped) + +
+ Returns an action that types the provided string into the view. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + ViewAction + + clearText + () +

+
+
+ + + +
+
+ + + + +

Returns an action that clears text on the view.
+
+ View constraints: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + click + (ViewAction rollbackAction) +

+
+
+ + + +
+
+ + + + +

Returns an action that performs a single click on the view. + + If the click takes longer than the 'long press' duration (which is possible) the provided + rollback action is invoked on the view and a click is attempted again. + + This is only necessary if the view being clicked on has some different behaviour for long press + versus a normal tap. + + For example - if a long press on a particular view element opens a popup menu - + ViewActions.pressBack() may be an acceptable rollback action. + +
+ View constraints: +

    +
  • must be displayed on screen
  • +
  • any constraints of the rollbackAction
  • +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + click + () +

+
+
+ + + +
+
+ + + + +

Returns an action that clicks the view.
+
+ View constraints: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + closeSoftKeyboard + () +

+
+
+ + + +
+
+ + + + +

Returns an action that closes soft keyboard. If the keyboard is already closed, it is a no-op. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + doubleClick + () +

+
+
+ + + +
+
+ + + + +

Returns an action that double clicks the view.
+
+ View preconditions: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + longClick + () +

+
+
+ + + +
+
+ + + + +

Returns an action that long clicks the view.
+ +
+ View preconditions: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + openLink + (Matcher<String> linkTextMatcher, Matcher<Uri> uriMatcher) +

+
+
+ + + +
+
+ + + + +

Returns an action that opens a link matching the given link text and uri matchers. The action + is performed by invoking the link's onClick method (as opposed to actually issuing a click on + the screen). +
+
+ View preconditions: +

    +
  • must be displayed on screen +
  • must be assignable from TextView +
  • must have links +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + openLinkWithText + (Matcher<String> linkTextMatcher) +

+
+
+ + + +
+
+ + + + +

Same as openLink(Matcher linkTextMatcher, Matcher uriMatcher), but uses + any(Uri.class) as the uriMatcher. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + openLinkWithText + (String linkText) +

+
+
+ + + +
+
+ + + + +

Same as openLinkWithText(Matcher linkTextMatcher), but uses + is(linkText) as the linkTextMatcher. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + openLinkWithUri + (String uri) +

+
+
+ + + +
+
+ + + + +

Same as openLinkWithUri(Matcher uriMatcher), but uses is(uri) as the + uriMatcher. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + openLinkWithUri + (Matcher<Uri> uriMatcher) +

+
+
+ + + +
+
+ + + + +

Same as openLink(Matcher linkTextMatcher, Matcher uriMatcher), but uses + any(String.class) as the linkTextMatcher. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + pressBack + () +

+
+
+ + + +
+
+ + + + +

Returns an action that clicks the back button. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + pressImeActionButton + () +

+
+
+ + + +
+
+ + + + +

Returns an action that presses the current action button (next, done, search, etc) on the IME + (Input Method Editor). The selected view will have its onEditorAction method called. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + pressKey + (EspressoKey key) +

+
+
+ + + +
+
+ + + + +

Returns an action that presses the specified key with the specified modifiers. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + pressKey + (int keyCode) +

+
+
+ + + +
+
+ + + + +

Returns an action that presses the key specified by the keyCode (eg. Keyevent.KEYCODE_BACK). +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + pressMenuKey + () +

+
+
+ + + +
+
+ + + + +

Returns an action that presses the hardware menu key. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + replaceText + (String stringToBeSet) +

+
+
+ + + +
+
+ + + + +

Returns an action that updates the text attribute of a view. +
+
+ View preconditions: +

    +
  • must be displayed on screen +
  • must be assignable from EditText +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + scrollTo + () +

+
+
+ + + +
+
+ + + + +

Returns an action that scrolls to the view.
+
+ View preconditions: +

    +
  • must be a descendant of ScrollView +
  • must have visibility set to View.VISIBLE +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + swipeDown + () +

+
+
+ + + +
+
+ + + + +

Returns an action that performs a swipe top-to-bottom across the horizontal center of the view. + The swipe doesn't start at the very edge of the view, but has a bit of offset.
+
+ View constraints: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + swipeLeft + () +

+
+
+ + + +
+
+ + + + +

Returns an action that performs a swipe right-to-left across the vertical center of the + view. The swipe doesn't start at the very edge of the view, but is a bit offset.
+
+ View constraints: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + swipeRight + () +

+
+
+ + + +
+
+ + + + +

Returns an action that performs a swipe left-to-right across the vertical center of the + view. The swipe doesn't start at the very edge of the view, but is a bit offset.
+
+ View constraints: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + swipeUp + () +

+
+
+ + + +
+
+ + + + +

Returns an action that performs a swipe bottom-to-top across the horizontal center of the view. + The swipe doesn't start at the very edge of the view, but has a bit of offset.
+
+ View constraints: +

    +
  • must be displayed on screen +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + typeText + (String stringToBeTyped) +

+
+
+ + + +
+
+ + + + +

Returns an action that selects the view (by clicking on it) and types the provided string into + the view. Appending a \n to the end of the string translates to a ENTER key event. Note: this + method performs a tap on the view before typing to force the view into focus, if the view + already contains text this tap may place the cursor at an arbitrary position within the text. +
+
+ View preconditions: +

    +
  • must be displayed on screen +
  • must support input methods +
      +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + typeTextIntoFocusedView + (String stringToBeTyped) +

+
+
+ + + +
+
+ + + + +

Returns an action that types the provided string into the view. + Appending a \n to the end of the string translates to a ENTER key event. Note: this method + does not change cursor position in the focused view - text is inserted at the location where + the cursor is currently pointed.
+
+ View preconditions: +

    +
  • must be displayed on screen +
  • must support input methods +
  • must be already focused +
      +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/action/package-summary.html b/docs/html/reference/android/support/test/espresso/action/package-summary.html new file mode 100644 index 00000000000..6baa91af5cf --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/action/package-summary.html @@ -0,0 +1,1033 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso.action | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso.action

+
+ +
+ +
+ + + + + + + + + + +

Interfaces

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AdapterViewProtocol + A sadly necessary layer of indirection to interact with AdapterViews.  + + + +
AdapterViewProtocol.DataFunction + A custom function that is applied when getData() is executed.  + + + +
CoordinatesProvider + Interface to implement calculation of Coordinates.  + + + +
PrecisionDescriber + Interface to implement size of click area.  + + + +
Swiper + Interface to implement different swipe types.  + + + +
Tapper + Interface to implement different click types.  + + + +
+ +
+ + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AdapterDataLoaderAction + Forces an AdapterView to ensure that the data matching a provided data matcher + is loaded into the current view hierarchy.  + + + +
AdapterViewProtocol.AdaptedData + A holder that associates a data object from an AdapterView with a token the + AdapterViewProtocol can use to force that data object to be rendered as a child or deeper + descendant of the adapter view.  + + + +
AdapterViewProtocol.AdaptedData.Builder +   + + + +
AdapterViewProtocols + Implementations of AdapterViewProtocol for standard SDK Widgets.  + + + +
CloseKeyboardAction + Closes soft keyboard.  + + + +
EditorAction + Performs whatever editor (IME) action is available on a view.  + + + +
EspressoKey + Class that wraps the key code and meta state of the desired key press.  + + + +
EspressoKey.Builder + Builder for the EspressoKey class.  + + + +
GeneralClickAction + Enables clicking on views.  + + + +
GeneralSwipeAction + Enables swiping across a view.  + + + +
KeyEventAction + Enables pressing KeyEvents on views.  + + + +
OpenLinkAction + Invokes onClick of a link within a TextView (made with Linkify or via another method).  + + + +
ReplaceTextAction + Replaces view text by setting EditTexts text property to given String.  + + + +
ScrollToAction + Enables scrolling to the given view.  + + + +
TypeTextAction + Enables typing text on views.  + + + +
ViewActions + A collection of common ViewActions.  + + + +
+ +
+ + + + +

Enums

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GeneralLocation + Calculates coordinate position for general locations.  + + + +
Press + Returns different touch target sizes.  + + + +
Swipe + Executes different swipe types to given positions.  + + + +
Swiper.Status + The result of the swipe.  + + + +
Tap + Executes different click types to given position.  + + + +
Tapper.Status + The result of the tap.  + + + +
+ +
+ + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/assertion/LayoutAssertions.html b/docs/html/reference/android/support/test/espresso/assertion/LayoutAssertions.html new file mode 100644 index 00000000000..037b2ceeea9 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/assertion/LayoutAssertions.html @@ -0,0 +1,1287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +LayoutAssertions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

LayoutAssertions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.assertion.LayoutAssertions
+ + + + + + + +
+ + +

Class Overview

+

A collection of layout ViewAssertions. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + ViewAssertion + + noEllipsizedText() + +
+ Returns a ViewAssertion that asserts that view hierarchy does not contain + ellipsized or cut off text views. + + + +
+ +
+ + + + static + + ViewAssertion + + noMultilineButtons() + +
+ Returns a ViewAssertion that asserts that view hierarchy does not contain + multiline buttons. + + + +
+ +
+ + + + static + + ViewAssertion + + noOverlaps(Matcher<View> selector) + +
+ Returns a ViewAssertion that asserts that descendant views matching the selector + do not overlap each other. + + + +
+ +
+ + + + static + + ViewAssertion + + noOverlaps() + +
+ Returns a ViewAssertion that asserts that descendant objects assignable + to TextView or ImageView do not overlap each other. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + ViewAssertion + + noEllipsizedText + () +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view hierarchy does not contain + ellipsized or cut off text views. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + noMultilineButtons + () +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view hierarchy does not contain + multiline buttons. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + noOverlaps + (Matcher<View> selector) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that descendant views matching the selector + do not overlap each other. +

+ Example: onView(rootView).check(noOverlaps(isAssignableFrom(TextView.class)); +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + noOverlaps + () +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that descendant objects assignable + to TextView or ImageView do not overlap each other. +

+ Example: onView(rootView).check(noOverlaps()) +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/assertion/PositionAssertions.html b/docs/html/reference/android/support/test/espresso/assertion/PositionAssertions.html new file mode 100644 index 00000000000..90c69017454 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/assertion/PositionAssertions.html @@ -0,0 +1,1663 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PositionAssertions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

PositionAssertions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.assertion.PositionAssertions
+ + + + + + + +
+ + +

Class Overview

+

A collection of ViewAssertions for checking relative position of elements on the screen. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + ViewAssertion + + isAbove(Matcher<View> matcher) + +
+ Returns an Assertion that asserts that view displayed is completely above + the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isBelow(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely + below the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isBottomAlignedWith(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely + aligned to bottom with the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isLeftAlignedWith(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely aligned + to the left as the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isLeftOf(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely left of + the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isRightAlignedWith(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely aligned + to the right as the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isRightOf(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely right of + the view matching the given matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + isTopAlignedWith(Matcher<View> matcher) + +
+ Returns a ViewAssertion that asserts that view displayed is completely + aligned to top with the view matching the given matcher. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + ViewAssertion + + isAbove + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns an Assertion that asserts that view displayed is completely above + the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if there is more than 1 pixel of vertical overlap.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isBelow + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely + below the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if there is more than 1 pixel of vertical overlap.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isBottomAlignedWith + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely + aligned to bottom with the view matching the given matcher. + +

The bottom 'y' coordinate of the view displayed must equal the bottom 'y' + coordinate of the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if the views are not aligned bottom.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isLeftAlignedWith + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely aligned + to the left as the view matching the given matcher. + +

The left 'x' coordinate of the view displayed must equal the left 'x' + coordinate of the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if the views are not aligned to the left.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isLeftOf + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely left of + the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if there is more than 1 pixel of horizontal overlap.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isRightAlignedWith + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely aligned + to the right as the view matching the given matcher. + +

The right 'x' coordinate of the view displayed must equal the right 'x' + coordinate of the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if the views are not aligned to the right.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isRightOf + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely right of + the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if there is more than 1 pixel of horizontal overlap.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + isTopAlignedWith + (Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAssertion that asserts that view displayed is completely + aligned to top with the view matching the given matcher. + +

The top 'y' coordinate of the view displayed must equal the top 'y' + coordinate of the view matching the given matcher.

+
+
Throws
+ + + + + + + + + + +
+ if the views are not aligned top.
AmbiguousViewMatcherException + if more than one view matches the given matcher.
NoMatchingViewException + if no views match the given matcher. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/assertion/ViewAssertions.html b/docs/html/reference/android/support/test/espresso/assertion/ViewAssertions.html new file mode 100644 index 00000000000..8e956d4e1b4 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/assertion/ViewAssertions.html @@ -0,0 +1,1228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewAssertions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ViewAssertions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.assertion.ViewAssertions
+ + + + + + + +
+ + +

Class Overview

+

A collection of common ViewAssertions. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + ViewAssertion + + doesNotExist() + +
+ Returns an assert that ensures the view matcher does not find any matching view in the + hierarchy. + + + +
+ +
+ + + + static + + ViewAssertion + + matches(Matcher<? super View> viewMatcher) + +
+ Returns a generic ViewAssertion that asserts that a view exists in the view hierarchy + and is matched by the given view matcher. + + + +
+ +
+ + + + static + + ViewAssertion + + selectedDescendantsMatch(Matcher<View> selector, Matcher<View> matcher) + +
+ Returns a generic ViewAssertion that asserts that the descendant views selected by the + selector match the specified matcher. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + ViewAssertion + + doesNotExist + () +

+
+
+ + + +
+
+ + + + +

Returns an assert that ensures the view matcher does not find any matching view in the + hierarchy. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + matches + (Matcher<? super View> viewMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a generic ViewAssertion that asserts that a view exists in the view hierarchy + and is matched by the given view matcher. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAssertion + + selectedDescendantsMatch + (Matcher<View> selector, Matcher<View> matcher) +

+
+
+ + + +
+
+ + + + +

Returns a generic ViewAssertion that asserts that the descendant views selected by the + selector match the specified matcher. + + Example: onView(rootView).check(selectedDescendantsMatch( + not(isAssignableFrom(TextView.class)), hasContentDescription())); +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/assertion/package-summary.html b/docs/html/reference/android/support/test/espresso/assertion/package-summary.html new file mode 100644 index 00000000000..ec073927663 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/assertion/package-summary.html @@ -0,0 +1,702 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso.assertion | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso.assertion

+
+ +
+ +
+ + + + + + + + + + + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + +
LayoutAssertions + A collection of layout ViewAssertions.  + + + +
PositionAssertions + A collection of ViewAssertions for checking relative position of elements on the screen.  + + + +
ViewAssertions + A collection of common ViewAssertions.  + + + +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/ActiveRootLister.html b/docs/html/reference/android/support/test/espresso/base/ActiveRootLister.html new file mode 100644 index 00000000000..8585b653d85 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/ActiveRootLister.html @@ -0,0 +1,882 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ActiveRootLister | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

ActiveRootLister

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.base.ActiveRootLister
+ + + + + + + +
+ + +

Class Overview

+

Provides access to all root views in an application. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + List<Root> + + listActiveRoots() + +
+ Lists the active roots in an application at this moment. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + List<Root> + + listActiveRoots + () +

+
+
+ + + +
+
+ + + + +

Lists the active roots in an application at this moment.

+
+
Returns
+
  • a list of all the active roots in the application.
+
+
+
Throws
+ + + + +
IllegalStateException + if invoked from a thread besides the main thread. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/BaseLayerModule.FailureHandlerHolder.html b/docs/html/reference/android/support/test/espresso/base/BaseLayerModule.FailureHandlerHolder.html new file mode 100644 index 00000000000..f0e2673df8d --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/BaseLayerModule.FailureHandlerHolder.html @@ -0,0 +1,1228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BaseLayerModule.FailureHandlerHolder | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

BaseLayerModule.FailureHandlerHolder

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.base.BaseLayerModule.FailureHandlerHolder
+ + + + + + + +
+ + +

Class Overview

+

Holder for AtomicReference which allows updating it at runtime. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + BaseLayerModule.FailureHandlerHolder(FailureHandler defaultHandler) + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + FailureHandler + + get() + +
+ + + + + + void + + update(FailureHandler handler) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + BaseLayerModule.FailureHandlerHolder + (FailureHandler defaultHandler) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + FailureHandler + + get + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + update + (FailureHandler handler) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/BaseLayerModule.html b/docs/html/reference/android/support/test/espresso/base/BaseLayerModule.html new file mode 100644 index 00000000000..c440de14e61 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/BaseLayerModule.html @@ -0,0 +1,1640 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BaseLayerModule | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

BaseLayerModule

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.base.BaseLayerModule
+ + + + + + + +
+ + +

Class Overview

+

Dagger module for creating the implementation classes within the base package. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classBaseLayerModule.FailureHandlerHolder + Holder for AtomicReference which allows updating it at runtime.  + + + +
+ + + + + + + + + + +
Public Constructors
+ + + + + + + + BaseLayerModule() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + ActiveRootLister + + provideActiveRootLister(RootsOracle rootsOracle) + +
+ + + + + + Optional<AsyncTaskPoolMonitor> + + provideCompatAsyncTaskMonitor(ThreadPoolExecutorExtractor extractor) + +
+ + + + + + EventInjector + + provideEventInjector() + +
+ + + + + + ActivityLifecycleMonitor + + provideLifecycleMonitor() + +
+ + + + + + Looper + + provideMainLooper() + +
+ + + + + + Executor + + provideMainThreadExecutor(Looper mainLooper) + +
+ + + + + + Recycler + + provideRecycler() + +
+ + + + + + AsyncTaskPoolMonitor + + provideSdkAsyncTaskMonitor(ThreadPoolExecutorExtractor extractor) + +
+ + + + + + Context + + provideTargetContext() + +
+ + + + + + UiController + + provideUiController(UiControllerImpl uiControllerImpl) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + BaseLayerModule + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + ActiveRootLister + + provideActiveRootLister + (RootsOracle rootsOracle) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Optional<AsyncTaskPoolMonitor> + + provideCompatAsyncTaskMonitor + (ThreadPoolExecutorExtractor extractor) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + EventInjector + + provideEventInjector + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + ActivityLifecycleMonitor + + provideLifecycleMonitor + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Looper + + provideMainLooper + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Executor + + provideMainThreadExecutor + (Looper mainLooper) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Recycler + + provideRecycler + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + AsyncTaskPoolMonitor + + provideSdkAsyncTaskMonitor + (ThreadPoolExecutorExtractor extractor) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + Context + + provideTargetContext + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + UiController + + provideUiController + (UiControllerImpl uiControllerImpl) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/Default.html b/docs/html/reference/android/support/test/espresso/base/Default.html new file mode 100644 index 00000000000..5e45a330bbf --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/Default.html @@ -0,0 +1,927 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Default | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + @interface +

Default

+ + + + + + implements + + Annotation + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.base.Default
+ + + + + + + +
+ + +

Class Overview

+

Annotates a default provider. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From interface + + java.lang.annotation.Annotation + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/DefaultFailureHandler.html b/docs/html/reference/android/support/test/espresso/base/DefaultFailureHandler.html new file mode 100644 index 00000000000..5fe6b192461 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/DefaultFailureHandler.html @@ -0,0 +1,1254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +DefaultFailureHandler | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

DefaultFailureHandler

+ + + + + extends Object
+ + + + + + + implements + + FailureHandler + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.base.DefaultFailureHandler
+ + + + + + + +
+ + +

Class Overview

+

Espresso's default FailureHandler. If this does not fit your needs, feel free to provide + your own implementation via Espresso.setFailureHandler(FailureHandler). +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + DefaultFailureHandler(Context appContext) + +
+ + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + handle(Throwable error, Matcher<View> viewMatcher) + +
+ Handle the given error in a manner that makes sense to the environment in which the test is + executed (e.g. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.FailureHandler + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + DefaultFailureHandler + (Context appContext) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + handle + (Throwable error, Matcher<View> viewMatcher) +

+
+
+ + + +
+
+ + + + +

Handle the given error in a manner that makes sense to the environment in which the test is + executed (e.g. take a screenshot, output extra debug info, etc). Upon handling, most handlers + will choose to propagate the error. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/IdlingResourceRegistry.html b/docs/html/reference/android/support/test/espresso/base/IdlingResourceRegistry.html new file mode 100644 index 00000000000..b9601613f06 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/IdlingResourceRegistry.html @@ -0,0 +1,1353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IdlingResourceRegistry | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

IdlingResourceRegistry

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.base.IdlingResourceRegistry
+ + + + + + + +
+ + +

Class Overview

+

Keeps track of user-registered IdlingResources. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + IdlingResourceRegistry(Looper looper) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + List<IdlingResource> + + getResources() + +
+ Returns a list of all currently registered IdlingResources. + + + +
+ +
+ + + + + + void + + registerLooper(Looper looper, boolean considerWaitIdle) + +
+ + + + + + boolean + + registerResources(List<? extends IdlingResource> resourceList) + +
+ Registers the given resources. + + + +
+ +
+ + + + + + boolean + + unregisterResources(List<? extends IdlingResource> resourceList) + +
+ Unregisters the given resources. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + IdlingResourceRegistry + (Looper looper) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + List<IdlingResource> + + getResources + () +

+
+
+ + + +
+
+ + + + +

Returns a list of all currently registered IdlingResources. + This method is safe to call from any thread.

+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + void + + registerLooper + (Looper looper, boolean considerWaitIdle) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + registerResources + (List<? extends IdlingResource> resourceList) +

+
+
+ + + +
+
+ + + + +

Registers the given resources. If any of the given resources are already + registered, a warning is logged.

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + unregisterResources + (List<? extends IdlingResource> resourceList) +

+
+
+ + + +
+
+ + + + +

Unregisters the given resources. If any of the given resources are not already + registered, a warning is logged.

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/MainThread.html b/docs/html/reference/android/support/test/espresso/base/MainThread.html new file mode 100644 index 00000000000..92b396ed7e0 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/MainThread.html @@ -0,0 +1,927 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +MainThread | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + @interface +

MainThread

+ + + + + + implements + + Annotation + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.base.MainThread
+ + + + + + + +
+ + +

Class Overview

+

Annotates an Executor that executes tasks on the main thread +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From interface + + java.lang.annotation.Annotation + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/RootViewPicker.html b/docs/html/reference/android/support/test/espresso/base/RootViewPicker.html new file mode 100644 index 00000000000..d1eb8e710aa --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/RootViewPicker.html @@ -0,0 +1,1170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RootViewPicker | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

RootViewPicker

+ + + + + extends Object
+ + + + + + + implements + + Provider<T> + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.base.RootViewPicker
+ + + + + + + +
+ + +

Class Overview

+

Provides the root View of the top-most Window, with which the user can interact. View is + guaranteed to be in a stable state - i.e. not pending any updates from the application. + + This provider can only be accessed from the main thread. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + View + + get() + +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + javax.inject.Provider + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + View + + get + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/ViewFinderImpl.html b/docs/html/reference/android/support/test/espresso/base/ViewFinderImpl.html new file mode 100644 index 00000000000..d5c79490a29 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/ViewFinderImpl.html @@ -0,0 +1,1200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewFinderImpl | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ViewFinderImpl

+ + + + + extends Object
+ + + + + + + implements + + ViewFinder + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.base.ViewFinderImpl
+ + + + + + + +
+ + +

Class Overview

+

Implementation of ViewFinder. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + View + + getView() + +
+ Immediately locates a single view within the provided view hierarchy. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.ViewFinder + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + View + + getView + () +

+
+
+ + + +
+
+ + + + +

Immediately locates a single view within the provided view hierarchy. + + If multiple views match, or if no views match the appropriate exception is thrown.

+
+
Returns
+
  • A singular view which matches the matcher we were constructed with.
+
+ + +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/base/package-summary.html b/docs/html/reference/android/support/test/espresso/base/package-summary.html new file mode 100644 index 00000000000..e0ba7fb7ae2 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/base/package-summary.html @@ -0,0 +1,803 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso.base | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso.base

+
+ +
+ +
+ + + + + + + +

Annotations

+
+ + + + + + + + + + + + + + + + +
Default + Annotates a default provider.  + + + +
MainThread + Annotates an Executor that executes tasks on the main thread +  + + + +
+ +
+ + + + +

Interfaces

+
+ + + + + + + + + + +
ActiveRootLister + Provides access to all root views in an application.  + + + +
+ +
+ + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BaseLayerModule + Dagger module for creating the implementation classes within the base package.  + + + +
BaseLayerModule.FailureHandlerHolder + Holder for AtomicReference which allows updating it at runtime.  + + + +
DefaultFailureHandler + Espresso's default FailureHandler.  + + + +
IdlingResourceRegistry + Keeps track of user-registered IdlingResources.  + + + +
RootViewPicker + Provides the root View of the top-most Window, with which the user can interact.  + + + +
ViewFinderImpl + Implementation of ViewFinder.  + + + +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/CountingIdlingResource.html b/docs/html/reference/android/support/test/espresso/contrib/CountingIdlingResource.html new file mode 100644 index 00000000000..a2a3ee9898c --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/CountingIdlingResource.html @@ -0,0 +1,1738 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +CountingIdlingResource | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

CountingIdlingResource

+ + + + + extends Object
+ + + + + + + implements + + IdlingResource + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.contrib.CountingIdlingResource
+ + + + + + + +
+ + +

Class Overview

+

An implementation of IdlingResource that determines idleness by maintaining an internal + counter. When the counter is 0 - it is considered to be idle, when it is non-zero it is not + idle. This is very similar to the way a Semaphore behaves. +

+ The counter may be incremented or decremented from any thread. If it reaches an illogical state + (like counter less than zero) it will throw an IllegalStateException. +

+

+ This class can then be used to wrap up operations that while in progress should block tests from + accessing the UI. +

+ +
+ public interface FooServer {
+     public Foo newFoo();
+     public void updateFoo(Foo foo);
+   
+
+   public DecoratedFooServer implements FooServer {
+     private final FooServer realFooServer;
+     private final CountingIdlingResource fooServerIdlingResource;
+
+     public DecoratedFooServer(FooServer realFooServer,
+         CountingIdlingResource fooServerIdlingResource) {
+       this.realFooServer = checkNotNull(realFooServer);
+       this.fooServerIdlingResource = checkNotNull(fooServerIdlingResource);
+     }
+
+     public Foo newFoo() {
+       fooServerIdlingResource.increment();
+       try {
+         return realFooServer.newFoo();
+       } finally {
+         fooServerIdlingResource.decrement();
+       }
+     }
+
+     public void updateFoo(Foo foo) {
+       fooServerIdlingResource.increment();
+       try {
+         realFooServer.updateFoo(foo);
+       } finally {
+         fooServerIdlingResource.decrement();
+       }
+     }
+   }
+   }
+   
+ + Then in your test setup: +
+   public void setUp() throws Exception {
+       super.setUp();
+       FooServer realServer = FooApplication.getFooServer();
+       CountingIdlingResource countingResource = new CountingIdlingResource("FooServerCalls");
+       FooApplication.setFooServer(new DecoratedFooServer(realServer, countingResource));
+       Espresso.registerIdlingResource(countingResource);
+     
+   }
+   
+ +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + CountingIdlingResource(String resourceName) + +
+ Creates a CountingIdlingResource without debug tracing. + + + +
+ +
+ + + + + + + + CountingIdlingResource(String resourceName, boolean debugCounting) + +
+ Creates a CountingIdlingResource. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + decrement() + +
+ Decrements the count of in-flight transactions to the resource being monitored. + + + +
+ +
+ + + + + + void + + dumpStateToLogs() + +
+ Prints the current state of this resource to the logcat at info level. + + + +
+ +
+ + + + + + String + + getName() + +
+ Returns the name of the resources (used for logging and idempotency of registration). + + + +
+ +
+ + + + + + void + + increment() + +
+ Increments the count of in-flight transactions to the resource being monitored. + + + +
+ +
+ + + + + + boolean + + isIdleNow() + +
+ Returns true if resource is currently idle. + + + +
+ +
+ + + + + + void + + registerIdleTransitionCallback(IdlingResource.ResourceCallback resourceCallback) + +
+ Registers the given IdlingResource.ResourceCallback with the resource. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.support.test.espresso.IdlingResource + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + CountingIdlingResource + (String resourceName) +

+
+
+ + + +
+
+ + + + +

Creates a CountingIdlingResource without debug tracing.

+
+
Parameters
+ + + + +
resourceName + the resource name this resource should report to Espresso. +
+
+ +
+
+ + + + +
+

+ + public + + + + + + + CountingIdlingResource + (String resourceName, boolean debugCounting) +

+
+
+ + + +
+
+ + + + +

Creates a CountingIdlingResource.

+
+
Parameters
+ + + + + + + +
resourceName + the resource name this resource should report to Espresso.
debugCounting + if true increment & decrement calls will print trace information to logs. +
+
+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + decrement + () +

+
+
+ + + +
+
+ + + + +

Decrements the count of in-flight transactions to the resource being monitored. + + If this operation results in the counter falling below 0 - an exception is raised.

+
+
Throws
+ + + + +
IllegalStateException + if the counter is below 0. +
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + dumpStateToLogs + () +

+
+
+ + + +
+
+ + + + +

Prints the current state of this resource to the logcat at info level. +

+ +
+
+ + + + +
+

+ + public + + + + + String + + getName + () +

+
+
+ + + +
+
+ + + + +

Returns the name of the resources (used for logging and idempotency of registration). +

+ +
+
+ + + + +
+

+ + public + + + + + void + + increment + () +

+
+
+ + + +
+
+ + + + +

Increments the count of in-flight transactions to the resource being monitored. + + This method can be called from any thread. +

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + isIdleNow + () +

+
+
+ + + +
+
+ + + + +

Returns true if resource is currently idle. Espresso will always call this + method from the main thread, therefore it should be non-blocking and return immediately. +

+ +
+
+ + + + +
+

+ + public + + + + + void + + registerIdleTransitionCallback + (IdlingResource.ResourceCallback resourceCallback) +

+
+
+ + + +
+
+ + + + +

Registers the given IdlingResource.ResourceCallback with the resource. Espresso will call this method: +

    +
  • with its implementation of IdlingResource.ResourceCallback so it can be notified asynchronously + that your resource is idle +
  • from the main thread, but you are free to execute the callback's onTransitionToIdle from + any thread +
  • once (when it is initially given a reference to your IdlingResource) +
+
+ You only need to call this upon transition from busy to idle - if the resource is already idle + when the method is called invoking the call back is optional and has no significant impact. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/DrawerActions.html b/docs/html/reference/android/support/test/espresso/contrib/DrawerActions.html new file mode 100644 index 00000000000..840a57b20a5 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/DrawerActions.html @@ -0,0 +1,1177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +DrawerActions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

DrawerActions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.contrib.DrawerActions
+ + + + + + + +
+ + +

Class Overview

+

Espresso actions for using a DrawerLayout.

+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + void + + closeDrawer(int drawerLayoutId) + +
+ Closes the DrawerLayout with the given id. + + + +
+ +
+ + + + static + + void + + openDrawer(int drawerLayoutId) + +
+ Opens the DrawerLayout with the given id. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + void + + closeDrawer + (int drawerLayoutId) +

+
+
+ + + +
+
+ + + + +

Closes the DrawerLayout with the given id. This method blocks until the drawer is fully + closed. No operation if the drawer is already closed. +

+ +
+
+ + + + +
+

+ + public + static + + + + void + + openDrawer + (int drawerLayoutId) +

+
+
+ + + +
+
+ + + + +

Opens the DrawerLayout with the given id. This method blocks until the drawer is fully + open. No operation if the drawer is already open. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/DrawerMatchers.html b/docs/html/reference/android/support/test/espresso/contrib/DrawerMatchers.html new file mode 100644 index 00000000000..11aa326994e --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/DrawerMatchers.html @@ -0,0 +1,1174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +DrawerMatchers | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

DrawerMatchers

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.contrib.DrawerMatchers
+ + + + + + + +
+ + +

Class Overview

+

Hamcrest matchers for a DrawerLayout. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Matcher<View> + + isClosed() + +
+ Returns a matcher that verifies that the drawer is closed. + + + +
+ +
+ + + + static + + Matcher<View> + + isOpen() + +
+ Returns a matcher that verifies that the drawer is open. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Matcher<View> + + isClosed + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that verifies that the drawer is closed. Matches only when the drawer is + fully closed. Use isOpen() instead of not(isClosed())) when you wish to check + that the drawer is fully open. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isOpen + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that verifies that the drawer is open. Matches only when the drawer is fully + open. Use isClosed() instead of not(isOpen()) when you wish to check that the + drawer is fully closed. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/PickerActions.html b/docs/html/reference/android/support/test/espresso/contrib/PickerActions.html new file mode 100644 index 00000000000..f1fbede5713 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/PickerActions.html @@ -0,0 +1,1176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PickerActions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

PickerActions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.contrib.PickerActions
+ + + + + + + +
+ + +

Class Overview

+

Espresso action for interacting with DatePicker and + TimePicker.

+ + + +
+
See Also
+ +
+ + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + ViewAction + + setDate(int year, int monthOfYear, int dayOfMonth) + +
+ Returns a ViewAction that sets a date on a DatePicker. + + + +
+ +
+ + + + static + + ViewAction + + setTime(int hours, int minutes) + +
+ Returns a ViewAction that sets a time on a TimePicker. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + ViewAction + + setDate + (int year, int monthOfYear, int dayOfMonth) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAction that sets a date on a DatePicker. +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + setTime + (int hours, int minutes) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAction that sets a time on a TimePicker. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html b/docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html new file mode 100644 index 00000000000..09a593cf995 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html @@ -0,0 +1,1024 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RecyclerViewActions.PositionableRecyclerViewAction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + interface +

RecyclerViewActions.PositionableRecyclerViewAction

+ + + + + + implements + + ViewAction + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.espresso.contrib.RecyclerViewActions.PositionableRecyclerViewAction
+ + + + + + + +
+ + +

Class Overview

+

Most RecyclerViewActions are given a matcher to select a particular view / viewholder within + the RecyclerView. In this case the default behaviour is to expect that the matcher matches 1 + and only one item within the RecyclerView. + + This interface gives users the ability to override that type of behaviour and explicitly + select an item in the RecyclerView at a given position. This is similar to on the + onData(...).atPosition() api for AdapterViews. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + RecyclerViewActions.PositionableRecyclerViewAction + + atPosition(int position) + +
+ Returns a new ViewAction which will cause the ViewAction to operate upon the position-th + element which the matcher has selected. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From interface + + android.support.test.espresso.ViewAction + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + RecyclerViewActions.PositionableRecyclerViewAction + + atPosition + (int position) +

+
+
+ + + +
+
+ + + + +

Returns a new ViewAction which will cause the ViewAction to operate upon the position-th + element which the matcher has selected.

+
+
Parameters
+ + + + +
position + a 0-based index into the list of matching elements within the RecyclerView.
+
+
+
Throws
+ + + + +
IllegalArgumentException + if position < 0. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.html b/docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.html new file mode 100644 index 00000000000..9445a4eaaa6 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/RecyclerViewActions.html @@ -0,0 +1,1574 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RecyclerViewActions | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

RecyclerViewActions

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.contrib.RecyclerViewActions
+ + + + + + + +
+ + +

Class Overview

+

ViewActions to interact RecyclerView. RecyclerView works differently than + AdapterView. In fact, RecyclerView is not an AdapterView anymore, hence it can't be used + in combination with onData(Matcher). + +

+ To use ViewActions in this class use onView(Matcher) with a + + Matcher that matches your RecyclerView, then perform a + ViewAction from this class. +

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + interfaceRecyclerViewActions.PositionableRecyclerViewAction + Most RecyclerViewActions are given a matcher to select a particular view / viewholder within + the RecyclerView.  + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + <VH extends RecyclerView.ViewHolder> + RecyclerViewActions.PositionableRecyclerViewAction + + actionOnHolderItem(Matcher<VH> viewHolderMatcher, ViewAction viewAction) + +
+ Performs a ViewAction on a view matched by viewHolderMatcher. + + + +
+ +
+ + + + static + <VH extends RecyclerView.ViewHolder> + RecyclerViewActions.PositionableRecyclerViewAction + + actionOnItem(Matcher<View> itemViewMatcher, ViewAction viewAction) + +
+ Performs a ViewAction on a view matched by viewHolderMatcher. + + + +
+ +
+ + + + static + <VH extends RecyclerView.ViewHolder> + ViewAction + + actionOnItemAtPosition(int position, ViewAction viewAction) + +
+ Performs a ViewAction on a view at position. + + + +
+ +
+ + + + static + <VH extends RecyclerView.ViewHolder> + RecyclerViewActions.PositionableRecyclerViewAction + + scrollTo(Matcher<View> itemViewMatcher) + +
+ Returns a ViewAction which scrolls RecyclerView to the view matched by + itemViewMatcher. + + + +
+ +
+ + + + static + <VH extends RecyclerView.ViewHolder> + RecyclerViewActions.PositionableRecyclerViewAction + + scrollToHolder(Matcher<VH> viewHolderMatcher) + +
+ Returns a ViewAction which scrolls RecyclerView to the view matched by + viewHolderMatcher. + + + +
+ +
+ + + + static + <VH extends RecyclerView.ViewHolder> + ViewAction + + scrollToPosition(int position) + +
+ Returns a ViewAction which scrolls RecyclerView to a position. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + RecyclerViewActions.PositionableRecyclerViewAction + + actionOnHolderItem + (Matcher<VH> viewHolderMatcher, ViewAction viewAction) +

+
+
+ + + +
+
+ + + + +

Performs a ViewAction on a view matched by viewHolderMatcher. + +

    +
  1. Scroll Recycler View to the view matched by itemViewMatcher
  2. +
  3. Perform an action on the matched view
  4. +
+ Note: actionOnItem method is not overloaded, method overloading with + generic parameters is not possible.

+
+
Parameters
+ + + + + + + +
viewHolderMatcher + a + Matcher that matchesan item view holder in RecyclerView
viewAction + the action that is performed on the view matched by viewHolderMatcher
+
+
+
Throws
+ + + + +
PerformException + if there are more than one items matching given viewHolderMatcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + RecyclerViewActions.PositionableRecyclerViewAction + + actionOnItem + (Matcher<View> itemViewMatcher, ViewAction viewAction) +

+
+
+ + + +
+
+ + + + +

Performs a ViewAction on a view matched by viewHolderMatcher. + +

    +
  1. Scroll Recycler View to the view matched by itemViewMatcher
  2. +
  3. Perform an action on the matched view
  4. +

+
+
Parameters
+ + + + + + + +
itemViewMatcher + a + Matcher that matches an item view in RecyclerView
viewAction + the action that is performed on the view matched by viewHolderMatcher
+
+
+
Throws
+ + + + +
PerformException + if there are more than one items matching given viewHolderMatcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + actionOnItemAtPosition + (int position, ViewAction viewAction) +

+
+
+ + + +
+
+ + + + +

Performs a ViewAction on a view at position. + +

    +
  1. Scroll Recycler View to position
  2. +
  3. Perform an action on the view at position
  4. +

+
+
Parameters
+ + + + + + + +
position + position of a view in RecyclerView
viewAction + the action that is performed on the view matched by itemViewMatcher +
+
+ +
+
+ + + + +
+

+ + public + static + + + + RecyclerViewActions.PositionableRecyclerViewAction + + scrollTo + (Matcher<View> itemViewMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAction which scrolls RecyclerView to the view matched by + itemViewMatcher. + +

+ This approach uses RecyclerView.ViewHolders to find the target view. It will create one ViewHolder + per item type and bind adapter data to the ViewHolder. If the itemViewMatcher matches a + ViewHolder the current position of the View is used to perform a + scrollToPosition(int). +

+
+
Parameters
+ + + + +
itemViewMatcher + a + Matcher that matches an item view in RecyclerView
+
+
+
Throws
+ + + + +
PerformException + if there are more than one items matching given viewHolderMatcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + RecyclerViewActions.PositionableRecyclerViewAction + + scrollToHolder + (Matcher<VH> viewHolderMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAction which scrolls RecyclerView to the view matched by + viewHolderMatcher. + +

+ This approach uses RecyclerView.ViewHolders to find the target view. It will create one ViewHolder + per item type and bind adapter data to the ViewHolder. If the itemViewMatcher matches a + ViewHolder the current position of the View is used to perform a + scrollToPosition(int). Note: scrollTo method is not overloaded, method + overloading with generic parameters is not possible. +

+
+
Parameters
+ + + + +
viewHolderMatcher + a Matcher that matches an item view holder in + RecyclerView
+
+
+
Throws
+ + + + +
PerformException + if there are more than one items matching given viewHolderMatcher. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + ViewAction + + scrollToPosition + (int position) +

+
+
+ + + +
+
+ + + + +

Returns a ViewAction which scrolls RecyclerView to a position.

+
+
Parameters
+ + + + +
position + the position of the view to scroll to +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/contrib/package-summary.html b/docs/html/reference/android/support/test/espresso/contrib/package-summary.html new file mode 100644 index 00000000000..e015879af76 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/contrib/package-summary.html @@ -0,0 +1,755 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso.contrib | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso.contrib

+
+ +
+ +
+ + + + + + + + + + +

Interfaces

+
+ + + + + + + + + + +
RecyclerViewActions.PositionableRecyclerViewAction + Most RecyclerViewActions are given a matcher to select a particular view / viewholder within + the RecyclerView.  + + + +
+ +
+ + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CountingIdlingResource + An implementation of IdlingResource that determines idleness by maintaining an internal + counter.  + + + +
DrawerActions + Espresso actions for using a DrawerLayout.  + + + +
DrawerMatchers + Hamcrest matchers for a DrawerLayout.  + + + +
PickerActions + Espresso action for interacting with DatePicker and + TimePicker.  + + + +
RecyclerViewActions + ViewActions to interact RecyclerView.  + + + +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/BoundedMatcher.html b/docs/html/reference/android/support/test/espresso/matcher/BoundedMatcher.html new file mode 100644 index 00000000000..c387859a7ae --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/BoundedMatcher.html @@ -0,0 +1,1510 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BoundedMatcher | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + class +

BoundedMatcher

+ + + + + + + + + extends BaseMatcher<T>
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳org.hamcrest.BaseMatcher<T>
    ↳android.support.test.espresso.matcher.BoundedMatcher<T, S extends T>
+ + + + + + + +
+ + +

Class Overview

+

Some matcher sugar that lets you create a matcher for a given type + but only process items of a specific subtype of that matcher.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + BoundedMatcher(Class<? extends S> expectedType) + +
+ + + + + + + + BoundedMatcher(Class<?> expectedType, Class<?> interfaceType1, Class...<?> otherInterfaces) + +
+ + + + + + + + + + + + + + + + + + +
Public Methods
+ + + final + + + boolean + + matches(Object item) + +
+ + + + + + + + + + + + + + + + +
Protected Methods
+ abstract + + + + + boolean + + matchesSafely(S item) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + org.hamcrest.BaseMatcher + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + org.hamcrest.Matcher + +
+ + +
+
+ +From interface + + org.hamcrest.SelfDescribing + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + BoundedMatcher + (Class<? extends S> expectedType) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + + + BoundedMatcher + (Class<?> expectedType, Class<?> interfaceType1, Class...<?> otherInterfaces) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + final + + + boolean + + matches + (Object item) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + +

Protected Methods

+ + + + + +
+

+ + protected + + + abstract + + boolean + + matchesSafely + (S item) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/CursorMatchers.html b/docs/html/reference/android/support/test/espresso/matcher/CursorMatchers.html new file mode 100644 index 00000000000..4af83e2a844 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/CursorMatchers.html @@ -0,0 +1,3688 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +CursorMatchers | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

CursorMatchers

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.matcher.CursorMatchers
+ + + + + + + +
+ + +

Class Overview

+

A collection of Hamcrest matchers that matches a data row in a Cursor. +
+

+ AdapterViews that are backed by a Cursor are very common. This class contains + + Matchers that can be used together with + onData(Matcher) to match a data row in a + Cursor. + The + Matchers can only operate on a single data row of the cursor and Espresso + internally moves the Cursor to the correct adapter position. +

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Matcher<Object> + + withRowBlob(String columnName, byte[] value) + +
+ Returns a + Matcher that matches a byte[] at a given column index in a Cursors + data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowBlob(int columnIndex, Matcher<byte[]> valueMatcher) + +
+ Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowBlob(int columnIndex, byte[] value) + +
+ Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowBlob(String columnName, Matcher<byte[]> valueMatcher) + +
+ Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowBlob(Matcher<String> columnPicker, Matcher<byte[]> valueMatcher) + +
+ Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowDouble(String columnName, double value) + +
+ Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowDouble(String columnName, Matcher<Double> valueMatcher) + +
+ Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowDouble(int columnIndex, double value) + +
+ Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowDouble(Matcher<String> columnNameMatcher, Matcher<Double> valueMatcher) + +
+ Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowDouble(int columnIndex, Matcher<Double> valueMatcher) + +
+ Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowFloat(String columnName, Matcher<Float> valueMatcher) + +
+ Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowFloat(int columnIndex, float value) + +
+ Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowFloat(String columnName, float value) + +
+ Returns a Matcher that matches a Float value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowFloat(Matcher<String> columnNameMatcher, Matcher<Float> valueMatcher) + +
+ Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowFloat(int columnIndex, Matcher<Float> valueMatcher) + +
+ Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowInt(String columnName, Matcher<Integer> valueMatcher) + +
+ Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowInt(int columnIndex, int value) + +
+ Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowInt(String columnName, int value) + +
+ Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowInt(int columnIndex, Matcher<Integer> valueMatcher) + +
+ Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowInt(Matcher<String> columnNameMatcher, Matcher<Integer> valueMatcher) + +
+ Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowLong(int columnIndex, Matcher<Long> valueMatcher) + +
+ Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowLong(int columnIndex, long value) + +
+ Returns a + Matcher that matches a Long value at a given column index in a + Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowLong(String columnName, long value) + +
+ Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowLong(String columnName, Matcher<Long> valueMatcher) + +
+ Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowLong(Matcher<String> columnNameMatcher, Matcher<Long> valueMatcher) + +
+ Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowShort(int columnIndex, Matcher<Short> valueMatcher) + +
+ Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowShort(String columnName, Matcher<Short> valueMatcher) + +
+ Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowShort(String columnName, short value) + +
+ Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowShort(Matcher<String> columnNameMatcher, Matcher<Short> valueMatcher) + +
+ Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowShort(int columnIndex, short value) + +
+ Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowString(String columnName, String value) + +
+ Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowString(int columnIndex, Matcher<String> valueMatcher) + +
+ Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowString(int columnIndex, String value) + +
+ Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowString(String columnName, Matcher<String> valueMatcher) + +
+ Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + static + + Matcher<Object> + + withRowString(Matcher<String> columnPicker, Matcher<String> valueMatcher) + +
+ Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowBlob + (String columnName, byte[] value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a byte[] at a given column index in a Cursors + data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + byte[] to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowBlob + (int columnIndex, Matcher<byte[]> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a byte[] +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowBlob + (int columnIndex, byte[] value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + byte[] to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowBlob + (String columnName, Matcher<byte[]> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a byte[] +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowBlob + (Matcher<String> columnPicker, Matcher<byte[]> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a byte[] at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnPicker + as a + Matcher of String
valueMatcher + a + Matcher that matches a byte[] +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowDouble + (String columnName, double value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + a double value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowDouble + (String columnName, Matcher<Double> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a Double value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowDouble + (int columnIndex, double value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + a double value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowDouble + (Matcher<String> columnNameMatcher, Matcher<Double> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnNameMatcher + as a + Matcher of String
valueMatcher + a + Matcher that matches a Double value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowDouble + (int columnIndex, Matcher<Double> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Double value at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a Double value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowFloat + (String columnName, Matcher<Float> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a Float value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowFloat + (int columnIndex, float value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + a float value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowFloat + (String columnName, float value) +

+
+
+ + + +
+
+ + + + +

Returns a Matcher that matches a Float value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + a float value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowFloat + (Matcher<String> columnNameMatcher, Matcher<Float> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnNameMatcher + as a + Matcher of String
valueMatcher + a + Matcher that matches a Float value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowFloat + (int columnIndex, Matcher<Float> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Float value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a Float value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowInt + (String columnName, Matcher<Integer> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a Integer value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowInt + (int columnIndex, int value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + a int value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowInt + (String columnName, int value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + a int value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowInt + (int columnIndex, Matcher<Integer> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a Integer value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowInt + (Matcher<String> columnNameMatcher, Matcher<Integer> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Integer value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnNameMatcher + as a + Matcher of String
valueMatcher + a + Matcher that matches a Integer value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowLong + (int columnIndex, Matcher<Long> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a Long value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowLong + (int columnIndex, long value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Long value at a given column index in a + Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + a long value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowLong + (String columnName, long value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + a long value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowLong + (String columnName, Matcher<Long> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a Long value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowLong + (Matcher<String> columnNameMatcher, Matcher<Long> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Long value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnNameMatcher + as a + Matcher of String
valueMatcher + a + Matcher that matches a Long value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowShort + (int columnIndex, Matcher<Short> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a Short value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowShort + (String columnName, Matcher<Short> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a Short value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowShort + (String columnName, short value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + a short value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowShort + (Matcher<String> columnNameMatcher, Matcher<Short> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnNameMatcher + as a + Matcher of String
valueMatcher + a + Matcher that matches a Short value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowShort + (int columnIndex, short value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a Short value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + a short value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowString + (String columnName, String value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
value + a String value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowString + (int columnIndex, Matcher<String> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
valueMatcher + a + Matcher that matches a String value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowString + (int columnIndex, String value) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnIndex + int column index
value + a String value to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowString + (String columnName, Matcher<String> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnName + as a String
valueMatcher + a + Matcher that matches a String value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Object> + + withRowString + (Matcher<String> columnPicker, Matcher<String> valueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a + Matcher that matches a String value at a given column index + in a Cursors data row. +

+
+
Parameters
+ + + + + + + +
columnPicker + as a + Matcher of String
valueMatcher + a + Matcher that matches a String value +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/LayoutMatchers.html b/docs/html/reference/android/support/test/espresso/matcher/LayoutMatchers.html new file mode 100644 index 00000000000..d6e78ec2b99 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/LayoutMatchers.html @@ -0,0 +1,1174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +LayoutMatchers | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

LayoutMatchers

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.matcher.LayoutMatchers
+ + + + + + + +
+ + +

Class Overview

+

A collection of hamcrest matches to detect typical layout issues. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Matcher + + hasEllipsizedText() + +
+ Matches TextView elements having ellipsized text. + + + +
+ +
+ + + + static + + Matcher + + hasMultilineText() + +
+ Matches TextView elements having multiline text. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Matcher + + hasEllipsizedText + () +

+
+
+ + + +
+
+ + + + +

Matches TextView elements having ellipsized text. If text is too long to fit into a TextView, + it can be either ellipsized ('Too long' shown as 'Too l…' or '… long') or cut off ('Too + long' shown as 'Too l'). Though acceptable in some cases, usually indicates bad user + experience. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher + + hasMultilineText + () +

+
+
+ + + +
+
+ + + + +

Matches TextView elements having multiline text. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/PreferenceMatchers.html b/docs/html/reference/android/support/test/espresso/matcher/PreferenceMatchers.html new file mode 100644 index 00000000000..1712e2841a1 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/PreferenceMatchers.html @@ -0,0 +1,1491 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PreferenceMatchers | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

PreferenceMatchers

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.matcher.PreferenceMatchers
+ + + + + + + +
+ + +

Class Overview

+

A collection of hamcrest matchers that match Preferences. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Matcher<Preference> + + isEnabled() + +
+ + + + static + + Matcher<Preference> + + withKey(String key) + +
+ + + + static + + Matcher<Preference> + + withKey(Matcher<String> keyMatcher) + +
+ + + + static + + Matcher<Preference> + + withSummary(int resourceId) + +
+ + + + static + + Matcher<Preference> + + withSummaryText(Matcher<String> summaryMatcher) + +
+ + + + static + + Matcher<Preference> + + withSummaryText(String summary) + +
+ + + + static + + Matcher<Preference> + + withTitle(int resourceId) + +
+ + + + static + + Matcher<Preference> + + withTitleText(String title) + +
+ + + + static + + Matcher<Preference> + + withTitleText(Matcher<String> titleMatcher) + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Matcher<Preference> + + isEnabled + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withKey + (String key) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withKey + (Matcher<String> keyMatcher) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withSummary + (int resourceId) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withSummaryText + (Matcher<String> summaryMatcher) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withSummaryText + (String summary) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withTitle + (int resourceId) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withTitleText + (String title) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Preference> + + withTitleText + (Matcher<String> titleMatcher) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/RootMatchers.html b/docs/html/reference/android/support/test/espresso/matcher/RootMatchers.html new file mode 100644 index 00000000000..39d8b877d8b --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/RootMatchers.html @@ -0,0 +1,1407 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RootMatchers | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

RootMatchers

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.matcher.RootMatchers
+ + + + + + + +
+ + +

Class Overview

+

A collection of matchers for Root objects. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+ public + static + final + Matcher<Root>DEFAULT + Espresso's default Root matcher. + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Matcher<Root> + + isDialog() + +
+ Matches Roots that are dialogs (i.e. + + + +
+ +
+ + + + static + + Matcher<Root> + + isFocusable() + +
+ Matches Roots that can take window focus. + + + +
+ +
+ + + + static + + Matcher<Root> + + isPlatformPopup() + +
+ Matches Roots that are popups - like autocomplete suggestions or the actionbar spinner. + + + +
+ +
+ + + + static + + Matcher<Root> + + isTouchable() + +
+ Matches Roots that can receive touch events. + + + +
+ +
+ + + + static + + Matcher<Root> + + withDecorView(Matcher<View> decorViewMatcher) + +
+ Matches Roots with decor views that match the given view matcher. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Fields

+ + + + + + +
+

+ + public + static + final + Matcher<Root> + + DEFAULT +

+
+ + + + +
+
+ + + + +

Espresso's default Root matcher. +

+ + +
+
+ + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Matcher<Root> + + isDialog + () +

+
+
+ + + +
+
+ + + + +

Matches Roots that are dialogs (i.e. is not a window of the currently resumed + activity). +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Root> + + isFocusable + () +

+
+
+ + + +
+
+ + + + +

Matches Roots that can take window focus. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Root> + + isPlatformPopup + () +

+
+
+ + + +
+
+ + + + +

Matches Roots that are popups - like autocomplete suggestions or the actionbar spinner. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Root> + + isTouchable + () +

+
+
+ + + +
+
+ + + + +

Matches Roots that can receive touch events. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<Root> + + withDecorView + (Matcher<View> decorViewMatcher) +

+
+
+ + + +
+
+ + + + +

Matches Roots with decor views that match the given view matcher. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.Visibility.html b/docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.Visibility.html new file mode 100644 index 00000000000..51f454fc7bf --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.Visibility.html @@ -0,0 +1,1627 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewMatchers.Visibility | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + final + + enum +

ViewMatchers.Visibility

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.espresso.matcher.ViewMatchers.Visibility
+ + + + + + + +
+ + +

Class Overview

+

Enumerates the possible list of values for View.getVisibility(). +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
ViewMatchers.Visibility GONE  +   + + + +
ViewMatchers.Visibility INVISIBLE  +   + + + +
ViewMatchers.Visibility VISIBLE  +   + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + int + + getValue() + +
+ + + + static + + ViewMatchers.Visibility + + valueOf(String name) + +
+ + + final + static + + Visibility[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + ViewMatchers.Visibility + + GONE +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + ViewMatchers.Visibility + + INVISIBLE +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + ViewMatchers.Visibility + + VISIBLE +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + int + + getValue + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + ViewMatchers.Visibility + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Visibility[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.html b/docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.html new file mode 100644 index 00000000000..7c11ed97b43 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/ViewMatchers.html @@ -0,0 +1,3800 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ViewMatchers | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ViewMatchers

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.matcher.ViewMatchers
+ + + + + + + +
+ + +

Class Overview

+

A collection of hamcrest matchers that match Views. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + enumViewMatchers.Visibility + Enumerates the possible list of values for View.getVisibility().  + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + <T> + void + + assertThat(String message, T actual, Matcher<T> matcher) + +
+ A replacement for MatcherAssert.assertThat that renders View objects nicely. + + + +
+ +
+ + + + static + <T> + void + + assertThat(T actual, Matcher<T> matcher) + +
+ A replacement for MatcherAssert.assertThat that renders View objects nicely. + + + +
+ +
+ + + + static + + Matcher<View> + + hasContentDescription() + +
+ Returns an + Matcher that matches Views with any content description. + + + +
+ +
+ + + + static + + Matcher<View> + + hasDescendant(Matcher<View> descendantMatcher) + +
+ Returns a matcher that matches Views based on the presence of a descendant in its + view hierarchy. + + + +
+ +
+ + + + static + + Matcher<View> + + hasFocus() + +
+ Returns a matcher that matches Views currently have focus. + + + +
+ +
+ + + + static + + Matcher<View> + + hasImeAction(int imeAction) + +
+ Returns a matcher that matches views that support input methods (e.g. + + + +
+ +
+ + + + static + + Matcher<View> + + hasImeAction(Matcher<Integer> imeActionMatcher) + +
+ Returns a matcher that matches views that support input methods (e.g. + + + +
+ +
+ + + + static + + Matcher<View> + + hasLinks() + +
+ Returns a matcher that matches TextViews that have links. + + + +
+ +
+ + + + static + + Matcher<View> + + hasSibling(Matcher<View> siblingMatcher) + +
+ Returns an + Matcher that matches Views based on their siblings. + + + +
+ +
+ + + + static + + Matcher<View> + + isAssignableFrom(Class<? extends View> clazz) + +
+ Returns a matcher that matches Views which are an instance of or subclass of the provided + class. + + + +
+ +
+ + + + static + + Matcher<View> + + isChecked() + +
+ Returns a matcher that accepts if and only if the view is a CompoundButton (or subtype of) + and is in checked state. + + + +
+ +
+ + + + static + + Matcher<View> + + isClickable() + +
+ Returns a matcher that matches Views that are clickable. + + + +
+ +
+ + + + static + + Matcher<View> + + isCompletelyDisplayed() + +
+ Returns a matcher which only accepts a view whose height and width fit perfectly within + the currently displayed region of this view. + + + +
+ +
+ + + + static + + Matcher<View> + + isDescendantOfA(Matcher<View> ancestorMatcher) + +
+ Returns a matcher that matches Views based on the given ancestor type. + + + +
+ +
+ + + + static + + Matcher<View> + + isDisplayed() + +
+ Returns a matcher that matches Views that are currently displayed on the screen to + the user. + + + +
+ +
+ + + + static + + Matcher<View> + + isDisplayingAtLeast(int areaPercentage) + +
+ Returns a matcher which accepts a view so long as a given percentage of that view's area is + not obscured by any other view and is thus visible to the user. + + + +
+ +
+ + + + static + + Matcher<View> + + isEnabled() + +
+ Returns a matcher that matches Views that are enabled. + + + +
+ +
+ + + + static + + Matcher<View> + + isFocusable() + +
+ Returns a matcher that matches Views that are focusable. + + + +
+ +
+ + + + static + + Matcher<View> + + isJavascriptEnabled() + +
+ Returns a matcher that matches WebView if they are evaluating Javascript. + + + +
+ +
+ + + + static + + Matcher<View> + + isNotChecked() + +
+ Returns a matcher that accepts if and only if the view is a CompoundButton (or subtype of) + and is not in checked state. + + + +
+ +
+ + + + static + + Matcher<View> + + isRoot() + +
+ Returns a matcher that matches root View. + + + +
+ +
+ + + + static + + Matcher<View> + + isSelected() + +
+ Returns a matcher that matches Views that are selected. + + + +
+ +
+ + + + static + + Matcher<View> + + supportsInputMethods() + +
+ Returns a matcher that matches views that support input methods. + + + +
+ +
+ + + + static + + Matcher<View> + + withChild(Matcher<View> childMatcher) + +
+ A matcher that returns true if and only if the view's child is accepted by the provided + matcher. + + + +
+ +
+ + + + static + + Matcher<View> + + withClassName(Matcher<String> classNameMatcher) + +
+ Returns a matcher that matches Views with class name matching the given matcher. + + + +
+ +
+ + + + static + + Matcher<View> + + withContentDescription(String text) + +
+ Returns an + Matcher that matches Views based on content description + property value. + + + +
+ +
+ + + + static + + Matcher<View> + + withContentDescription(Matcher<? extends CharSequence> charSequenceMatcher) + +
+ Returns an + Matcher that matches Views based on content description + property value. + + + +
+ +
+ + + + static + + Matcher<View> + + withEffectiveVisibility(ViewMatchers.Visibility visibility) + +
+ Returns a matcher that matches Views that have "effective" visibility set to the + given value. + + + +
+ +
+ + + + static + + Matcher<View> + + withHint(int resourceId) + +
+ Returns a matcher that matches a descendant of TextView that is displaying the hint + associated with the given resource id. + + + +
+ +
+ + + + static + + Matcher<View> + + withHint(Matcher<String> stringMatcher) + +
+ Returns a matcher that matches TextViews based on hint property value. + + + +
+ +
+ + + + static + + Matcher<View> + + withHint(String hintText) + +
+ Returns a matcher that matches TextView based on it's hint property value. + + + +
+ +
+ + + + static + + Matcher<View> + + withId(Matcher<Integer> integerMatcher) + +
+ Returns a matcher that matches Views based on resource ids. + + + +
+ +
+ + + + static + + Matcher<View> + + withId(int id) + +
+ Same as withId(is(int)), but attempts to look up resource name of the given id and use an + R.id.myView style description with describeTo. + + + +
+ +
+ + + + static + + Matcher<View> + + withParent(Matcher<View> parentMatcher) + +
+ A matcher that accepts a view if and only if the view's parent is accepted by the provided + matcher. + + + +
+ +
+ + + + static + + Matcher<View> + + withSpinnerText(String text) + +
+ Returns a matcher that matches Spinner based on it's selected item's toString value. + + + +
+ +
+ + + + static + + Matcher<View> + + withSpinnerText(int resourceId) + +
+ Returns a matcher that matches a descendant of Spinner that is displaying the string + of the selected item associated with the given resource id. + + + +
+ +
+ + + + static + + Matcher<View> + + withSpinnerText(Matcher<String> stringMatcher) + +
+ Returns a matcher that matches Spinners based on toString value of the selected item. + + + +
+ +
+ + + + static + + Matcher<View> + + withTagKey(int key, Matcher<Object> objectMatcher) + +
+ Returns a matcher that matches Views based on tag keys. + + + +
+ +
+ + + + static + + Matcher<View> + + withTagKey(int key) + +
+ Returns a matcher that matches View based on tag keys. + + + +
+ +
+ + + + static + + Matcher<View> + + withTagValue(Matcher<Object> tagValueMatcher) + +
+ Returns a matcher that matches Views based on tag property values. + + + +
+ +
+ + + + static + + Matcher<View> + + withText(String text) + +
+ Returns a matcher that matches TextView based on its text property value. + + + +
+ +
+ + + + static + + Matcher<View> + + withText(Matcher<String> stringMatcher) + +
+ Returns a matcher that matches TextViews based on text property value. + + + +
+ +
+ + + + static + + Matcher<View> + + withText(int resourceId) + +
+ Returns a matcher that matches a descendant of TextView that is displaying the string + associated with the given resource id. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + void + + assertThat + (String message, T actual, Matcher<T> matcher) +

+
+
+ + + +
+
+ + + + +

A replacement for MatcherAssert.assertThat that renders View objects nicely.

+
+
Parameters
+ + + + + + + + + + +
message + the message to display.
actual + the actual value.
matcher + a matcher that accepts or rejects actual. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + void + + assertThat + (T actual, Matcher<T> matcher) +

+
+
+ + + +
+
+ + + + +

A replacement for MatcherAssert.assertThat that renders View objects nicely.

+
+
Parameters
+ + + + + + + +
actual + the actual value.
matcher + a matcher that accepts or rejects actual. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasContentDescription + () +

+
+
+ + + +
+
+ + + + +

Returns an + Matcher that matches Views with any content description. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasDescendant + (Matcher<View> descendantMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views based on the presence of a descendant in its + view hierarchy.

+
+
Parameters
+ + + + +
descendantMatcher + the type of the descendant to match on +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasFocus + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views currently have focus. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasImeAction + (int imeAction) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches views that support input methods (e.g. EditText) and have the + specified IME action set in its EditorInfo.

+
+
Parameters
+ + + + +
imeAction + the IME action to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasImeAction + (Matcher<Integer> imeActionMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches views that support input methods (e.g. EditText) and have the + specified IME action set in its EditorInfo.

+
+
Parameters
+ + + + +
imeActionMatcher + a matcher for the IME action +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasLinks + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches TextViews that have links. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + hasSibling + (Matcher<View> siblingMatcher) +

+
+
+ + + +
+
+ + + + +

Returns an + Matcher that matches Views based on their siblings.
+
+ This may be particularly useful when a view cannot be uniquely selected on properties such as + text or R.id. For example: a call button is repeated several times in a contacts layout + and the only way to differentiate the call button view is by what appears next to it (e.g. + the unique name of the contact).

+
+
Parameters
+ + + + +
siblingMatcher + a + Matcher for the sibling of the view. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isAssignableFrom + (Class<? extends View> clazz) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views which are an instance of or subclass of the provided + class. Some versions of Hamcrest make the generic typing of this a nightmare, so we have a + special case for our users. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isChecked + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that accepts if and only if the view is a CompoundButton (or subtype of) + and is in checked state. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isClickable + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views that are clickable. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isCompletelyDisplayed + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher which only accepts a view whose height and width fit perfectly within + the currently displayed region of this view. +

+ There exist views (such as ScrollViews) whose height and width are larger then the physical + device screen by design. Such views will _never_ be completely displayed. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isDescendantOfA + (Matcher<View> ancestorMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views based on the given ancestor type.

+
+
Parameters
+ + + + +
ancestorMatcher + the type of the ancestor to match on +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isDisplayed + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views that are currently displayed on the screen to + the user. +

+ Note: isDisplayed will select views that are partially displayed (eg: the full + height/width of the view is greater then the height/width of the visible rectangle). + If you wish to ensure the entire rectangle this view draws is displayed to the user use + isCompletelyDisplayed. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isDisplayingAtLeast + (int areaPercentage) +

+
+
+ + + +
+
+ + + + +

Returns a matcher which accepts a view so long as a given percentage of that view's area is + not obscured by any other view and is thus visible to the user.

+
+
Parameters
+ + + + +
areaPercentage + an integer ranging from (0, 100] indicating how much percent of the + surface area of the view must be shown to the user to be accepted. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isEnabled + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views that are enabled. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isFocusable + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views that are focusable. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isJavascriptEnabled + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches WebView if they are evaluating Javascript. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isNotChecked + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that accepts if and only if the view is a CompoundButton (or subtype of) + and is not in checked state. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isRoot + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches root View. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + isSelected + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views that are selected. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + supportsInputMethods + () +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches views that support input methods. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withChild + (Matcher<View> childMatcher) +

+
+
+ + + +
+
+ + + + +

A matcher that returns true if and only if the view's child is accepted by the provided + matcher.

+
+
Parameters
+ + + + +
childMatcher + the matcher to apply on the child views. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withClassName + (Matcher<String> classNameMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views with class name matching the given matcher. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withContentDescription + (String text) +

+
+
+ + + +
+
+ + + + +

Returns an + Matcher that matches Views based on content description + property value. Sugar for withContentDescription(is("string")).

+
+
Parameters
+ + + + +
text + the text to match on. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withContentDescription + (Matcher<? extends CharSequence> charSequenceMatcher) +

+
+
+ + + +
+
+ + + + +

Returns an + Matcher that matches Views based on content description + property value.

+
+
Parameters
+ + + + +
charSequenceMatcher + a CharSequence + Matcher for the content description +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withEffectiveVisibility + (ViewMatchers.Visibility visibility) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views that have "effective" visibility set to the + given value. Effective visibility takes into account not only the view's visibility value, + but also that of its ancestors. In case of View.VISIBLE, this means that the view and all of + its ancestors have visibility=VISIBLE. In case of GONE and INVISIBLE, it's the opposite - + any GONE or INVISIBLE parent will make all of its children have their effective visibility. +

+ Note: Contrary to what the name may imply, view visibility does not directly translate into + whether the view is displayed on screen (use isDisplayed() for that). For example, + the view and + all of its ancestors can have visibility=VISIBLE, but the view may need to be scrolled to in + order to be actually visible to the user. Unless you're specifically targeting the visibility + value with your test, use isDisplayed. +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withHint + (int resourceId) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches a descendant of TextView that is displaying the hint + associated with the given resource id.

+
+
Parameters
+ + + + +
resourceId + the string resource the text view is expected to have as a hint. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withHint + (Matcher<String> stringMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches TextViews based on hint property value. Note: View's + hint property can be null.

+
+
Parameters
+ + + + +
stringMatcher + + Matcher of String with text to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withHint + (String hintText) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches TextView based on it's hint property value. Note: + View's Sugar for withHint(is("string")).

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withId + (Matcher<Integer> integerMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views based on resource ids. Note: Android resource + ids are not guaranteed to be unique. You may have to pair this matcher with another one to + guarantee a unique view selection.

+
+
Parameters
+ + + + +
integerMatcher + a Matcher for resource ids +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withId + (int id) +

+
+
+ + + +
+
+ + + + +

Same as withId(is(int)), but attempts to look up resource name of the given id and use an + R.id.myView style description with describeTo. If resource lookup is unavailable, at the time + describeTo is invoked, this will print out a simple "with id: %d". If resource lookup is + available, but looking up the name for the given id, fails, "with id: %d (resource name not + found)" will be returned as the description.

+
+
Parameters
+ + + + +
id + the resource id. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withParent + (Matcher<View> parentMatcher) +

+
+
+ + + +
+
+ + + + +

A matcher that accepts a view if and only if the view's parent is accepted by the provided + matcher.

+
+
Parameters
+ + + + +
parentMatcher + the matcher to apply on getParent. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withSpinnerText + (String text) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Spinner based on it's selected item's toString value. +

+ Note: Sugar for withSpinnerText(is("string")). +

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withSpinnerText + (int resourceId) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches a descendant of Spinner that is displaying the string + of the selected item associated with the given resource id.

+
+
Parameters
+ + + + +
resourceId + the string resource the text view is expected to hold. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withSpinnerText + (Matcher<String> stringMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Spinners based on toString value of the selected item.

+
+
Parameters
+ + + + +
stringMatcher + + Matcher of String with text to match. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withTagKey + (int key, Matcher<Object> objectMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views based on tag keys.

+
+
Parameters
+ + + + + + + +
key + to match
objectMatcher + Object to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withTagKey + (int key) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches View based on tag keys.

+
+
Parameters
+ + + + +
key + to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withTagValue + (Matcher<Object> tagValueMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches Views based on tag property values.

+
+
Parameters
+ + + + +
tagValueMatcher + a Matcher for the view's tag property value +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withText + (String text) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches TextView based on its text property value. Note: + View's Sugar for withText(is("string")).

+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withText + (Matcher<String> stringMatcher) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches TextViews based on text property value. Note: View's + text property is never null. If you setText(null) it will still be "". Do not use null + matcher.

+
+
Parameters
+ + + + +
stringMatcher + + Matcher of String with text to match +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Matcher<View> + + withText + (int resourceId) +

+
+
+ + + +
+
+ + + + +

Returns a matcher that matches a descendant of TextView that is displaying the string + associated with the given resource id.

+
+
Parameters
+ + + + +
resourceId + the string resource the text view is expected to hold. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/matcher/package-summary.html b/docs/html/reference/android/support/test/espresso/matcher/package-summary.html new file mode 100644 index 00000000000..ea9f5adf30e --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/matcher/package-summary.html @@ -0,0 +1,765 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso.matcher | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso.matcher

+
+ +
+ +
+ + + + + + + + + + + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BoundedMatcher<T, S extends T> + Some matcher sugar that lets you create a matcher for a given type + but only process items of a specific subtype of that matcher.  + + + +
CursorMatchers + A collection of Hamcrest matchers that matches a data row in a Cursor.  + + + +
LayoutMatchers + A collection of hamcrest matches to detect typical layout issues.  + + + +
PreferenceMatchers + A collection of hamcrest matchers that match Preferences.  + + + +
RootMatchers + A collection of matchers for Root objects.  + + + +
ViewMatchers + A collection of hamcrest matchers that match Views.  + + + +
+ +
+ + + + +

Enums

+
+ + + + + + + + + + +
ViewMatchers.Visibility + Enumerates the possible list of values for View.getVisibility().  + + + +
+ +
+ + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/package-summary.html b/docs/html/reference/android/support/test/espresso/package-summary.html new file mode 100644 index 00000000000..03fa25be70a --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/package-summary.html @@ -0,0 +1,1025 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso

+
+ +
+ +
+ + + + + + + + + + +

Interfaces

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspressoException + Used for identifying an exception as coming from the Espresso framework.  + + + +
FailureHandler + Handles failures that happen during test execution.  + + + +
IdlingResource + Represents a resource of an application under test which can cause asynchronous background work + to happen during test execution (e.g.  + + + +
IdlingResource.ResourceCallback + Registered by an IdlingResource to notify Espresso of a transition to idle.  + + + +
UiController + Provides base-level UI operations (such as injection of MotionEvents) that can be used to + build user actions such as clicks, scrolls, swipes, etc.  + + + +
ViewAction + Responsible for performing an interaction on the given View element.  + + + +
ViewAssertion + Responsible for performing assertions on a View element.  + + + +
ViewFinder + Uses matchers to locate particular views within the view hierarchy.  + + + +
+ +
+ + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AmbiguousViewMatcherException.Builder + Builder for AmbiguousViewMatcherException.  + + + +
DataInteraction + An interface to interact with data displayed in AdapterViews.  + + + +
Espresso + Entry point to the Espresso framework.  + + + +
GraphHolder + Holds Espresso's ObjectGraph.  + + + +
IdlingPolicies + Allows users fine grain control over idling policies.  + + + +
IdlingPolicy + Allows users to control idling idleTimeouts in Espresso.  + + + +
NoMatchingViewException.Builder + Builder for NoMatchingViewException.  + + + +
PerformException.Builder + Builder for PerformException.  + + + +
Root + Represents a root view in the application and optionally the layout params of the window holding + it.  + + + +
Root.Builder +   + + + +
ViewInteraction + Provides the primary interface for test authors to perform actions or asserts on views.  + + + +
+ +
+ + + + + + + +

Exceptions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AmbiguousViewMatcherException + An exception which indicates that a Matcher matched multiple views in the hierarchy when + only one view was expected.  + + + +
AppNotIdleException + An exception which indicates that the App has not become idle even after the specified duration.  + + + +
IdlingResourceTimeoutException + Indicates that an IdlingResource, which has been registered with the framework, has not + idled within the allowed time.  + + + +
InjectEventSecurityException + An checked Exception indicating that event injection failed with a + SecurityException.  + + + +
NoActivityResumedException + An exception which indicates that there are no activities in stage RESUMED.  + + + +
NoMatchingRootException + Indicates that a given matcher did not match any Roots (windows) from those that are + currently available.  + + + +
NoMatchingViewException + Indicates that a given matcher did not match any elements in the view hierarchy.  + + + +
PerformException + Indicates that an exception occurred while performing a ViewAction on the UI thread.  + + + +
+ +
+ + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/util/ActivityLifecycles.html b/docs/html/reference/android/support/test/espresso/util/ActivityLifecycles.html new file mode 100644 index 00000000000..5bbf461d341 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/util/ActivityLifecycles.html @@ -0,0 +1,1207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ActivityLifecycles | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

ActivityLifecycles

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.util.ActivityLifecycles
+ + + + + + + +
+ + +

Class Overview

+

Helper methods to understand ActivityLifecycle of the app. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + boolean + + hasForegroundActivities(ActivityLifecycleMonitor monitor) + +
+ Indicates whether or not an Activity in our app is currently in the foreground. + + + +
+ +
+ + + + static + + boolean + + hasVisibleActivities(ActivityLifecycleMonitor monitor) + +
+ Indicates whether or not an Activity exists in our app within the "Visible Lifetime" state. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + boolean + + hasForegroundActivities + (ActivityLifecycleMonitor monitor) +

+
+
+ + + +
+
+ + + + +

Indicates whether or not an Activity in our app is currently in the foreground. + +

The "Foreground lifetime" of an activity occurs after a call to onResume and before a call + to onPause. + +

During this time, the activity is in front of all other activities and is currently + receiving user input.

+
+
Parameters
+ + + + +
monitor + the ActivityLifecycleMonitor to use.
+
+
+
Returns
+
  • true if an activity exists in the foreground state. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + boolean + + hasVisibleActivities + (ActivityLifecycleMonitor monitor) +

+
+
+ + + +
+
+ + + + +

Indicates whether or not an Activity exists in our app within the "Visible Lifetime" state. + +

The "Visible Lifetime" is defined as an activity who's onStart() method has been called but + who's onStop() method has not been called. + +

During this time, the Activity may be visible to the user, and it may be receiving input + from the user. This time is a superset of the "Foreground lifetime' of the activity. + +

It may be the case that an application has activities in the "visible lifetime" but none in + the "Foreground lifetime." It may be the case that without user input an activity will shortly + transition into the "Foreground lifetime" in this state, however it also may not transition + without further user interaction.

+
+
Parameters
+ + + + +
monitor + the ActivityLifecycleMonitor to use
+
+
+
Returns
+
  • true if any activity exists within it's foreground lifetime. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/util/HumanReadables.html b/docs/html/reference/android/support/test/espresso/util/HumanReadables.html new file mode 100644 index 00000000000..5be127c1431 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/util/HumanReadables.html @@ -0,0 +1,1253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +HumanReadables | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

HumanReadables

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.util.HumanReadables
+ + + + + + + +
+ + +

Class Overview

+

Text converters for various Android objects. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + String + + describe(View v) + +
+ Transforms an arbitrary view into a string with (hopefully) enough debug info. + + + +
+ +
+ + + + static + + String + + describe(Cursor c) + +
+ + + + static + + String + + getViewHierarchyErrorMessage(View rootView, List<View> problemViews, String errorHeader, String problemViewSuffix) + +
+ Prints out an error message feature the view hierarchy starting at the rootView. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + String + + describe + (View v) +

+
+
+ + + +
+
+ + + + +

Transforms an arbitrary view into a string with (hopefully) enough debug info.

+
+
Parameters
+ + + + +
v + nullable view
+
+
+
Returns
+
  • a string for human consumption. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + String + + describe + (Cursor c) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + + + + String + + getViewHierarchyErrorMessage + (View rootView, List<View> problemViews, String errorHeader, String problemViewSuffix) +

+
+
+ + + +
+
+ + + + +

Prints out an error message feature the view hierarchy starting at the rootView.

+
+
Parameters
+ + + + + + + + + + + + + +
rootView + the root of the hierarchy tree to print out.
problemViews + list of the views that you would like to point out are causing the error + message or null, if you want to skip this feature.
errorHeader + the header of the error message (should contain the description of why the + error is happening).
problemViewSuffix + the message to append to the view description in the tree printout. + Required if problemViews is supplied. Otherwise, null is acceptable.
+
+
+
Returns
+
  • a string for human consumption. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance.html b/docs/html/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance.html new file mode 100644 index 00000000000..fe6c4e564fc --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance.html @@ -0,0 +1,1148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +TreeIterables.ViewAndDistance | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + static + + + class +

TreeIterables.ViewAndDistance

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.util.TreeIterables.ViewAndDistance
+ + + + + + + +
+ + +

Class Overview

+

Represents the distance a given view is from the root view. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + int + + getDistanceFromRoot() + +
+ + + + + + View + + getView() + +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + int + + getDistanceFromRoot + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + View + + getView + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/util/TreeIterables.html b/docs/html/reference/android/support/test/espresso/util/TreeIterables.html new file mode 100644 index 00000000000..952df09e67c --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/util/TreeIterables.html @@ -0,0 +1,1306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +TreeIterables | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

TreeIterables

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.espresso.util.TreeIterables
+ + + + + + + +
+ + +

Class Overview

+

Utility methods for iterating over tree structured items. + + Since the view hierarchy is a tree - having a method of iterating over its contents + is useful. + + This is generalized for any object which can display tree like qualities - but this + generalization was done for testability concerns (since creating View hierarchies is a pain). + + Only public methods of this utility class are considered public API of the test framework. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classTreeIterables.ViewAndDistance + Represents the distance a given view is from the root view.  + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Iterable<View> + + breadthFirstViewTraversal(View root) + +
+ Returns an iterable which iterates thru the provided view and its children in a + breadth-first, row-level-order traversal. + + + +
+ +
+ + + + static + + Iterable<View> + + depthFirstViewTraversal(View root) + +
+ Returns an iterable which iterates thru the provided view and its children in a + depth-first, in-order traversal. + + + +
+ +
+ + + + static + + Iterable<TreeIterables.ViewAndDistance> + + depthFirstViewTraversalWithDistance(View root) + +
+ Creates an iterable that traverses the tree formed by the given root. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Iterable<View> + + breadthFirstViewTraversal + (View root) +

+
+
+ + + +
+
+ + + + +

Returns an iterable which iterates thru the provided view and its children in a + breadth-first, row-level-order traversal. That is to say that for a view such as: + Root + / | \ + A R U + /| |\ + B D G N + Will be iterated: Root, A, R, U, B, D, G, N

+
+
Parameters
+ + + + +
root + the non-null, root view. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Iterable<View> + + depthFirstViewTraversal + (View root) +

+
+
+ + + +
+
+ + + + +

Returns an iterable which iterates thru the provided view and its children in a + depth-first, in-order traversal. That is to say that for a view such as: + Root + / | \ + A R U + /| |\ + B D G N + Will be iterated: Root, A, B, D, R, G, N, U.

+
+
Parameters
+ + + + +
root + the non-null, root view. +
+
+ +
+
+ + + + +
+

+ + public + static + + + + Iterable<TreeIterables.ViewAndDistance> + + depthFirstViewTraversalWithDistance + (View root) +

+
+
+ + + +
+
+ + + + +

Creates an iterable that traverses the tree formed by the given root. + + Along with iteration order, the distance from the root element is also tracked.

+
+
Parameters
+ + + + +
root + the root view to track from.
+
+
+
Returns
+
  • An iterable of ViewAndDistance containing the view tree in a depth first order with + the distance of a given node from the root. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/espresso/util/package-summary.html b/docs/html/reference/android/support/test/espresso/util/package-summary.html new file mode 100644 index 00000000000..474b44f27c2 --- /dev/null +++ b/docs/html/reference/android/support/test/espresso/util/package-summary.html @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.espresso.util | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.espresso.util

+
+ +
+ +
+ + + + + + + + + + + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ActivityLifecycles + Helper methods to understand ActivityLifecycle of the app.  + + + +
HumanReadables + Text converters for various Android objects.  + + + +
TreeIterables + Utility methods for iterating over tree structured items.  + + + +
TreeIterables.ViewAndDistance + Represents the distance a given view is from the root view.  + + + +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/filters/FlakyTest.html b/docs/html/reference/android/support/test/filters/FlakyTest.html new file mode 100644 index 00000000000..3e359d56943 --- /dev/null +++ b/docs/html/reference/android/support/test/filters/FlakyTest.html @@ -0,0 +1,916 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +FlakyTest | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + @interface +

FlakyTest

+ + + + + + implements + + Annotation + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.filters.FlakyTest
+ + + + + + + +
+ + +

Class Overview

+

Designates a test as being flaky (non-deterministic). +

+ Can then be used to filter tests on execution using -e annotation or -e notAnnotation as + desired. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From interface + + java.lang.annotation.Annotation + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/filters/RequiresDevice.html b/docs/html/reference/android/support/test/filters/RequiresDevice.html new file mode 100644 index 00000000000..f82c911a40f --- /dev/null +++ b/docs/html/reference/android/support/test/filters/RequiresDevice.html @@ -0,0 +1,915 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RequiresDevice | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + @interface +

RequiresDevice

+ + + + + + implements + + Annotation + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.filters.RequiresDevice
+ + + + + + + +
+ + +

Class Overview

+

Indicates that a specific test should not be run on emulator. +

+ It will be executed only if the test is running on the physical android device. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From interface + + java.lang.annotation.Annotation + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/filters/SdkSuppress.html b/docs/html/reference/android/support/test/filters/SdkSuppress.html new file mode 100644 index 00000000000..c38c0e33b48 --- /dev/null +++ b/docs/html/reference/android/support/test/filters/SdkSuppress.html @@ -0,0 +1,915 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +SdkSuppress | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + @interface +

SdkSuppress

+ + + + + + implements + + Annotation + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.filters.SdkSuppress
+ + + + + + + +
+ + +

Class Overview

+

Indicates that a specific test or class requires a minimum API Level to execute. +

+ Test(s) will be skipped when executed on android platforms less than specified level. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From interface + + java.lang.annotation.Annotation + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/filters/package-summary.html b/docs/html/reference/android/support/test/filters/package-summary.html new file mode 100644 index 00000000000..e93c0497c17 --- /dev/null +++ b/docs/html/reference/android/support/test/filters/package-summary.html @@ -0,0 +1,702 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.filters | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.filters

+
+ +
+ +
+ + + + + + + +

Annotations

+
+ + + + + + + + + + + + + + + + + + + + + + +
FlakyTest + Designates a test as being flaky (non-deterministic).  + + + +
RequiresDevice + Indicates that a specific test should not be run on emulator.  + + + +
SdkSuppress + Indicates that a specific test or class requires a minimum API Level to execute.  + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/package-summary.html b/docs/html/reference/android/support/test/package-summary.html new file mode 100644 index 00000000000..1377ae2300b --- /dev/null +++ b/docs/html/reference/android/support/test/package-summary.html @@ -0,0 +1,679 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test

+
+ +
+ +
+ + + + + + + + + + + + + +

Classes

+
+ + + + + + + + + + +
InstrumentationRegistry + An exposed registry instance that holds a reference to the instrumentation running in the + process and it's arguments.  + + + +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/AndroidJUnit4.html b/docs/html/reference/android/support/test/runner/AndroidJUnit4.html new file mode 100644 index 00000000000..ad6381c9867 --- /dev/null +++ b/docs/html/reference/android/support/test/runner/AndroidJUnit4.html @@ -0,0 +1,2213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AndroidJUnit4 | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

AndroidJUnit4

+ + + + + + + + + + + + + + + + + extends BlockJUnit4ClassRunner
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳org.junit.runner.Runner
    ↳org.junit.runners.ParentRunner<T>
     ↳org.junit.runners.BlockJUnit4ClassRunner
      ↳android.support.test.runner.AndroidJUnit4
+ + + + + + + +
+ + +

Class Overview

+

Aliases the current default Android JUnit 4 class runner, for future-proofing. If + future versions of JUnit change the default Runner class, they will also + change the definition of this class. Developers wanting to explicitly tag a + class as an Android JUnit 4 class should use @RunWith(AndroidJUnit4.class) +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + AndroidJUnit4(Class<?> klass, AndroidRunnerParams runnerParams) + +
+ Constructs a new instance of the default runner + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Protected Methods
+ + + + + + Statement + + withPotentialTimeout(FrameworkMethod method, Object test, Statement next) + +
+ Default to + Test level timeout if set. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + org.junit.runners.BlockJUnit4ClassRunner + +
+ + +
+
+ +From class + + org.junit.runners.ParentRunner + +
+ + +
+
+ +From class + + org.junit.runner.Runner + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + org.junit.runner.Describable + +
+ + +
+
+ +From interface + + org.junit.runner.manipulation.Filterable + +
+ + +
+
+ +From interface + + org.junit.runner.manipulation.Sortable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + AndroidJUnit4 + (Class<?> klass, AndroidRunnerParams runnerParams) +

+
+
+ + + +
+
+ + + + +

Constructs a new instance of the default runner +

+
+
Throws
+ + + + +
InitializationError +
+
+ +
+
+ + + + + + + + + + + + + + + + + +

Protected Methods

+ + + + + +
+

+ + protected + + + + + Statement + + withPotentialTimeout + (FrameworkMethod method, Object test, Statement next) +

+
+
+ + + +
+
+ + + + +

Default to + Test level timeout if set. Otherwise, set the timeout that was passed to the + instrumentation via argument +

+ +
+
+ + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/AndroidJUnitRunner.html b/docs/html/reference/android/support/test/runner/AndroidJUnitRunner.html new file mode 100644 index 00000000000..1979517a99b --- /dev/null +++ b/docs/html/reference/android/support/test/runner/AndroidJUnitRunner.html @@ -0,0 +1,3044 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +AndroidJUnitRunner | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

AndroidJUnitRunner

+ + + + + + + + + + + + + extends MonitoringInstrumentation
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.app.Instrumentation
    ↳android.support.test.runner.MonitoringInstrumentation
     ↳android.support.test.runner.AndroidJUnitRunner
+ + + + + + + +
+ + +

Class Overview

+

An Instrumentation that runs JUnit3 and JUnit4 tests against + an Android package (application). +

+ Currently experimental. Based on InstrumentationTestRunner. +

+ Will eventually support a superset of InstrumentationTestRunner features, + while maintaining command/output format compatibility with that class. + +

Typical Usage

+

+ Write JUnit3 style TestCases and/or JUnit4 style + + Tests that perform tests against the classes in your package. + Make use of the InstrumentationRegistry if needed. +

+ In an appropriate AndroidManifest.xml, define an instrumentation with android:name set to + AndroidJUnitRunner and the appropriate android:targetPackage + set. +

+ Execution options: +

+ Running all tests: adb shell am instrument -w + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ Running all tests in a class: adb shell am instrument -w + -e class com.android.foo.FooTest + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ Running a single test: adb shell am instrument -w + -e class com.android.foo.FooTest#testFoo + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ Running all tests in multiple classes: adb shell am instrument -w + -e class com.android.foo.FooTest,com.android.foo.TooTest + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ Running all tests listed in a file: adb shell am instrument -w + -e testFile /sdcard/tmp/testFile.txt com.android.foo/com.android.test.runner.AndroidJUnitRunner + The file should contain a list of line separated test classes and optionally methods (expected + format: com.android.foo.FooClassName#testMethodName). +

+ Running all tests in a java package: adb shell am instrument -w + -e package com.android.foo.bar + com.android.foo/android.support.test.runner.AndroidJUnitRunner + To debug your tests, set a break point in your code and pass: + -e debug true +

+ Running a specific test size i.e. annotated with + SmallTest or + MediumTest or + LargeTest: + adb shell am instrument -w -e size [small|medium|large] + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ Filter test run to tests with given annotation: adb shell am instrument -w + -e annotation com.android.foo.MyAnnotation + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ If used with other options, the resulting test run will contain the intersection of the two + options. + e.g. "-e size large -e annotation com.android.foo.MyAnnotation" will run only tests with both + the LargeTest and "com.android.foo.MyAnnotation" annotations. +

+ Filter test run to tests without given annotation: adb shell am instrument -w + -e notAnnotation com.android.foo.MyAnnotation + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ As above, if used with other options, the resulting test run will contain the intersection of + the two options. + e.g. "-e size large -e notAnnotation com.android.foo.MyAnnotation" will run tests with + the LargeTest annotation that do NOT have the "com.android.foo.MyAnnotation" annotations. +

+ Filter test run to tests without any of a list of annotations: adb shell am + instrument -w -e notAnnotation com.android.foo.MyAnnotation,com.android.foo.AnotherAnnotation + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ Filter test run to a shard of all tests, where numShards is an integer greater than 0 and + shardIndex is an integer between 0 (inclusive) and numShards (exclusive): adb shell am + instrument -w -e numShards 4 -e shardIndex 1 + com.android.foo/android.support.test.runner.AndroidJUnitRunner +

+ To run in 'log only' mode + -e log true + This option will load and iterate through all test classes and methods, but will bypass actual + test execution. Useful for quickly obtaining info on the tests to be executed by an + instrumentation command. +

+ To generate EMMA code coverage: + -e coverage true + Note: this requires an emma instrumented build. By default, the code coverage results file + will be saved in a /data//coverage.ec file, unless overridden by coverageFile flag (see + below) +

+ To specify EMMA code coverage results file path: + -e coverageFile /sdcard/myFile.ec +

+ To specify one or more + + RunListeners to observe the test run: + -e listener com.foo.Listener,com.foo.Listener2 +

+ OR, specify the multiple listeners in the AndroidManifest via a meta-data tag: + instrumentation android:name="android.support.test.runner.AndroidJUnitRunner" ... + meta-data android:name="listener" + android:value="com.foo.Listener,com.foo.Listener2" +

+ Set timeout (in milliseconds) that will be applied to each test: + -e timeout_msec 5000 +

+ Supported for both JUnit3 and JUnit4 style tests. For JUnit3 tests, this flag is the only way + to specify timeouts. For JUnit4 tests, this flag overrides timeouts specified via + + org.junit.rules.Timeout. Please note that in JUnit4 + + org.junit.Test#timeout() + annotation take precedence over both, this flag and + + org.junit.Test#timeout() + annotation. +

+ To disable Google Analytics: + -e disableAnalytics true +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Constants
StringARGUMENT_TEST_CLASS + + + + +
+ + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Constants
+ + From class +android.app.Instrumentation +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + AndroidJUnitRunner() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + finish(int resultCode, Bundle results) + +
+ Ensures all activities launched in this instrumentation are finished before the + instrumentation exits. + + + +
+ +
+ + + + + + Activity + + newActivity(Class<?> clazz, Context context, IBinder token, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance) + +
+ + + + + + void + + onCreate(Bundle arguments) + +
+ Sets up lifecycle monitoring, and argument registry. + + + +
+ +
+ + + + + + boolean + + onException(Object obj, Throwable e) + +
+ + + + + + void + + onStart() + +
+ This implementation of onStart() will guarantee that the Application's onCreate method + has completed when it returns. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + android.support.test.runner.MonitoringInstrumentation + +
+ + +
+
+ +From class + + android.app.Instrumentation + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + +

Constants

+ + + + + + +
+

+ + public + static + final + String + + ARGUMENT_TEST_CLASS +

+
+ + + + +
+
+ + + + +

+ + +
+ Constant Value: + + + "class" + + +
+ +
+
+ + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + AndroidJUnitRunner + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + finish + (int resultCode, Bundle results) +

+
+
+ + + +
+
+ + + + +

Ensures all activities launched in this instrumentation are finished before the + instrumentation exits. +

+ Subclasses who override this method should do their finish processing and then call + super.finish to invoke this logic. Not waiting for all activities to finish() before exiting + can cause device wide instability. +

+

+ +
+
+ + + + +
+

+ + public + + + + + Activity + + newActivity + (Class<?> clazz, Context context, IBinder token, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance) +

+
+
+ + + +
+
+ + + + +

+
+
Throws
+ + + + + + + +
InstantiationException +
IllegalAccessException +
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + onCreate + (Bundle arguments) +

+
+
+ + + +
+
+ + + + +

Sets up lifecycle monitoring, and argument registry. +

+ Subclasses must call up to onCreate(). This onCreate method does not call start() + it is the subclasses responsibility to call start if it desires. +

+

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + onException + (Object obj, Throwable e) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + onStart + () +

+
+
+ + + +
+
+ + + + +

This implementation of onStart() will guarantee that the Application's onCreate method + has completed when it returns. +

+ Subclasses should call super.onStart() before executing any code that touches the application + and it's state. +

+

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/MonitoringInstrumentation.ActivityFinisher.html b/docs/html/reference/android/support/test/runner/MonitoringInstrumentation.ActivityFinisher.html new file mode 100644 index 00000000000..19e4a2105a8 --- /dev/null +++ b/docs/html/reference/android/support/test/runner/MonitoringInstrumentation.ActivityFinisher.html @@ -0,0 +1,1222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +MonitoringInstrumentation.ActivityFinisher | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

MonitoringInstrumentation.ActivityFinisher

+ + + + + extends Object
+ + + + + + + implements + + Runnable + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.runner.MonitoringInstrumentation.ActivityFinisher
+ + + + + + + +
+ + +

Class Overview

+

Loops through all the activities that have not yet finished and explicitly calls finish + on them. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + MonitoringInstrumentation.ActivityFinisher() + +
+ + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + run() + +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + java.lang.Runnable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + MonitoringInstrumentation.ActivityFinisher + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + run + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/MonitoringInstrumentation.html b/docs/html/reference/android/support/test/runner/MonitoringInstrumentation.html new file mode 100644 index 00000000000..f5c9adfdadc --- /dev/null +++ b/docs/html/reference/android/support/test/runner/MonitoringInstrumentation.html @@ -0,0 +1,3150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +MonitoringInstrumentation | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

MonitoringInstrumentation

+ + + + + + + + + extends Instrumentation
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.app.Instrumentation
    ↳android.support.test.runner.MonitoringInstrumentation
+ + + + +
+ + Known Direct Subclasses + +
+ + +
+
+ + + + +
+ + +

Class Overview

+

An instrumentation that enables several advanced features and makes some hard guarantees about + the state of the application under instrumentation. +

+ A short list of these capabilities: +

    +
  • Forces Application.onCreate() to happen before Instrumentation.onStart() runs (ensuring your + code always runs in a sane state).
  • +
  • Logs application death due to exceptions.
  • +
  • Allows tracking of activity lifecycle states.
  • +
  • Registers instrumentation arguments in an easy to access place.
  • +
  • Ensures your activities are creating themselves in reasonable amounts of time.
  • +
  • Provides facilities to dump current app threads to test outputs.
  • +
  • Ensures all activities finish before instrumentation exits.
  • +
+ + This Instrumentation is *NOT* a test instrumentation (some of its subclasses are). It makes no + assumptions about what the subclass wants to do. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nested Classes
+ + + + + classMonitoringInstrumentation.ActivityFinisher + Loops through all the activities that have not yet finished and explicitly calls finish + on them.  + + + +
+ + + + + + + + +
+ [Expand] +
Inherited Constants
+ + From class +android.app.Instrumentation +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + MonitoringInstrumentation() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + callActivityOnCreate(Activity activity, Bundle bundle) + +
+ + + + + + void + + callActivityOnDestroy(Activity activity) + +
+ + + + + + void + + callActivityOnPause(Activity activity) + +
+ + + + + + void + + callActivityOnRestart(Activity activity) + +
+ + + + + + void + + callActivityOnResume(Activity activity) + +
+ + + + + + void + + callActivityOnStart(Activity activity) + +
+ + + + + + void + + callActivityOnStop(Activity activity) + +
+ + + + + + void + + finish(int resultCode, Bundle results) + +
+ Ensures all activities launched in this instrumentation are finished before the + instrumentation exits. + + + +
+ +
+ + + + + + void + + onCreate(Bundle arguments) + +
+ Sets up lifecycle monitoring, and argument registry. + + + +
+ +
+ + + + + + void + + onDestroy() + +
+ + + + + + boolean + + onException(Object obj, Throwable e) + +
+ + + + + + void + + onStart() + +
+ This implementation of onStart() will guarantee that the Application's onCreate method + has completed when it returns. + + + +
+ +
+ + + + + + Activity + + startActivitySync(Intent intent) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Protected Methods
+ + + final + + + void + + dumpThreadStateToOutputs(String outputFileName) + +
+ + + final + + + void + + specifyDexMakerCacheProperty() + +
+ + + + + + void + + waitForActivitiesToComplete() + +
+ Ensures we've onStopped() all activities which were onStarted(). + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + android.app.Instrumentation + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + MonitoringInstrumentation + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + callActivityOnCreate + (Activity activity, Bundle bundle) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + callActivityOnDestroy + (Activity activity) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + callActivityOnPause + (Activity activity) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + callActivityOnRestart + (Activity activity) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + callActivityOnResume + (Activity activity) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + callActivityOnStart + (Activity activity) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + callActivityOnStop + (Activity activity) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + finish + (int resultCode, Bundle results) +

+
+
+ + + +
+
+ + + + +

Ensures all activities launched in this instrumentation are finished before the + instrumentation exits. +

+ Subclasses who override this method should do their finish processing and then call + super.finish to invoke this logic. Not waiting for all activities to finish() before exiting + can cause device wide instability. +

+

+ +
+
+ + + + +
+

+ + public + + + + + void + + onCreate + (Bundle arguments) +

+
+
+ + + +
+
+ + + + +

Sets up lifecycle monitoring, and argument registry. +

+ Subclasses must call up to onCreate(). This onCreate method does not call start() + it is the subclasses responsibility to call start if it desires. +

+

+ +
+
+ + + + +
+

+ + public + + + + + void + + onDestroy + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + onException + (Object obj, Throwable e) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + + + + + void + + onStart + () +

+
+
+ + + +
+
+ + + + +

This implementation of onStart() will guarantee that the Application's onCreate method + has completed when it returns. +

+ Subclasses should call super.onStart() before executing any code that touches the application + and it's state. +

+

+ +
+
+ + + + +
+

+ + public + + + + + Activity + + startActivitySync + (Intent intent) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + +

Protected Methods

+ + + + + +
+

+ + protected + + final + + + void + + dumpThreadStateToOutputs + (String outputFileName) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + protected + + final + + + void + + specifyDexMakerCacheProperty + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + protected + + + + + void + + waitForActivitiesToComplete + () +

+
+
+ + + +
+
+ + + + +

Ensures we've onStopped() all activities which were onStarted(). +

+ According to Activity's contract, the process is not killable between onStart and onStop. + Breaking this contract (which finish() will if you let it) can cause bad behaviour (including + a full restart of system_server). +

+

+ We give the app 2 seconds to stop all its activities, then we proceed. +

+

+ +
+
+ + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleCallback.html b/docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleCallback.html new file mode 100644 index 00000000000..e164e24dbb2 --- /dev/null +++ b/docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleCallback.html @@ -0,0 +1,875 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ActivityLifecycleCallback | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

ActivityLifecycleCallback

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.runner.lifecycle.ActivityLifecycleCallback
+ + + + + + + +
+ + +

Class Overview

+

Callback for monitoring activity lifecycle events. These callbacks are invoked on the main + thread, so any long operations or violating the strict mode policies should be avoided. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + void + + onActivityLifecycleChanged(Activity activity, Stage stage) + +
+ Called on the main thread after an activity has processed its lifecycle change event + (for example onResume or onStart) + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + void + + onActivityLifecycleChanged + (Activity activity, Stage stage) +

+
+
+ + + +
+
+ + + + +

Called on the main thread after an activity has processed its lifecycle change event + (for example onResume or onStart)

+
+
Parameters
+ + + + + + + +
activity + The activity
stage + its current stage. +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleMonitor.html b/docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleMonitor.html new file mode 100644 index 00000000000..1e3815327c0 --- /dev/null +++ b/docs/html/reference/android/support/test/runner/lifecycle/ActivityLifecycleMonitor.html @@ -0,0 +1,1137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ActivityLifecycleMonitor | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

ActivityLifecycleMonitor

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.runner.lifecycle.ActivityLifecycleMonitor
+ + + + + + + +
+ + +

Class Overview

+

Interface for tests to use when they need to query the activity lifecycle state. +

+ Activity lifecycle changes occur only on the UI thread - therefore listeners registered with + an ActivityLifecycleMonitor should expect to be invoked on the UI thread. The direct query + methods can only be called on the UI thread because otherwise they would not be able to return + consistent responses. +

+

+ Retrieve instances of the monitor thru ActivityLifecycleMonitorRegistry. +

+

+ Detecting these lifecycle states requires support from Instrumentation, therefore do not expect + an instance to be present under any arbitrary instrumentation. +

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + void + + addLifecycleCallback(ActivityLifecycleCallback callback) + +
+ Adds a new callback that will be notified when lifecycle changes occur. + + + +
+ +
+ abstract + + + + + Collection<Activity> + + getActivitiesInStage(Stage stage) + +
+ Returns all activities in a given stage of their lifecycle. + + + +
+ +
+ abstract + + + + + Stage + + getLifecycleStageOf(Activity activity) + +
+ Returns the current lifecycle stage of a given activity. + + + +
+ +
+ abstract + + + + + void + + removeLifecycleCallback(ActivityLifecycleCallback callback) + +
+ Removes a previously registered lifecycle callback. + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + void + + addLifecycleCallback + (ActivityLifecycleCallback callback) +

+
+
+ + + +
+
+ + + + +

Adds a new callback that will be notified when lifecycle changes occur. +

+ Implementors will not hold a strong ref to the callback, the code which registers callbacks + is responsible for this. Code which registers callbacks should responsibly + remove their callback when it is no longer needed. +

+

+ Callbacks are executed on the main thread of the application, and should take care not to + block or otherwise perform expensive operations as it will directly impact the application. +

+
+
Parameters
+ + + + +
callback + an ActivityLifecycleCallback +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + Collection<Activity> + + getActivitiesInStage + (Stage stage) +

+
+
+ + + +
+
+ + + + +

Returns all activities in a given stage of their lifecycle. +

+ This method can only return a consistant and correct answer from the main thread, therefore + callers should always invoke it from the main thread and implementors are free to throw an + exception if the call is not made on the main thread. +

+

+ Implementors should ensure this method returns a consistant response if called from a + lifecycle callback also registered with this monitor (eg: it would be horriblely wrong if a + callback sees PAUSED and calls this method with the PAUSED and does not see its activity in + the response. +

+

+ Callers should be aware that the monitor implementation may not hold strong references to the + Activities in the application. Therefore stages which are considered end stages or eligible + for garbage collection on low memory situations may not return an instance of a particular + activity if it has been garbage collected.

+
+
Parameters
+ + + + +
stage + the stage to query for.
+
+
+
Returns
+
  • a snapshot Collection of activities in the given stage. This collection may be empty.
+
+
+
Throws
+ + + + +
IllegalStateException + if called from outside the main thread. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + Stage + + getLifecycleStageOf + (Activity activity) +

+
+
+ + + +
+
+ + + + +

Returns the current lifecycle stage of a given activity. +

+ This method can only return a consistant and correct answer + from the main thread, therefore callers should always invoke + it from the main thread and implementors are free to throw an + exception if the call is not made on the main thread. +

+

+ Implementors should ensure this method returns a consistant response if called from a + lifecycle callback also registered with this monitor (eg: it would be horriblely wrong if a + callback sees PAUSED and calls this method with the same activity and gets RESUMED. +

+
+
Parameters
+ + + + +
activity + an activity in this application.
+
+
+
Returns
+
  • the lifecycle stage this activity is in.
+
+
+
Throws
+ + + + + + + + + + +
IllegalArgumentException + if activity is unknown to the monitor.
NullPointerException + if activity is null.
IllegalStateException + if called off the main thread. +
+
+ +
+
+ + + + +
+

+ + public + + + abstract + + void + + removeLifecycleCallback + (ActivityLifecycleCallback callback) +

+
+
+ + + +
+
+ + + + +

Removes a previously registered lifecycle callback. +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/lifecycle/Stage.html b/docs/html/reference/android/support/test/runner/lifecycle/Stage.html new file mode 100644 index 00000000000..af7e9424ca1 --- /dev/null +++ b/docs/html/reference/android/support/test/runner/lifecycle/Stage.html @@ -0,0 +1,1793 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Stage | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + enum +

Stage

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.runner.lifecycle.Stage
+ + + + + + + +
+ + +

Class Overview

+

An enumeration of the lifecycle stages an activity undergoes. +

+ See the Activity javadoc for detailed documentation. +

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Stage CREATED  + Indicates that onCreate has been called.  + + + +
Stage DESTROYED  + Indicates that onDestroy has been called - system is shutting down the activity.  + + + +
Stage PAUSED  + Indicates that onPause has been called - activity is no longer in the foreground.  + + + +
Stage PRE_ON_CREATE  + Indicates that onCreate is being called before any onCreate code executes.  + + + +
Stage RESTARTED  + Indicates that onResume has been called - we have navigated back to the activity.  + + + +
Stage RESUMED  + Indicates that onResume has been called - activity is now visible to user.  + + + +
Stage STARTED  + Indicates that onStart has been called.  + + + +
Stage STOPPED  + Indicates that onStop has been called - activity is no longer visible to the user.  + + + +
+ + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Stage + + valueOf(String name) + +
+ + + final + static + + Stage[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Stage + + CREATED +

+
+ + + + +
+
+ + + + +

Indicates that onCreate has been called.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + DESTROYED +

+
+ + + + +
+
+ + + + +

Indicates that onDestroy has been called - system is shutting down the activity.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + PAUSED +

+
+ + + + +
+
+ + + + +

Indicates that onPause has been called - activity is no longer in the foreground.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + PRE_ON_CREATE +

+
+ + + + +
+
+ + + + +

Indicates that onCreate is being called before any onCreate code executes.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + RESTARTED +

+
+ + + + +
+
+ + + + +

Indicates that onResume has been called - we have navigated back to the activity.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + RESUMED +

+
+ + + + +
+
+ + + + +

Indicates that onResume has been called - activity is now visible to user.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + STARTED +

+
+ + + + +
+
+ + + + +

Indicates that onStart has been called.

+ + +
+
+ + + + + +
+

+ + public + static + final + Stage + + STOPPED +

+
+ + + + +
+
+ + + + +

Indicates that onStop has been called - activity is no longer visible to the user.

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Stage + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Stage[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/lifecycle/package-summary.html b/docs/html/reference/android/support/test/runner/lifecycle/package-summary.html new file mode 100644 index 00000000000..b613b8c8056 --- /dev/null +++ b/docs/html/reference/android/support/test/runner/lifecycle/package-summary.html @@ -0,0 +1,716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.runner.lifecycle | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.runner.lifecycle

+
+ +
+ +
+ + + + + + + + + + +

Interfaces

+
+ + + + + + + + + + + + + + + + +
ActivityLifecycleCallback + Callback for monitoring activity lifecycle events.  + + + +
ActivityLifecycleMonitor + Interface for tests to use when they need to query the activity lifecycle state.  + + + +
+ +
+ + + + + + + +

Enums

+
+ + + + + + + + + + +
Stage + An enumeration of the lifecycle stages an activity undergoes.  + + + +
+ +
+ + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/runner/package-summary.html b/docs/html/reference/android/support/test/runner/package-summary.html new file mode 100644 index 00000000000..82d6cf0850b --- /dev/null +++ b/docs/html/reference/android/support/test/runner/package-summary.html @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.runner | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+
+ + + + +
+
+ +
+ package +

android.support.test.runner

+
+ +
+ +
+ + + + + + + + + + + + + +

Classes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AndroidJUnit4 + Aliases the current default Android JUnit 4 class runner, for future-proofing.  + + + +
AndroidJUnitRunner + An Instrumentation that runs JUnit3 and JUnit4 tests against + an Android package (application).  + + + +
MonitoringInstrumentation + An instrumentation that enables several advanced features and makes some hard guarantees about + the state of the application under instrumentation.  + + + +
MonitoringInstrumentation.ActivityFinisher + Loops through all the activities that have not yet finished and explicitly calls finish + on them.  + + + +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/By.html b/docs/html/reference/android/support/test/uiautomator/By.html new file mode 100644 index 00000000000..2dcd3171e0b --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/By.html @@ -0,0 +1,3058 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +By | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

By

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.By
+ + + + + + + +
+ + +

Class Overview

+

By is a utility class which enables the creation of BySelectors in a concise + manner.

+ +

Its primary function is to provide static factory methods for constructing BySelectors + using a shortened syntax. For example, you would use findObject(By.text("foo")) rather + than findObject(new BySelector().text("foo")) to select UI elements with the text value + "foo".

+

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + BySelector + + checkable(boolean isCheckable) + +
+ Constructs a new BySelector and sets the checkable criteria. + + + +
+ +
+ + + + static + + BySelector + + checked(boolean isChecked) + +
+ Constructs a new BySelector and sets the checked criteria. + + + +
+ +
+ + + + static + + BySelector + + clazz(Pattern className) + +
+ Constructs a new BySelector and sets the class name criteria. + + + +
+ +
+ + + + static + + BySelector + + clazz(String className) + +
+ Constructs a new BySelector and sets the class name criteria. + + + +
+ +
+ + + + static + + BySelector + + clazz(Class clazz) + +
+ Constructs a new BySelector and sets the class name criteria. + + + +
+ +
+ + + + static + + BySelector + + clazz(String packageName, String className) + +
+ Constructs a new BySelector and sets the class name criteria. + + + +
+ +
+ + + + static + + BySelector + + clickable(boolean isClickable) + +
+ Constructs a new BySelector and sets the clickable criteria. + + + +
+ +
+ + + + static + + BySelector + + copy(BySelector original) + +
+ Constructs a new BySelector and copies the criteria from original. + + + +
+ +
+ + + + static + + BySelector + + depth(int depth) + +
+ Constructs a new BySelector and sets the depth criteria. + + + +
+ +
+ + + + static + + BySelector + + desc(Pattern contentDescription) + +
+ Constructs a new BySelector and sets the content description criteria. + + + +
+ +
+ + + + static + + BySelector + + desc(String contentDescription) + +
+ Constructs a new BySelector and sets the content description criteria. + + + +
+ +
+ + + + static + + BySelector + + descContains(String substring) + +
+ Constructs a new BySelector and sets the content description criteria. + + + +
+ +
+ + + + static + + BySelector + + descEndsWith(String substring) + +
+ Constructs a new BySelector and sets the content description criteria. + + + +
+ +
+ + + + static + + BySelector + + descStartsWith(String substring) + +
+ Constructs a new BySelector and sets the content description criteria. + + + +
+ +
+ + + + static + + BySelector + + enabled(boolean isEnabled) + +
+ Constructs a new BySelector and sets the enabled criteria. + + + +
+ +
+ + + + static + + BySelector + + focusable(boolean isFocusable) + +
+ Constructs a new BySelector and sets the focusable criteria. + + + +
+ +
+ + + + static + + BySelector + + focused(boolean isFocused) + +
+ Constructs a new BySelector and sets the focused criteria. + + + +
+ +
+ + + + static + + BySelector + + hasChild(BySelector childSelector) + +
+ Constructs a new BySelector and adds a child selector criteria. + + + +
+ +
+ + + + static + + BySelector + + hasDescendant(BySelector descendantSelector, int maxDepth) + +
+ Constructs a new BySelector and adds a descendant selector criteria. + + + +
+ +
+ + + + static + + BySelector + + hasDescendant(BySelector descendantSelector) + +
+ Constructs a new BySelector and adds a descendant selector criteria. + + + +
+ +
+ + + + static + + BySelector + + longClickable(boolean isLongClickable) + +
+ Constructs a new BySelector and sets the long clickable criteria. + + + +
+ +
+ + + + static + + BySelector + + pkg(String applicationPackage) + +
+ Constructs a new BySelector and sets the application package name criteria. + + + +
+ +
+ + + + static + + BySelector + + pkg(Pattern applicationPackage) + +
+ Constructs a new BySelector and sets the application package name criteria. + + + +
+ +
+ + + + static + + BySelector + + res(String resourceName) + +
+ Constructs a new BySelector and sets the resource name criteria. + + + +
+ +
+ + + + static + + BySelector + + res(Pattern resourceName) + +
+ Constructs a new BySelector and sets the resource id criteria. + + + +
+ +
+ + + + static + + BySelector + + res(String resourcePackage, String resourceId) + +
+ Constructs a new BySelector and sets the resource name criteria. + + + +
+ +
+ + + + static + + BySelector + + scrollable(boolean isScrollable) + +
+ Constructs a new BySelector and sets the scrollable criteria. + + + +
+ +
+ + + + static + + BySelector + + selected(boolean isSelected) + +
+ Constructs a new BySelector and sets the selected criteria. + + + +
+ +
+ + + + static + + BySelector + + text(Pattern regex) + +
+ Constructs a new BySelector and sets the text value criteria. + + + +
+ +
+ + + + static + + BySelector + + text(String text) + +
+ Constructs a new BySelector and sets the text value criteria. + + + +
+ +
+ + + + static + + BySelector + + textContains(String substring) + +
+ Constructs a new BySelector and sets the text value criteria. + + + +
+ +
+ + + + static + + BySelector + + textEndsWith(String substring) + +
+ Constructs a new BySelector and sets the text value criteria. + + + +
+ +
+ + + + static + + BySelector + + textStartsWith(String substring) + +
+ Constructs a new BySelector and sets the text value criteria. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + BySelector + + checkable + (boolean isCheckable) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the checkable criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + checked + (boolean isChecked) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the checked criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + clazz + (Pattern className) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the class name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + clazz + (String className) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the class name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + clazz + (Class clazz) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the class name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + clazz + (String packageName, String className) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the class name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + clickable + (boolean isClickable) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the clickable criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + copy + (BySelector original) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and copies the criteria from original. +

+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + depth + (int depth) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the depth criteria. +

+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + desc + (Pattern contentDescription) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the content description criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + desc + (String contentDescription) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the content description criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + descContains + (String substring) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the content description criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + descEndsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the content description criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + descStartsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the content description criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + enabled + (boolean isEnabled) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the enabled criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + focusable + (boolean isFocusable) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the focusable criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + focused + (boolean isFocused) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the focused criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + hasChild + (BySelector childSelector) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and adds a child selector criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + hasDescendant + (BySelector descendantSelector, int maxDepth) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and adds a descendant selector criteria.

+ + +
+
+ + + + +
+

+ + public + static + + + + BySelector + + hasDescendant + (BySelector descendantSelector) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and adds a descendant selector criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + longClickable + (boolean isLongClickable) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the long clickable criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + pkg + (String applicationPackage) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the application package name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + pkg + (Pattern applicationPackage) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the application package name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + res + (String resourceName) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the resource name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + res + (Pattern resourceName) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the resource id criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + res + (String resourcePackage, String resourceId) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the resource name criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + scrollable + (boolean isScrollable) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the scrollable criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + selected + (boolean isSelected) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the selected criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + text + (Pattern regex) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the text value criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + text + (String text) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the text value criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + textContains + (String substring) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the text value criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + textEndsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the text value criteria.

+
+
See Also
+ +
+ +
+
+ + + + +
+

+ + public + static + + + + BySelector + + textStartsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Constructs a new BySelector and sets the text value criteria.

+
+
See Also
+ +
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/BySelector.html b/docs/html/reference/android/support/test/uiautomator/BySelector.html new file mode 100644 index 00000000000..4f0b9b1410d --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/BySelector.html @@ -0,0 +1,3563 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BySelector | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

BySelector

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.BySelector
+ + + + + + + +
+ + +

Class Overview

+

A BySelector specifies criteria for matching UI elements during a call to + findObject(BySelector). +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + BySelector + + checkable(boolean isCheckable) + +
+ Sets the search criteria to match elements that are checkable or not checkable. + + + +
+ +
+ + + + + + BySelector + + checked(boolean isChecked) + +
+ Sets the search criteria to match elements that are checked or unchecked. + + + +
+ +
+ + + + + + BySelector + + clazz(Pattern className) + +
+ Sets the class name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + clazz(String className) + +
+ Sets the class name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + clazz(Class clazz) + +
+ Sets the class name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + clazz(String packageName, String className) + +
+ Sets the class name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + clickable(boolean isClickable) + +
+ Sets the search criteria to match elements that are clickable or not clickable. + + + +
+ +
+ + + + + + BySelector + + depth(int exactDepth) + +
+ Sets the search criteria to match elements that are at a certain depth. + + + +
+ +
+ + + + + + BySelector + + depth(int min, int max) + +
+ Sets the search criteria to match elements that are in a range of depths. + + + +
+ +
+ + + + + + BySelector + + desc(Pattern contentDescription) + +
+ Sets the content description criteria for matching. + + + +
+ +
+ + + + + + BySelector + + desc(String contentDescription) + +
+ Sets the content description criteria for matching. + + + +
+ +
+ + + + + + BySelector + + descContains(String substring) + +
+ Sets the content description criteria for matching. + + + +
+ +
+ + + + + + BySelector + + descEndsWith(String substring) + +
+ Sets the content description criteria for matching. + + + +
+ +
+ + + + + + BySelector + + descStartsWith(String substring) + +
+ Sets the content description criteria for matching. + + + +
+ +
+ + + + + + BySelector + + enabled(boolean isEnabled) + +
+ Sets the search criteria to match elements that are enabled or disabled. + + + +
+ +
+ + + + + + BySelector + + focusable(boolean isFocusable) + +
+ Sets the search criteria to match elements that are focusable or not focusable. + + + +
+ +
+ + + + + + BySelector + + focused(boolean isFocused) + +
+ Sets the search criteria to match elements that are focused or unfocused. + + + +
+ +
+ + + + + + BySelector + + hasChild(BySelector childSelector) + +
+ Adds a child selector criteria for matching. + + + +
+ +
+ + + + + + BySelector + + hasDescendant(BySelector descendantSelector, int maxDepth) + +
+ Adds a descendant selector criteria for matching. + + + +
+ +
+ + + + + + BySelector + + hasDescendant(BySelector descendantSelector) + +
+ Adds a descendant selector criteria for matching. + + + +
+ +
+ + + + + + BySelector + + longClickable(boolean isLongClickable) + +
+ Sets the search criteria to match elements that are long clickable or not long clickable. + + + +
+ +
+ + + + + + BySelector + + maxDepth(int max) + +
+ Sets the search criteria to match elements that are no more than a certain depth. + + + +
+ +
+ + + + + + BySelector + + minDepth(int min) + +
+ Sets the search criteria to match elements that are at least a certain depth. + + + +
+ +
+ + + + + + BySelector + + pkg(String applicationPackage) + +
+ Sets the application package name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + pkg(Pattern applicationPackage) + +
+ Sets the package name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + res(String resourceName) + +
+ Sets the resource name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + res(Pattern resourceName) + +
+ Sets the resource name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + res(String resourcePackage, String resourceId) + +
+ Sets the resource name criteria for matching. + + + +
+ +
+ + + + + + BySelector + + scrollable(boolean isScrollable) + +
+ Sets the search criteria to match elements that are scrollable or not scrollable. + + + +
+ +
+ + + + + + BySelector + + selected(boolean isSelected) + +
+ Sets the search criteria to match elements that are selected or not selected. + + + +
+ +
+ + + + + + BySelector + + text(Pattern textValue) + +
+ Sets the text value criteria for matching. + + + +
+ +
+ + + + + + BySelector + + text(String textValue) + +
+ Sets the text value criteria for matching. + + + +
+ +
+ + + + + + BySelector + + textContains(String substring) + +
+ Sets the text value criteria for matching. + + + +
+ +
+ + + + + + BySelector + + textEndsWith(String substring) + +
+ Sets the text value criteria for matching. + + + +
+ +
+ + + + + + BySelector + + textStartsWith(String substring) + +
+ Sets the text value criteria for matching. + + + +
+ +
+ + + + + + String + + toString() + +
+ Returns a String representation of this BySelector. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + BySelector + + checkable + (boolean isCheckable) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are checkable or not checkable.

+
+
Parameters
+ + + + +
isCheckable + Whether to match elements that are checkable or elements that are not + checkable.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + checked + (boolean isChecked) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are checked or unchecked.

+
+
Parameters
+ + + + +
isChecked + Whether to match elements that are checked or elements that are unchecked.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + clazz + (Pattern className) +

+
+
+ + + +
+
+ + + + +

Sets the class name criteria for matching. A UI element will be considered a match if its + full class name matches the className Pattern and all other criteria for this + selector are met.

+
+
Parameters
+ + + + +
className + The Pattern to be used for matching.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + clazz + (String className) +

+
+
+ + + +
+
+ + + + +

Sets the class name criteria for matching. A UI element will be considered a match if its + class name exactly matches the className parameter and all other criteria for + this selector are met. If className starts with a period, it is assumed to be in the + android.widget package.

+
+
Parameters
+ + + + +
className + The full class name value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + clazz + (Class clazz) +

+
+
+ + + +
+
+ + + + +

Sets the class name criteria for matching. A UI element will be considered a match if its + class name matches clazz and all other criteria for this selector are met.

+
+
Parameters
+ + + + +
clazz + The class to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + clazz + (String packageName, String className) +

+
+
+ + + +
+
+ + + + +

Sets the class name criteria for matching. A UI element will be considered a match if its + package and class name exactly match the packageName and className parameters + and all other criteria for this selector are met.

+
+
Parameters
+ + + + + + + +
packageName + The package value to match.
className + The class name value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + clickable + (boolean isClickable) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are clickable or not clickable.

+
+
Parameters
+ + + + +
isClickable + Whether to match elements that are clickable or elements that are not + clickable.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + depth + (int exactDepth) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are at a certain depth.

+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + depth + (int min, int max) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are in a range of depths.

+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + desc + (Pattern contentDescription) +

+
+
+ + + +
+
+ + + + +

Sets the content description criteria for matching. A UI element will be considered a match + if its content description matches the contentDescription Pattern and all + other criteria for this selector are met.

+
+
Parameters
+ + + + +
contentDescription + The Pattern to be used for matching.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + desc + (String contentDescription) +

+
+
+ + + +
+
+ + + + +

Sets the content description criteria for matching. A UI element will be considered a match + if its content description exactly matches the contentDescription parameter and all + other criteria for this selector are met.

+
+
Parameters
+ + + + +
contentDescription + The exact value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + descContains + (String substring) +

+
+
+ + + +
+
+ + + + +

Sets the content description criteria for matching. A UI element will be considered a match + if its content description contains the substring parameter and all other criteria + for this selector are met.

+
+
Parameters
+ + + + +
substring + The substring to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + descEndsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Sets the content description criteria for matching. A UI element will be considered a match + if its content description ends with the substring parameter and all other criteria + for this selector are met.

+
+
Parameters
+ + + + +
substring + The substring to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + descStartsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Sets the content description criteria for matching. A UI element will be considered a match + if its content description starts with the substring parameter and all other criteria + for this selector are met.

+
+
Parameters
+ + + + +
substring + The substring to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + enabled + (boolean isEnabled) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are enabled or disabled.

+
+
Parameters
+ + + + +
isEnabled + Whether to match elements that are enabled or elements that are disabled.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + focusable + (boolean isFocusable) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are focusable or not focusable.

+
+
Parameters
+ + + + +
isFocusable + Whether to match elements that are focusable or elements that are not + focusable.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + focused + (boolean isFocused) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are focused or unfocused.

+
+
Parameters
+ + + + +
isFocused + Whether to match elements that are focused or elements that are unfocused.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + hasChild + (BySelector childSelector) +

+
+
+ + + +
+
+ + + + +

Adds a child selector criteria for matching. A UI element will be considered a match if it + has a child element (direct descendant) which matches the childSelector and all + other criteria for this selector are met. If specified more than once, matches must be found + for all childSelectors.

+
+
Parameters
+ + + + +
childSelector + The selector used to find a matching child element.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + hasDescendant + (BySelector descendantSelector, int maxDepth) +

+
+
+ + + +
+
+ + + + +

Adds a descendant selector criteria for matching. A UI element will be considered a match if + it has a descendant element which matches the descendantSelector and all other + criteria for this selector are met. If specified more than once, matches must be found for + all descendantSelectors.

+
+
Parameters
+ + + + + + + +
descendantSelector + The selector used to find a matching descendant element.
maxDepth + The maximum depth under the element to search the descendant.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + hasDescendant + (BySelector descendantSelector) +

+
+
+ + + +
+
+ + + + +

Adds a descendant selector criteria for matching. A UI element will be considered a match if + it has a descendant element which matches the descendantSelector and all other + criteria for this selector are met. If specified more than once, matches must be found for + all descendantSelectors.

+
+
Parameters
+ + + + +
descendantSelector + The selector used to find a matching descendant element.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + longClickable + (boolean isLongClickable) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are long clickable or not long clickable.

+
+
Parameters
+ + + + +
isLongClickable + Whether to match elements that are long clickable or elements that are + not long clickable.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + maxDepth + (int max) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are no more than a certain depth.

+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + minDepth + (int min) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are at least a certain depth.

+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + pkg + (String applicationPackage) +

+
+
+ + + +
+
+ + + + +

Sets the application package name criteria for matching. A UI element will be considered a + match if its application package name exactly matches the applicationPackage + parameter and all other criteria for this selector are met.

+
+
Parameters
+ + + + +
applicationPackage + The exact value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + pkg + (Pattern applicationPackage) +

+
+
+ + + +
+
+ + + + +

Sets the package name criteria for matching. A UI element will be considered a match if its + application package name matches the applicationPackage Pattern and all other + criteria for this selector are met.

+
+
Parameters
+ + + + +
applicationPackage + The Pattern to be used for matching.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + res + (String resourceName) +

+
+
+ + + +
+
+ + + + +

Sets the resource name criteria for matching. A UI element will be considered a match if its + resource name exactly matches the resourceName parameter and all other criteria for + this selector are met.

+
+
Parameters
+ + + + +
resourceName + The exact value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + res + (Pattern resourceName) +

+
+
+ + + +
+
+ + + + +

Sets the resource name criteria for matching. A UI element will be considered a match if its + resource name matches the resourceName Pattern and all other criteria for + this selector are met.

+
+
Parameters
+ + + + +
resourceName + The Pattern to be used for matching.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + res + (String resourcePackage, String resourceId) +

+
+
+ + + +
+
+ + + + +

Sets the resource name criteria for matching. A UI element will be considered a match if its + resource package and resource id exactly match the resourcePackage and + resourceId parameters and all other criteria for this selector are met.

+
+
Parameters
+ + + + + + + +
resourcePackage + The resource package value to match.
resourceId + The resouce-id value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + scrollable + (boolean isScrollable) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are scrollable or not scrollable.

+
+
Parameters
+ + + + +
isScrollable + Whether to match elements that are scrollable or elements that are not + scrollable.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + selected + (boolean isSelected) +

+
+
+ + + +
+
+ + + + +

Sets the search criteria to match elements that are selected or not selected.

+
+
Parameters
+ + + + +
isSelected + Whether to match elements that are selected or elements that are not + selected.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + text + (Pattern textValue) +

+
+
+ + + +
+
+ + + + +

Sets the text value criteria for matching. A UI element will be considered a match if its + text value matches the textValue Pattern and all other criteria for this + selector are met.

+
+
Parameters
+ + + + +
textValue + The Pattern to be used for matching.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + text + (String textValue) +

+
+
+ + + +
+
+ + + + +

Sets the text value criteria for matching. A UI element will be considered a match if its + text value exactly matches the textValue parameter and all other criteria for this + selector are met.

+
+
Parameters
+ + + + +
textValue + The exact value to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + textContains + (String substring) +

+
+
+ + + +
+
+ + + + +

Sets the text value criteria for matching. A UI element will be considered a match if its + text value contains the substring parameter and all other criteria for this selector + are met.

+
+
Parameters
+ + + + +
substring + The substring to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + textEndsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Sets the text value criteria for matching. A UI element will be considered a match if its + text value ends with the substring parameter and all other criteria for this selector + are met.

+
+
Parameters
+ + + + +
substring + The substring to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + BySelector + + textStartsWith + (String substring) +

+
+
+ + + +
+
+ + + + +

Sets the text value criteria for matching. A UI element will be considered a match if its + text value starts with the substring parameter and all other criteria for this + selector are met.

+
+
Parameters
+ + + + +
substring + The substring to match.
+
+
+
Returns
+ +
+ +
+
+ + + + +
+

+ + public + + + + + String + + toString + () +

+
+
+ + + +
+
+ + + + +

Returns a String representation of this BySelector. The format is + "BySelector [<KEY>='<VALUE> ... ]". Each criteria is listed as a key-value pair + where the key is the name of the criteria expressed in all caps (e.g. CLAZZ, RES, etc). +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/Configurator.html b/docs/html/reference/android/support/test/uiautomator/Configurator.html new file mode 100644 index 00000000000..ca448efc1fb --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/Configurator.html @@ -0,0 +1,1842 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Configurator | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + class +

Configurator

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.Configurator
+ + + + + + + +
+ + +

Class Overview

+

Allows you to set key parameters for running uiautomator tests. The new + settings take effect immediately and can be changed any time during a test run. + + To modify parameters using Configurator, first obtain an instance by calling + getInstance(). As a best practice, make sure you always save + the original value of any parameter that you are modifying. After running your + tests with the modified parameters, make sure to also restore + the original parameter values, otherwise this will impact other tests cases.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + long + + getActionAcknowledgmentTimeout() + +
+ Gets the current timeout for waiting for an acknowledgment of generic + uiautomator actions, such as clicks, text setting, and menu presses. + + + +
+ +
+ + + + static + + Configurator + + getInstance() + +
+ Retrieves a singleton instance of Configurator. + + + +
+ +
+ + + + + + long + + getKeyInjectionDelay() + +
+ Gets the current delay between key presses when injecting text input. + + + +
+ +
+ + + + + + long + + getScrollAcknowledgmentTimeout() + +
+ Gets the timeout for waiting for an acknowledgement of an + uiautomtor scroll swipe action. + + + +
+ +
+ + + + + + long + + getWaitForIdleTimeout() + +
+ Gets the current timeout used for waiting for the user interface to go + into an idle state. + + + +
+ +
+ + + + + + long + + getWaitForSelectorTimeout() + +
+ Gets the current timeout for waiting for a widget to become visible in + the user interface so that it can be matched by a selector. + + + +
+ +
+ + + + + + Configurator + + setActionAcknowledgmentTimeout(long timeout) + +
+ Sets the timeout for waiting for an acknowledgment of generic uiautomator + actions, such as clicks, text setting, and menu presses. + + + +
+ +
+ + + + + + Configurator + + setKeyInjectionDelay(long delay) + +
+ Sets a delay between key presses when injecting text input. + + + +
+ +
+ + + + + + Configurator + + setScrollAcknowledgmentTimeout(long timeout) + +
+ Sets the timeout for waiting for an acknowledgement of an + uiautomtor scroll swipe action. + + + +
+ +
+ + + + + + Configurator + + setWaitForIdleTimeout(long timeout) + +
+ Sets the timeout for waiting for the user interface to go into an idle + state before starting a uiautomator action. + + + +
+ +
+ + + + + + Configurator + + setWaitForSelectorTimeout(long timeout) + +
+ Sets the timeout for waiting for a widget to become visible in the user + interface so that it can be matched by a selector. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + long + + getActionAcknowledgmentTimeout + () +

+
+
+ + + +
+
+ + + + +

Gets the current timeout for waiting for an acknowledgment of generic + uiautomator actions, such as clicks, text setting, and menu presses. + + The acknowledgment is an AccessibilityEvent, + corresponding to an action, that lets the framework determine if the + action was successful. Generally, this timeout should not be modified. + See UiObject

+
+
Returns
+
  • current timeout in milliseconds
+
+ +
+
+ + + + +
+

+ + public + static + + + + Configurator + + getInstance + () +

+
+
+ + + +
+
+ + + + +

Retrieves a singleton instance of Configurator.

+
+
Returns
+
  • Configurator instance
+
+ +
+
+ + + + +
+

+ + public + + + + + long + + getKeyInjectionDelay + () +

+
+
+ + + +
+
+ + + + +

Gets the current delay between key presses when injecting text input. + See setText(String)

+
+
Returns
+
  • current delay in milliseconds
+
+ +
+
+ + + + +
+

+ + public + + + + + long + + getScrollAcknowledgmentTimeout + () +

+
+
+ + + +
+
+ + + + +

Gets the timeout for waiting for an acknowledgement of an + uiautomtor scroll swipe action. + + The acknowledgment is an AccessibilityEvent, + corresponding to the scroll action, that lets the framework determine if + the scroll action was successful. Generally, this timeout should not be modified. + See UiScrollable

+
+
Returns
+
  • current timeout in milliseconds
+
+ +
+
+ + + + +
+

+ + public + + + + + long + + getWaitForIdleTimeout + () +

+
+
+ + + +
+
+ + + + +

Gets the current timeout used for waiting for the user interface to go + into an idle state. + + By default, all core uiautomator objects except UiDevice will perform + this wait before starting to search for the widget specified by the + object's UiSelector. Once the idle state is detected or the + timeout elapses (whichever occurs first), the object will start to wait + for the selector to find a match. + See setWaitForSelectorTimeout(long)

+
+
Returns
+
  • Current timeout value in milliseconds
+
+ +
+
+ + + + +
+

+ + public + + + + + long + + getWaitForSelectorTimeout + () +

+
+
+ + + +
+
+ + + + +

Gets the current timeout for waiting for a widget to become visible in + the user interface so that it can be matched by a selector. + + Because user interface content is dynamic, sometimes a widget may not + be visible immediately and won't be detected by a selector. This timeout + allows the uiautomator framework to wait for a match to be found, up until + the timeout elapses.

+
+
Returns
+
  • Current timeout value in milliseconds
+
+ +
+
+ + + + +
+

+ + public + + + + + Configurator + + setActionAcknowledgmentTimeout + (long timeout) +

+
+
+ + + +
+
+ + + + +

Sets the timeout for waiting for an acknowledgment of generic uiautomator + actions, such as clicks, text setting, and menu presses. + + The acknowledgment is an AccessibilityEvent, + corresponding to an action, that lets the framework determine if the + action was successful. Generally, this timeout should not be modified. + See UiObject

+
+
Parameters
+ + + + +
timeout + Timeout value in milliseconds
+
+
+
Returns
+
  • self
+
+ +
+
+ + + + +
+

+ + public + + + + + Configurator + + setKeyInjectionDelay + (long delay) +

+
+
+ + + +
+
+ + + + +

Sets a delay between key presses when injecting text input. + See setText(String)

+
+
Parameters
+ + + + +
delay + Delay value in milliseconds
+
+
+
Returns
+
  • self
+
+ +
+
+ + + + +
+

+ + public + + + + + Configurator + + setScrollAcknowledgmentTimeout + (long timeout) +

+
+
+ + + +
+
+ + + + +

Sets the timeout for waiting for an acknowledgement of an + uiautomtor scroll swipe action. + + The acknowledgment is an AccessibilityEvent, + corresponding to the scroll action, that lets the framework determine if + the scroll action was successful. Generally, this timeout should not be modified. + See UiScrollable

+
+
Parameters
+ + + + +
timeout + Timeout value in milliseconds
+
+
+
Returns
+
  • self
+
+ +
+
+ + + + +
+

+ + public + + + + + Configurator + + setWaitForIdleTimeout + (long timeout) +

+
+
+ + + +
+
+ + + + +

Sets the timeout for waiting for the user interface to go into an idle + state before starting a uiautomator action. + + By default, all core uiautomator objects except UiDevice will perform + this wait before starting to search for the widget specified by the + object's UiSelector. Once the idle state is detected or the + timeout elapses (whichever occurs first), the object will start to wait + for the selector to find a match. + See setWaitForSelectorTimeout(long)

+
+
Parameters
+ + + + +
timeout + Timeout value in milliseconds
+
+
+
Returns
+
  • self
+
+ +
+
+ + + + +
+

+ + public + + + + + Configurator + + setWaitForSelectorTimeout + (long timeout) +

+
+
+ + + +
+
+ + + + +

Sets the timeout for waiting for a widget to become visible in the user + interface so that it can be matched by a selector. + + Because user interface content is dynamic, sometimes a widget may not + be visible immediately and won't be detected by a selector. This timeout + allows the uiautomator framework to wait for a match to be found, up until + the timeout elapses.

+
+
Parameters
+ + + + +
timeout + Timeout value in milliseconds.
+
+
+
Returns
+
  • self
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/Direction.html b/docs/html/reference/android/support/test/uiautomator/Direction.html new file mode 100644 index 00000000000..ae3bf124ccc --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/Direction.html @@ -0,0 +1,1697 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Direction | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + final + + enum +

Direction

+ + + + + + + + + extends Enum<E extends Enum<E>>
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Enum<E extends java.lang.Enum<E>>
    ↳android.support.test.uiautomator.Direction
+ + + + + + + +
+ + +

Class Overview

+

An enumeration used to specify the primary direction of certain gestures.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enum Values
Direction DOWN  +   + + + +
Direction LEFT  +   + + + +
Direction RIGHT  +   + + + +
Direction UP  +   + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + static + + Direction + + reverse(Direction direction) + +
+ Returns the reverse of the given direction. + + + +
+ +
+ + + + static + + Direction + + valueOf(String name) + +
+ + + final + static + + Direction[] + + values() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Enum + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + java.lang.Comparable + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + +

Enum Values

+ + + + + + +
+

+ + public + static + final + Direction + + DOWN +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Direction + + LEFT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Direction + + RIGHT +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + +
+

+ + public + static + final + Direction + + UP +

+
+ + + + +
+
+ + + + +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + static + + + + Direction + + reverse + (Direction direction) +

+
+
+ + + +
+
+ + + + +

Returns the reverse of the given direction.

+ +
+
+ + + + +
+

+ + public + static + + + + Direction + + valueOf + (String name) +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + public + static + final + + + Direction[] + + values + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/EventCondition.html b/docs/html/reference/android/support/test/uiautomator/EventCondition.html new file mode 100644 index 00000000000..8620772d16b --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/EventCondition.html @@ -0,0 +1,1131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EventCondition | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + class +

EventCondition

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.EventCondition<R>
+ + + + + + + +
+ + +

Class Overview

+

An EventCondition is a condition which depends on an event or series of events having + occurred. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + EventCondition() + +
+ + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + EventCondition + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/IAutomationSupport.html b/docs/html/reference/android/support/test/uiautomator/IAutomationSupport.html new file mode 100644 index 00000000000..42a0f45c27b --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/IAutomationSupport.html @@ -0,0 +1,891 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IAutomationSupport | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ public + + + + interface +

IAutomationSupport

+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
android.support.test.uiautomator.IAutomationSupport
+ + + + + + + +
+ + +

Class Overview

+

Provides auxiliary support for running test cases

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ abstract + + + + + void + + sendStatus(int resultCode, Bundle status) + +
+ Allows the running test cases to send out interim status + + + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + abstract + + void + + sendStatus + (int resultCode, Bundle status) +

+
+
+ + + +
+
+ + + + +

Allows the running test cases to send out interim status

+
+
Parameters
+ + + + +
status + status report, consisting of key value pairs
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/SearchCondition.html b/docs/html/reference/android/support/test/uiautomator/SearchCondition.html new file mode 100644 index 00000000000..34760199a5d --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/SearchCondition.html @@ -0,0 +1,1129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +SearchCondition | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + abstract + class +

SearchCondition

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.SearchCondition<R>
+ + + + + + + +
+ + +

Class Overview

+

A SearchCondition is a condition that is satisfied by searching for UI elements.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + SearchCondition() + +
+ + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + SearchCondition + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/StaleObjectException.html b/docs/html/reference/android/support/test/uiautomator/StaleObjectException.html new file mode 100644 index 00000000000..84c528ef430 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/StaleObjectException.html @@ -0,0 +1,1442 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +StaleObjectException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

StaleObjectException

+ + + + + + + + + + + + + + + + + extends RuntimeException
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳java.lang.Throwable
    ↳java.lang.Exception
     ↳java.lang.RuntimeException
      ↳android.support.test.uiautomator.StaleObjectException
+ + + + + + + +
+ + +

Class Overview

+

A StaleObjectException exception is thrown when a UiObject2 is used after the + underlying View has been destroyed. In this case, it is necessary to call + findObject(BySelector) to obtain a new UiObject2 instance. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + StaleObjectException() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Throwable + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + StaleObjectException + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html b/docs/html/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html new file mode 100644 index 00000000000..4a497deb734 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html @@ -0,0 +1,2787 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiAutomatorInstrumentationTestRunner | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

UiAutomatorInstrumentationTestRunner

+ + + + + + + + + + + + + extends InstrumentationTestRunner
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.app.Instrumentation
    ↳android.test.InstrumentationTestRunner
     ↳android.support.test.uiautomator.UiAutomatorInstrumentationTestRunner
+ + + + + + + +
+ + +

Class Overview

+

Test runner for UiAutomatorTestCases. Such tests are executed + on the device and have access to an applications context. +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Constants
+ + From class +android.test.InstrumentationTestRunner +
+ + +
+
+ + From class +android.app.Instrumentation +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + UiAutomatorInstrumentationTestRunner() + +
+ + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + onStart() + +
+ + + + + + + + + + + + + + + + + + + + + + +
Protected Methods
+ + + + + + AndroidTestRunner + + getAndroidTestRunner() + +
+ + + + + + void + + initializeUiAutomatorTest(UiAutomatorTestCase test) + +
+ Perform initialization specific to UiAutomator test. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + android.test.InstrumentationTestRunner + +
+ + +
+
+ +From class + + android.app.Instrumentation + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + android.test.TestSuiteProvider + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + UiAutomatorInstrumentationTestRunner + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + onStart + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + +

Protected Methods

+ + + + + +
+

+ + protected + + + + + AndroidTestRunner + + getAndroidTestRunner + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + +
+

+ + protected + + + + + void + + initializeUiAutomatorTest + (UiAutomatorTestCase test) +

+
+
+ + + +
+
+ + + + +

Perform initialization specific to UiAutomator test. It sets up the test case so that + it can access the UiDevice and gives it access to the command line arguments.

+
+
Parameters
+ + + + +
test + UiAutomatorTestCase to initialize. +
+
+ +
+
+ + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiAutomatorTestCase.html b/docs/html/reference/android/support/test/uiautomator/UiAutomatorTestCase.html new file mode 100644 index 00000000000..45859df4fa4 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiAutomatorTestCase.html @@ -0,0 +1,2577 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiAutomatorTestCase | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

UiAutomatorTestCase

+ + + + + + + + + + + + + + + + + extends InstrumentationTestCase
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳junit.framework.Assert
    ↳junit.framework.TestCase
     ↳android.test.InstrumentationTestCase
      ↳android.support.test.uiautomator.UiAutomatorTestCase
+ + + + + + + +
+

+

+ This class is deprecated.
+ It is no longer necessary to extend UiAutomatorTestCase. You can use + getInstance(Instrumentation) from any test class as long as you have access to + an Instrumentation instance. + +

+ +

Class Overview

+

UI Automator test case that is executed on the device.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + UiAutomatorTestCase() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + IAutomationSupport + + getAutomationSupport() + +
+ + This method is deprecated. + Use sendStatus(int, Bundle) instead + + + + +
+ +
+ + + + + + Bundle + + getParams() + +
+ Get command line parameters. + + + +
+ +
+ + + + + + UiDevice + + getUiDevice() + +
+ Get current instance of UiDevice. + + + +
+ +
+ + + + + + void + + sleep(long ms) + +
+ + This method is deprecated. + Use sleep(long) instead. + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + android.test.InstrumentationTestCase + +
+ + +
+
+ +From class + + junit.framework.TestCase + +
+ + +
+
+ +From class + + junit.framework.Assert + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + junit.framework.Test + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + UiAutomatorTestCase + () +

+
+
+ + + +
+
+ + + + +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + IAutomationSupport + + getAutomationSupport + () +

+
+
+ + + +
+
+ + + +

+

+ This method is deprecated.
+ Use sendStatus(int, Bundle) instead + +

+

Provides support for running tests to report interim status

+
+
Returns
+
  • IAutomationSupport
+
+ +
+
+ + + + +
+

+ + public + + + + + Bundle + + getParams + () +

+
+
+ + + +
+
+ + + + +

Get command line parameters. On the command line when passing -e key value + pairs, the Bundle will have the key value pairs conveniently available to the + tests.

+ +
+
+ + + + +
+

+ + public + + + + + UiDevice + + getUiDevice + () +

+
+
+ + + +
+
+ + + + +

Get current instance of UiDevice. Works similar to calling the static + getInstance() from anywhere in the test classes.

+ +
+
+ + + + +
+

+ + public + + + + + void + + sleep + (long ms) +

+
+
+ + + +
+
+ + + +

+

+ This method is deprecated.
+ Use sleep(long) instead. + +

+

Calls sleep(long) to sleep

+
+
Parameters
+ + + + +
ms + is in milliseconds.
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiCollection.html b/docs/html/reference/android/support/test/uiautomator/UiCollection.html new file mode 100644 index 00000000000..8689b367e8a --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiCollection.html @@ -0,0 +1,2703 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiCollection | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

UiCollection

+ + + + + + + + + extends UiObject
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.UiObject
    ↳android.support.test.uiautomator.UiCollection
+ + + + +
+ + Known Direct Subclasses + +
+ + +
+
+ + + + +
+ + +

Class Overview

+

Used to enumerate a container's UI elements for the purpose of counting, + or targeting a sub elements by a child's text or description.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Constants
+ + From class +android.support.test.uiautomator.UiObject +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + UiCollection(UiSelector selector) + +
+ Constructs an instance as described by the selector + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + UiObject + + getChildByDescription(UiSelector childPattern, String text) + +
+ Searches for child UI element within the constraints of this UiCollection UiSelector + selector. + + + +
+ +
+ + + + + + UiObject + + getChildByInstance(UiSelector childPattern, int instance) + +
+ Searches for child UI element within the constraints of this UiCollection UiSelector + selector. + + + +
+ +
+ + + + + + UiObject + + getChildByText(UiSelector childPattern, String text) + +
+ Searches for child UI element within the constraints of this UiCollection UiSelector + selector. + + + +
+ +
+ + + + + + int + + getChildCount(UiSelector childPattern) + +
+ Counts child UI element instances matching the childPattern + argument. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + android.support.test.uiautomator.UiObject + +
+ + +
+
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + UiCollection + (UiSelector selector) +

+
+
+ + + +
+
+ + + + +

Constructs an instance as described by the selector

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + UiObject + + getChildByDescription + (UiSelector childPattern, String text) +

+
+
+ + + +
+
+ + + + +

Searches for child UI element within the constraints of this UiCollection UiSelector + selector. + + It looks for any child matching the childPattern argument that has + a child UI element anywhere within its sub hierarchy that has content-description text. + The returned UiObject will point at the childPattern instance that matched the + search and not at the identifying child element that matched the content description.

+
+
Parameters
+ + + + + + + +
childPattern + UiSelector selector of the child pattern to match and return
text + String of the identifying child contents of of the childPattern
+
+
+
Returns
+
  • UiObject pointing at and instance of childPattern
+
+
+
Throws
+ + + + + + + +
+ UiObjectNotFoundException
UiObjectNotFoundException +
+
+ +
+
+ + + + +
+

+ + public + + + + + UiObject + + getChildByInstance + (UiSelector childPattern, int instance) +

+
+
+ + + +
+
+ + + + +

Searches for child UI element within the constraints of this UiCollection UiSelector + selector. + + It looks for any child matching the childPattern argument that has + a child UI element anywhere within its sub hierarchy that is at the instance + specified. The operation is performed only on the visible items and no scrolling is performed + in this case.

+
+
Parameters
+ + + + + + + +
childPattern + UiSelector selector of the child pattern to match and return
instance + int the desired matched instance of this childPattern
+
+
+
Returns
+
  • UiObject pointing at and instance of childPattern
+
+
+
Throws
+ + + + +
UiObjectNotFoundException +
+
+ +
+
+ + + + +
+

+ + public + + + + + UiObject + + getChildByText + (UiSelector childPattern, String text) +

+
+
+ + + +
+
+ + + + +

Searches for child UI element within the constraints of this UiCollection UiSelector + selector. + + It looks for any child matching the childPattern argument that has + a child UI element anywhere within its sub hierarchy that has text attribute = + text. The returned UiObject will point at the childPattern + instance that matched the search and not at the identifying child element that matched the + text attribute.

+
+
Parameters
+ + + + + + + +
childPattern + UiSelector selector of the child pattern to match and return
text + String of the identifying child contents of of the childPattern
+
+
+
Returns
+
  • UiObject pointing at and instance of childPattern
+
+
+
Throws
+ + + + + + + +
+ UiObjectNotFoundException
UiObjectNotFoundException +
+
+ +
+
+ + + + +
+

+ + public + + + + + int + + getChildCount + (UiSelector childPattern) +

+
+
+ + + +
+
+ + + + +

Counts child UI element instances matching the childPattern + argument. The method returns the number of matching UI elements that are + currently visible. The count does not include items of a scrollable list + that are off-screen.

+
+
Parameters
+ + + + +
childPattern + a UiSelector that represents the matching child UI + elements to count
+
+
+
Returns
+
  • the number of matched childPattern under the current UiCollection
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiDevice.html b/docs/html/reference/android/support/test/uiautomator/UiDevice.html new file mode 100644 index 00000000000..3eb721f9758 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiDevice.html @@ -0,0 +1,4889 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiDevice | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

UiDevice

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.UiDevice
+ + + + + + + +
+ + +

Class Overview

+

UiDevice provides access to state information about the device. + You can also use this class to simulate user actions on the device, + such as pressing the d-pad or pressing the Home and Menu buttons.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + clearLastTraversedText() + +
+ Clears the text from the last UI traversal event. + + + +
+ +
+ + + + + + boolean + + click(int x, int y) + +
+ Perform a click at arbitrary coordinates specified by the user + + + +
+ +
+ + + + + + boolean + + drag(int startX, int startY, int endX, int endY, int steps) + +
+ Performs a swipe from one coordinate to another coordinate. + + + +
+ +
+ + + + + + void + + dumpWindowHierarchy(String fileName) + +
+ Helper method used for debugging to dump the current window's layout hierarchy. + + + +
+ +
+ + + + + + UiObject2 + + findObject(BySelector selector) + +
+ Returns the first object to match the selector criteria. + + + +
+ +
+ + + + + + UiObject + + findObject(UiSelector selector) + +
+ Returns a UiObject which represents a view that matches the specified selector criteria. + + + +
+ +
+ + + + + + List<UiObject2> + + findObjects(BySelector selector) + +
+ Returns all objects that match the selector criteria. + + + +
+ +
+ + + + + + void + + freezeRotation() + +
+ Disables the sensors and freezes the device rotation at its + current rotation state. + + + +
+ +
+ + + + + + String + + getCurrentActivityName() + +
+ + This method is deprecated. + The results returned should be considered unreliable + + + +
+ +
+ + + + + + String + + getCurrentPackageName() + +
+ Retrieves the name of the last package to report accessibility events. + + + +
+ +
+ + + + + + int + + getDisplayHeight() + +
+ Gets the height of the display, in pixels. + + + +
+ +
+ + + + + + int + + getDisplayRotation() + +
+ Returns the current rotation of the display, as defined in Surface + + + +
+ +
+ + + + + + Point + + getDisplaySizeDp() + +
+ Returns the display size in dp (device-independent pixel) + + The returned display size is adjusted per screen rotation. + + + +
+ +
+ + + + + + int + + getDisplayWidth() + +
+ Gets the width of the display, in pixels. + + + +
+ +
+ + + + static + + UiDevice + + getInstance(Instrumentation instrumentation) + +
+ Retrieves a singleton instance of UiDevice + + + +
+ +
+ + + + static + + UiDevice + + getInstance() + +
+ + This method is deprecated. + Should use getInstance(Instrumentation) instead. This version hides + UiDevice's dependency on having an Instrumentation reference and is prone to misuse. + + + +
+ +
+ + + + + + String + + getLastTraversedText() + +
+ Retrieves the text from the last UI traversal event received. + + + +
+ +
+ + + + + + String + + getProductName() + +
+ Retrieves the product name of the device. + + + +
+ +
+ + + + + + boolean + + hasAnyWatcherTriggered() + +
+ Checks if any registered UiWatcher have triggered. + + + +
+ +
+ + + + + + boolean + + hasObject(BySelector selector) + +
+ Returns whether there is a match for the given selector criteria. + + + +
+ +
+ + + + + + boolean + + hasWatcherTriggered(String watcherName) + +
+ Checks if a specific registered UiWatcher has triggered. + + + +
+ +
+ + + + + + boolean + + isNaturalOrientation() + +
+ Check if the device is in its natural orientation. + + + +
+ +
+ + + + + + boolean + + isScreenOn() + +
+ Checks the power manager if the screen is ON. + + + +
+ +
+ + + + + + boolean + + openNotification() + +
+ Opens the notification shade. + + + +
+ +
+ + + + + + boolean + + openQuickSettings() + +
+ Opens the Quick Settings shade. + + + +
+ +
+ + + + + <R> + R + + performActionAndWait(Runnable action, EventCondition<R> condition, long timeout) + +
+ Performs the provided action and waits for the condition to be met. + + + +
+ +
+ + + + + + boolean + + pressBack() + +
+ Simulates a short press on the BACK button. + + + +
+ +
+ + + + + + boolean + + pressDPadCenter() + +
+ Simulates a short press on the CENTER button. + + + +
+ +
+ + + + + + boolean + + pressDPadDown() + +
+ Simulates a short press on the DOWN button. + + + +
+ +
+ + + + + + boolean + + pressDPadLeft() + +
+ Simulates a short press on the LEFT button. + + + +
+ +
+ + + + + + boolean + + pressDPadRight() + +
+ Simulates a short press on the RIGHT button. + + + +
+ +
+ + + + + + boolean + + pressDPadUp() + +
+ Simulates a short press on the UP button. + + + +
+ +
+ + + + + + boolean + + pressDelete() + +
+ Simulates a short press on the DELETE key. + + + +
+ +
+ + + + + + boolean + + pressEnter() + +
+ Simulates a short press on the ENTER key. + + + +
+ +
+ + + + + + boolean + + pressHome() + +
+ Simulates a short press on the HOME button. + + + +
+ +
+ + + + + + boolean + + pressKeyCode(int keyCode, int metaState) + +
+ Simulates a short press using a key code. + + + +
+ +
+ + + + + + boolean + + pressKeyCode(int keyCode) + +
+ Simulates a short press using a key code. + + + +
+ +
+ + + + + + boolean + + pressMenu() + +
+ Simulates a short press on the MENU button. + + + +
+ +
+ + + + + + boolean + + pressRecentApps() + +
+ Simulates a short press on the Recent Apps button. + + + +
+ +
+ + + + + + boolean + + pressSearch() + +
+ Simulates a short press on the SEARCH button. + + + +
+ +
+ + + + + + void + + registerWatcher(String name, UiWatcher watcher) + +
+ Registers a UiWatcher to run automatically when the testing framework is unable to + find a match using a UiSelector. + + + +
+ +
+ + + + + + void + + removeWatcher(String name) + +
+ Removes a previously registered UiWatcher. + + + +
+ +
+ + + + + + void + + resetWatcherTriggers() + +
+ Resets a UiWatcher that has been triggered. + + + +
+ +
+ + + + + + void + + runWatchers() + +
+ This method forces all registered watchers to run. + + + +
+ +
+ + + + + + void + + setCompressedLayoutHeirarchy(boolean compressed) + +
+ Enables or disables layout hierarchy compression. + + + +
+ +
+ + + + + + void + + setOrientationLeft() + +
+ Simulates orienting the device to the left and also freezes rotation + by disabling the sensors. + + + +
+ +
+ + + + + + void + + setOrientationNatural() + +
+ Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors. + + + +
+ +
+ + + + + + void + + setOrientationRight() + +
+ Simulates orienting the device to the right and also freezes rotation + by disabling the sensors. + + + +
+ +
+ + + + + + void + + sleep() + +
+ This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF. + + + +
+ +
+ + + + + + boolean + + swipe(Point[] segments, int segmentSteps) + +
+ Performs a swipe between points in the Point array. + + + +
+ +
+ + + + + + boolean + + swipe(int startX, int startY, int endX, int endY, int steps) + +
+ Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed. + + + +
+ +
+ + + + + + boolean + + takeScreenshot(File storePath) + +
+ Take a screenshot of current window and store it as PNG + + Default scale of 1.0f (original size) and 90% quality is used + The screenshot is adjusted per screen rotation + + + +
+ +
+ + + + + + boolean + + takeScreenshot(File storePath, float scale, int quality) + +
+ Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation + + + +
+ +
+ + + + + + void + + unfreezeRotation() + +
+ Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation. + + + +
+ +
+ + + + + <R> + R + + wait(SearchCondition<R> condition, long timeout) + +
+ Waits for given the condition to be met. + + + +
+ +
+ + + + + + void + + waitForIdle(long timeout) + +
+ Waits for the current application to idle. + + + +
+ +
+ + + + + + void + + waitForIdle() + +
+ Waits for the current application to idle. + + + +
+ +
+ + + + + + boolean + + waitForWindowUpdate(String packageName, long timeout) + +
+ Waits for a window content update event to occur. + + + +
+ +
+ + + + + + void + + wakeUp() + +
+ This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON. + + + +
+ +
+ + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + clearLastTraversedText + () +

+
+
+ + + +
+
+ + + + +

Clears the text from the last UI traversal event. + See getLastTraversedText().

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + click + (int x, int y) +

+
+
+ + + +
+
+ + + + +

Perform a click at arbitrary coordinates specified by the user

+
+
Parameters
+ + + + + + + +
x + coordinate
y + coordinate
+
+
+
Returns
+
  • true if the click succeeded else false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + drag + (int startX, int startY, int endX, int endY, int steps) +

+
+
+ + + +
+
+ + + + +

Performs a swipe from one coordinate to another coordinate. You can control + the smoothness and speed of the swipe by specifying the number of steps. + Each step execution is throttled to 5 milliseconds per step, so for a 100 + steps, the swipe will take around 0.5 seconds to complete.

+
+
Parameters
+ + + + + + + + + + + + + + + + +
startX + X-axis value for the starting coordinate
startY + Y-axis value for the starting coordinate
endX + X-axis value for the ending coordinate
endY + Y-axis value for the ending coordinate
steps + is the number of steps for the swipe action
+
+
+
Returns
+
  • true if swipe is performed, false if the operation fails + or the coordinates are invalid
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + dumpWindowHierarchy + (String fileName) +

+
+
+ + + +
+
+ + + + +

Helper method used for debugging to dump the current window's layout hierarchy. + Relative file paths are stored the application's internal private storage location.

+ +
+
+ + + + +
+

+ + public + + + + + UiObject2 + + findObject + (BySelector selector) +

+
+
+ + + +
+
+ + + + +

Returns the first object to match the selector criteria.

+ +
+
+ + + + +
+

+ + public + + + + + UiObject + + findObject + (UiSelector selector) +

+
+
+ + + +
+
+ + + + +

Returns a UiObject which represents a view that matches the specified selector criteria.

+
+
Returns
+
  • UiObject object +
+
+ +
+
+ + + + +
+

+ + public + + + + + List<UiObject2> + + findObjects + (BySelector selector) +

+
+
+ + + +
+
+ + + + +

Returns all objects that match the selector criteria.

+ +
+
+ + + + +
+

+ + public + + + + + void + + freezeRotation + () +

+
+
+ + + +
+
+ + + + +

Disables the sensors and freezes the device rotation at its + current rotation state.

+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + String + + getCurrentActivityName + () +

+
+
+ + + +
+
+ + + +

+

+ This method is deprecated.
+ The results returned should be considered unreliable +

+

Retrieves the last activity to report accessibility events.

+
+
Returns
+
  • String name of activity
+
+ +
+
+ + + + +
+

+ + public + + + + + String + + getCurrentPackageName + () +

+
+
+ + + +
+
+ + + + +

Retrieves the name of the last package to report accessibility events.

+
+
Returns
+
  • String name of package
+
+ +
+
+ + + + +
+

+ + public + + + + + int + + getDisplayHeight + () +

+
+
+ + + +
+
+ + + + +

Gets the height of the display, in pixels. The size is adjusted based + on the current orientation of the display.

+
+
Returns
+
  • height in pixels or zero on failure
+
+ +
+
+ + + + +
+

+ + public + + + + + int + + getDisplayRotation + () +

+
+
+ + + +
+
+ + + + +

Returns the current rotation of the display, as defined in Surface

+ +
+
+ + + + +
+

+ + public + + + + + Point + + getDisplaySizeDp + () +

+
+
+ + + +
+
+ + + + +

Returns the display size in dp (device-independent pixel) + + The returned display size is adjusted per screen rotation. Also this will return the actual + size of the screen, rather than adjusted per system decorations (like status bar).

+
+
Returns
+
  • a Point containing the display size in dp +
+
+ +
+
+ + + + +
+

+ + public + + + + + int + + getDisplayWidth + () +

+
+
+ + + +
+
+ + + + +

Gets the width of the display, in pixels. The width and height details + are reported based on the current orientation of the display.

+
+
Returns
+
  • width in pixels or zero on failure
+
+ +
+
+ + + + +
+

+ + public + static + + + + UiDevice + + getInstance + (Instrumentation instrumentation) +

+
+
+ + + +
+
+ + + + +

Retrieves a singleton instance of UiDevice

+
+
Returns
+
  • UiDevice instance +
+
+ +
+
+ + + + +
+

+ + public + static + + + + UiDevice + + getInstance + () +

+
+
+ + + +
+
+ + + +

+

+ This method is deprecated.
+ Should use getInstance(Instrumentation) instead. This version hides + UiDevice's dependency on having an Instrumentation reference and is prone to misuse. +

+

Retrieves a singleton instance of UiDevice

+
+
Returns
+
  • UiDevice instance
+
+ +
+
+ + + + +
+

+ + public + + + + + String + + getLastTraversedText + () +

+
+
+ + + +
+
+ + + + +

Retrieves the text from the last UI traversal event received. + + You can use this method to read the contents in a WebView container + because the accessibility framework fires events + as each text is highlighted. You can write a test to perform + directional arrow presses to focus on different elements inside a WebView, + and call this method to get the text from each traversed element. + If you are testing a view container that can return a reference to a + Document Object Model (DOM) object, your test should use the view's + DOM instead.

+
+
Returns
+
  • text of the last traversal event, else return an empty string
+
+ +
+
+ + + + +
+

+ + public + + + + + String + + getProductName + () +

+
+
+ + + +
+
+ + + + +

Retrieves the product name of the device. + + This method provides information on what type of device the test is running on. This value is + the same as returned by invoking #adb shell getprop ro.product.name.

+
+
Returns
+
  • product name of the device
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + hasAnyWatcherTriggered + () +

+
+
+ + + +
+
+ + + + +

Checks if any registered UiWatcher have triggered. + + See registerWatcher(String, UiWatcher) + See hasWatcherTriggered(String)

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + hasObject + (BySelector selector) +

+
+
+ + + +
+
+ + + + +

Returns whether there is a match for the given selector criteria.

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + hasWatcherTriggered + (String watcherName) +

+
+
+ + + +
+
+ + + + +

Checks if a specific registered UiWatcher has triggered. + See registerWatcher(String, UiWatcher). If a UiWatcher runs and its + checkForCondition() call returned true, then + the UiWatcher is considered triggered. This is helpful if a watcher is detecting errors + from ANR or crash dialogs and the test needs to know if a UiWatcher has been triggered.

+
+
Returns
+
  • true if triggered else false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + isNaturalOrientation + () +

+
+
+ + + +
+
+ + + + +

Check if the device is in its natural orientation. This is determined by checking if the + orientation is at 0 or 180 degrees.

+
+
Returns
+
  • true if it is in natural orientation
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + isScreenOn + () +

+
+
+ + + +
+
+ + + + +

Checks the power manager if the screen is ON.

+
+
Returns
+
  • true if the screen is ON else false
+
+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + openNotification + () +

+
+
+ + + +
+
+ + + + +

Opens the notification shade.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + openQuickSettings + () +

+
+
+ + + +
+
+ + + + +

Opens the Quick Settings shade.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + R + + performActionAndWait + (Runnable action, EventCondition<R> condition, long timeout) +

+
+
+ + + +
+
+ + + + +

Performs the provided action and waits for the condition to be met.

+
+
Parameters
+ + + + + + + + + + +
action + The Runnable action to perform.
condition + The EventCondition to evaluate.
timeout + Maximum amount of time to wait in milliseconds.
+
+
+
Returns
+
  • The final result returned by the condition. +
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressBack + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the BACK button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressDPadCenter + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the CENTER button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressDPadDown + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the DOWN button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressDPadLeft + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the LEFT button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressDPadRight + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the RIGHT button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressDPadUp + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the UP button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressDelete + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the DELETE key.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressEnter + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the ENTER key.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressHome + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the HOME button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressKeyCode + (int keyCode, int metaState) +

+
+
+ + + +
+
+ + + + +

Simulates a short press using a key code. + + See KeyEvent.

+
+
Parameters
+ + + + + + + +
keyCode + the key code of the event.
metaState + an integer in which each bit set to 1 represents a pressed meta key
+
+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressKeyCode + (int keyCode) +

+
+
+ + + +
+
+ + + + +

Simulates a short press using a key code. + + See KeyEvent

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressMenu + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the MENU button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressRecentApps + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the Recent Apps button.

+
+
Returns
+
  • true if successful, else return false
+
+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + pressSearch + () +

+
+
+ + + +
+
+ + + + +

Simulates a short press on the SEARCH button.

+
+
Returns
+
  • true if successful, else return false
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + registerWatcher + (String name, UiWatcher watcher) +

+
+
+ + + +
+
+ + + + +

Registers a UiWatcher to run automatically when the testing framework is unable to + find a match using a UiSelector. See runWatchers()

+
+
Parameters
+ + + + + + + +
name + to register the UiWatcher
watcher + UiWatcher
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + removeWatcher + (String name) +

+
+
+ + + +
+
+ + + + +

Removes a previously registered UiWatcher. + + See registerWatcher(String, UiWatcher)

+
+
Parameters
+ + + + +
name + used to register the UiWatcher
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + resetWatcherTriggers + () +

+
+
+ + + +
+
+ + + + +

Resets a UiWatcher that has been triggered. + If a UiWatcher runs and its checkForCondition() call + returned true, then the UiWatcher is considered triggered. + See registerWatcher(String, UiWatcher)

+ +
+
+ + + + +
+

+ + public + + + + + void + + runWatchers + () +

+
+
+ + + +
+
+ + + + +

This method forces all registered watchers to run. + See registerWatcher(String, UiWatcher)

+ +
+
+ + + + +
+

+ + public + + + + + void + + setCompressedLayoutHeirarchy + (boolean compressed) +

+
+
+ + + +
+
+ + + + +

Enables or disables layout hierarchy compression. + + If compression is enabled, the layout hierarchy derived from the Acessibility + framework will only contain nodes that are important for uiautomator + testing. Any unnecessary surrounding layout nodes that make viewing + and searching the hierarchy inefficient are removed.

+
+
Parameters
+ + + + +
compressed + true to enable compression; else, false to disable
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + setOrientationLeft + () +

+
+
+ + + +
+
+ + + + +

Simulates orienting the device to the left and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see unfreezeRotation().

+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + setOrientationNatural + () +

+
+
+ + + +
+
+ + + + +

Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see unfreezeRotation().

+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + setOrientationRight + () +

+
+
+ + + +
+
+ + + + +

Simulates orienting the device to the right and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see unfreezeRotation().

+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + sleep + () +

+
+
+ + + +
+
+ + + + +

This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.

+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + swipe + (Point[] segments, int segmentSteps) +

+
+
+ + + +
+
+ + + + +

Performs a swipe between points in the Point array. Each step execution is throttled + to 5ms per step. So for a 100 steps, the swipe will take about 1/2 second to complete

+
+
Parameters
+ + + + + + + +
segments + is Point array containing at least one Point object
segmentSteps + steps to inject between two Points
+
+
+
Returns
+
  • true on success
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + swipe + (int startX, int startY, int endX, int endY, int steps) +

+
+
+ + + +
+
+ + + + +

Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed. Each step execution is throttled to 5ms + per step. So for a 100 steps, the swipe will take about 1/2 second to complete.

+
+
Parameters
+ + + + +
steps + is the number of move steps sent to the system
+
+
+
Returns
+
  • false if the operation fails or the coordinates are invalid
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + takeScreenshot + (File storePath) +

+
+
+ + + +
+
+ + + + +

Take a screenshot of current window and store it as PNG + + Default scale of 1.0f (original size) and 90% quality is used + The screenshot is adjusted per screen rotation

+
+
Parameters
+ + + + +
storePath + where the PNG should be written to
+
+
+
Returns
+
  • true if screen shot is created successfully, false otherwise
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + takeScreenshot + (File storePath, float scale, int quality) +

+
+
+ + + +
+
+ + + + +

Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation

+
+
Parameters
+ + + + + + + + + + +
storePath + where the PNG should be written to
scale + scale the screenshot down if needed; 1.0f for original size
quality + quality of the PNG compression; range: 0-100
+
+
+
Returns
+
  • true if screen shot is created successfully, false otherwise
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + unfreezeRotation + () +

+
+
+ + + +
+
+ + + + +

Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation. During a test execution, it is best to + keep the device frozen in a specific orientation until the test case execution has completed.

+
+
Throws
+ + + + +
RemoteException +
+
+ +
+
+ + + + +
+

+ + public + + + + + R + + wait + (SearchCondition<R> condition, long timeout) +

+
+
+ + + +
+
+ + + + +

Waits for given the condition to be met.

+
+
Parameters
+ + + + + + + +
condition + The SearchCondition to evaluate.
timeout + Maximum amount of time to wait in milliseconds.
+
+
+
Returns
+
  • The final result returned by the condition. +
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + waitForIdle + (long timeout) +

+
+
+ + + +
+
+ + + + +

Waits for the current application to idle.

+
+
Parameters
+ + + + +
timeout + in milliseconds
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + waitForIdle + () +

+
+
+ + + +
+
+ + + + +

Waits for the current application to idle. + Default wait timeout is 10 seconds

+ +
+
+ + + + +
+

+ + public + + + + + boolean + + waitForWindowUpdate + (String packageName, long timeout) +

+
+
+ + + +
+
+ + + + +

Waits for a window content update event to occur. + + If a package name for the window is specified, but the current window + does not have the same package name, the function returns immediately.

+
+
Parameters
+ + + + + + + +
packageName + the specified window package name (can be null). + If null, a window update from any front-end window will end the wait
timeout + the timeout for the wait
+
+
+
Returns
+
  • true if a window update occurred, false if timeout has elapsed or if the current + window does not have the specified package name
+
+ +
+
+ + + + +
+

+ + public + + + + + void + + wakeUp + () +

+
+
+ + + +
+
+ + + + +

This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON. + + If the screen was OFF and it just got turned ON, this method will insert a 500ms delay + to allow the device time to wake up and accept input.

+
+
Throws
+ + + + + + + +
+ RemoteException
RemoteException +
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiObject.html b/docs/html/reference/android/support/test/uiautomator/UiObject.html new file mode 100644 index 00000000000..7a299cccdc7 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiObject.html @@ -0,0 +1,4932 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiObject | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + +
+ public + + + + class +

UiObject

+ + + + + extends Object
+ + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳android.support.test.uiautomator.UiObject
+ + + + +
+ + Known Direct Subclasses + +
+ + +
+
+ + + +
+ + Known Indirect Subclasses + +
+ + +
+
+ + +
+ + +

Class Overview

+

A UiObject is a representation of a view. It is not in any way directly bound to a + view as an object reference. A UiObject contains information to help it + locate a matching view at runtime based on the UiSelector properties specified in + its constructor. Once you create an instance of a UiObject, it can + be reused for different views that match the selector criteria.

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Constants
intFINGER_TOUCH_HALF_WIDTH + + + + +
intSWIPE_MARGIN_LIMIT + + + + +
longWAIT_FOR_EVENT_TMEOUT + + This constant is deprecated. + use setScrollAcknowledgmentTimeout(long) + + + + +
longWAIT_FOR_SELECTOR_POLL + + + + +
longWAIT_FOR_SELECTOR_TIMEOUT + + This constant is deprecated. + use setWaitForSelectorTimeout(long) + + + + +
longWAIT_FOR_WINDOW_TMEOUT + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + UiObject(UiSelector selector) + +
+ + This constructor is deprecated. + Use findObject(UiSelector) instead. This version hides + UiObject's dependency on UiDevice and is prone to misuse. + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + void + + clearTextField() + +
+ Clears the existing text contents in an editable field. + + + +
+ +
+ + + + + + boolean + + click() + +
+ Performs a click at the center of the visible bounds of the UI element represented + by this UiObject. + + + +
+ +
+ + + + + + boolean + + clickAndWaitForNewWindow(long timeout) + +
+ Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions. + + + +
+ +
+ + + + + + boolean + + clickAndWaitForNewWindow() + +
+ Waits for window transitions that would typically take longer than the + usual default timeouts. + + + +
+ +
+ + + + + + boolean + + clickBottomRight() + +
+ Clicks the bottom and right corner of the UI element + + + +
+ +
+ + + + + + boolean + + clickTopLeft() + +
+ Clicks the top and left corner of the UI element + + + +
+ +
+ + + + + + boolean + + dragTo(UiObject destObj, int steps) + +
+ Drags this object to a destination UiObject. + + + +
+ +
+ + + + + + boolean + + dragTo(int destX, int destY, int steps) + +
+ Drags this object to arbitrary coordinates. + + + +
+ +
+ + + + + + boolean + + exists() + +
+ Check if view exists. + + + +
+ +
+ + + + + + Rect + + getBounds() + +
+ Returns the view's bounds property. + + + +
+ +
+ + + + + + UiObject + + getChild(UiSelector selector) + +
+ Creates a new UiObject for a child view that is under the present UiObject. + + + +
+ +
+ + + + + + int + + getChildCount() + +
+ Counts the child views immediately under the present UiObject. + + + +
+ +
+ + + + + + String + + getClassName() + +
+ Retrieves the className property of the UI element. + + + +
+ +
+ + + + + + String + + getContentDescription() + +
+ Reads the content_desc property of the UI element + + + +
+ +
+ + + + + + UiObject + + getFromParent(UiSelector selector) + +
+ Creates a new UiObject for a sibling view or a child of the sibling view, + relative to the present UiObject. + + + +
+ +
+ + + + + + String + + getPackageName() + +
+ Reads the view's package property + + + +
+ +
+ + + final + + + UiSelector + + getSelector() + +
+ Debugging helper. + + + +
+ +
+ + + + + + String + + getText() + +
+ Reads the text property of the UI element + + + +
+ +
+ + + + + + Rect + + getVisibleBounds() + +
+ Returns the visible bounds of the view. + + + +
+ +
+ + + + + + boolean + + isCheckable() + +
+ Checks if the UI element's checkable property is currently true. + + + +
+ +
+ + + + + + boolean + + isChecked() + +
+ Check if the UI element's checked property is currently true + + + +
+ +
+ + + + + + boolean + + isClickable() + +
+ Checks if the UI element's clickable property is currently true. + + + +
+ +
+ + + + + + boolean + + isEnabled() + +
+ Checks if the UI element's enabled property is currently true. + + + +
+ +
+ + + + + + boolean + + isFocusable() + +
+ Check if the UI element's focusable property is currently true. + + + +
+ +
+ + + + + + boolean + + isFocused() + +
+ Check if the UI element's focused property is currently true + + + +
+ +
+ + + + + + boolean + + isLongClickable() + +
+ Check if the view's long-clickable property is currently true + + + +
+ +
+ + + + + + boolean + + isScrollable() + +
+ Check if the view's scrollable property is currently true + + + +
+ +
+ + + + + + boolean + + isSelected() + +
+ Checks if the UI element's selected property is currently true. + + + +
+ +
+ + + + + + boolean + + longClick() + +
+ Long clicks the center of the visible bounds of the UI element + + + +
+ +
+ + + + + + boolean + + longClickBottomRight() + +
+ Long clicks bottom and right corner of the UI element + + + +
+ +
+ + + + + + boolean + + longClickTopLeft() + +
+ Long clicks on the top and left corner of the UI element + + + +
+ +
+ + + + + + boolean + + performMultiPointerGesture(PointerCoords... touches) + +
+ Performs a multi-touch gesture. + + + +
+ +
+ + + + + + boolean + + performTwoPointerGesture(Point startPoint1, Point startPoint2, Point endPoint1, Point endPoint2, int steps) + +
+ Generates a two-pointer gesture with arbitrary starting and ending points. + + + +
+ +
+ + + + + + boolean + + pinchIn(int percent, int steps) + +
+ Performs a two-pointer gesture, where each pointer moves diagonally + toward the other, from the edges to the center of this UiObject . + + + +
+ +
+ + + + + + boolean + + pinchOut(int percent, int steps) + +
+ Performs a two-pointer gesture, where each pointer moves diagonally + opposite across the other, from the center out towards the edges of the + this UiObject. + + + +
+ +
+ + + + + + boolean + + setText(String text) + +
+ Sets the text in an editable field, after clearing the field's content. + + + +
+ +
+ + + + + + boolean + + swipeDown(int steps) + +
+ Performs the swipe down action on the UiObject. + + + +
+ +
+ + + + + + boolean + + swipeLeft(int steps) + +
+ Performs the swipe left action on the UiObject. + + + +
+ +
+ + + + + + boolean + + swipeRight(int steps) + +
+ Performs the swipe right action on the UiObject. + + + +
+ +
+ + + + + + boolean + + swipeUp(int steps) + +
+ Performs the swipe up action on the UiObject. + + + +
+ +
+ + + + + + boolean + + waitForExists(long timeout) + +
+ Waits a specified length of time for a view to become visible. + + + +
+ +
+ + + + + + boolean + + waitUntilGone(long timeout) + +
+ Waits a specified length of time for a view to become undetectable. + + + +
+ +
+ + + + + + + + + + + + + + + + +
Protected Methods
+ + + + + + AccessibilityNodeInfo + + findAccessibilityNodeInfo(long timeout) + +
+ Finds a matching UI element in the accessibility hierarchy, by + using the selector for this UiObject. + + + +
+ +
+ + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + +

Constants

+ + + + + + +
+

+ + protected + static + final + int + + FINGER_TOUCH_HALF_WIDTH +

+
+ + + + +
+
+ + + + +

+ + +
+ Constant Value: + + + 20 + (0x00000014) + + +
+ +
+
+ + + + + +
+

+ + protected + static + final + int + + SWIPE_MARGIN_LIMIT +

+
+ + + + +
+
+ + + + +

+ + +
+ Constant Value: + + + 5 + (0x00000005) + + +
+ +
+
+ + + + + +
+

+ + protected + static + final + long + + WAIT_FOR_EVENT_TMEOUT +

+
+ + + + +
+
+ + + +

+

+ This constant is deprecated.
+ use setScrollAcknowledgmentTimeout(long) + +

+

+ + +
+ Constant Value: + + + 3000 + (0x0000000000000bb8) + + +
+ +
+
+ + + + + +
+

+ + protected + static + final + long + + WAIT_FOR_SELECTOR_POLL +

+
+ + + + +
+
+ + + + +

+ + +
+ Constant Value: + + + 1000 + (0x00000000000003e8) + + +
+ +
+
+ + + + + +
+

+ + protected + static + final + long + + WAIT_FOR_SELECTOR_TIMEOUT +

+
+ + + + +
+
+ + + +

+

+ This constant is deprecated.
+ use setWaitForSelectorTimeout(long) + +

+

+ + +
+ Constant Value: + + + 10000 + (0x0000000000002710) + + +
+ +
+
+ + + + + +
+

+ + protected + static + final + long + + WAIT_FOR_WINDOW_TMEOUT +

+
+ + + + +
+
+ + + + +

+ + +
+ Constant Value: + + + 5500 + (0x000000000000157c) + + +
+ +
+
+ + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + UiObject + (UiSelector selector) +

+
+
+ + + +
+
+ + + +

+

+ This constructor is deprecated.
+ Use findObject(UiSelector) instead. This version hides + UiObject's dependency on UiDevice and is prone to misuse. +

+

Constructs a UiObject to represent a view that matches the specified + selector criteria.

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + void + + clearTextField + () +

+
+
+ + + +
+
+ + + + +

Clears the existing text contents in an editable field. + + The UiSelector of this object must reference a UI element that is editable. + + When you call this method, the method sets focus on the editable field, selects all of its + existing content, and clears it by sending a DELETE key press

+
+
Throws
+ + + + + + + +
+ UiObjectNotFoundException
UiObjectNotFoundException +
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + click + () +

+
+
+ + + +
+
+ + + + +

Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.

+
+
Returns
+
  • true id successful else false
+
+
+
Throws
+ + + + + + + +
+ UiObjectNotFoundException
UiObjectNotFoundException +
+
+ +
+
+ + + + +
+

+ + public + + + + + boolean + + clickAndWaitForNewWindow + (long timeout) +

+
+
+ + + +
+
+ + + + +

Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions. + + This method differ from click() only in that this method waits for a + a new window transition as a result of the click. Some examples of a window transition: +

  • launching a new activity
  • +
  • bringing up a pop-up menu
  • +
  • bringing up a dialog
  • +
    +
    Parameters
    + + + + +
    timeout + timeout before giving up on waiting for a new window
    +
    +
    +
    Returns
    +
    • true if the event was triggered, else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + clickAndWaitForNewWindow + () +

    +
    +
    + + + +
    +
    + + + + +

    Waits for window transitions that would typically take longer than the + usual default timeouts. + See clickAndWaitForNewWindow(long)

    +
    +
    Returns
    +
    • true if the event was triggered, else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + clickBottomRight + () +

    +
    +
    + + + +
    +
    + + + + +

    Clicks the bottom and right corner of the UI element

    +
    +
    Returns
    +
    • true on success
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + clickTopLeft + () +

    +
    +
    + + + +
    +
    + + + + +

    Clicks the top and left corner of the UI element

    +
    +
    Returns
    +
    • true on success
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + dragTo + (UiObject destObj, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Drags this object to a destination UiObject. + The number of steps specified in your input parameter can influence the + drag speed, and varying speeds may impact the results. Consider + evaluating different speeds when using this method in your tests.

    +
    +
    Parameters
    + + + + + + + +
    destObj + the destination UiObject.
    steps + usually 40 steps. You can increase or decrease the steps to change the speed.
    +
    +
    +
    Returns
    +
    • true if successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + dragTo + (int destX, int destY, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Drags this object to arbitrary coordinates. + The number of steps specified in your input parameter can influence the + drag speed, and varying speeds may impact the results. Consider + evaluating different speeds when using this method in your tests.

    +
    +
    Parameters
    + + + + + + + + + + +
    destX + the X-axis coordinate.
    destY + the Y-axis coordinate.
    steps + usually 40 steps. You can increase or decrease the steps to change the speed.
    +
    +
    +
    Returns
    +
    • true if successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + exists + () +

    +
    +
    + + + +
    +
    + + + + +

    Check if view exists. + + This methods performs a waitForExists(long) with zero timeout. This + basically returns immediately whether the view represented by this UiObject + exists or not. If you need to wait longer for this view, then see + waitForExists(long).

    +
    +
    Returns
    +
    • true if the view represented by this UiObject does exist
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + Rect + + getBounds + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the view's bounds property. See getVisibleBounds()

    +
    +
    Returns
    +
    • Rect
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getChild + (UiSelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Creates a new UiObject for a child view that is under the present UiObject.

    +
    +
    Parameters
    + + + + +
    selector + for child view to match
    +
    +
    +
    Returns
    +
    • a new UiObject representing the child view
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + int + + getChildCount + () +

    +
    +
    + + + +
    +
    + + + + +

    Counts the child views immediately under the present UiObject.

    +
    +
    Returns
    +
    • the count of child views.
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getClassName + () +

    +
    +
    + + + +
    +
    + + + + +

    Retrieves the className property of the UI element.

    +
    +
    Returns
    +
    • class name of the current node represented by this UiObject
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException + if no match was found
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getContentDescription + () +

    +
    +
    + + + +
    +
    + + + + +

    Reads the content_desc property of the UI element

    +
    +
    Returns
    +
    • value of node attribute "content_desc"
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getFromParent + (UiSelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Creates a new UiObject for a sibling view or a child of the sibling view, + relative to the present UiObject.

    +
    +
    Parameters
    + + + + +
    selector + for a sibling view or children of the sibling view
    +
    +
    +
    Returns
    +
    • a new UiObject representing the matched view
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getPackageName + () +

    +
    +
    + + + +
    +
    + + + + +

    Reads the view's package property

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + final + + + UiSelector + + getSelector + () +

    +
    +
    + + + +
    +
    + + + + +

    Debugging helper. A test can dump the properties of a selector as a string + to its logs if needed. getSelector().toString();

    +
    +
    Returns
    + +
    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getText + () +

    +
    +
    + + + +
    +
    + + + + +

    Reads the text property of the UI element

    +
    +
    Returns
    +
    • text value of the current node represented by this UiObject
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException + if no match could be found
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + Rect + + getVisibleBounds + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the visible bounds of the view. + + If a portion of the view is visible, only the bounds of the visible portion are + reported.

    +
    +
    Returns
    +
    • Rect
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    +
    +
    See Also
    + +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isCheckable + () +

    +
    +
    + + + +
    +
    + + + + +

    Checks if the UI element's checkable property is currently true.

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isChecked + () +

    +
    +
    + + + +
    +
    + + + + +

    Check if the UI element's checked property is currently true

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isClickable + () +

    +
    +
    + + + +
    +
    + + + + +

    Checks if the UI element's clickable property is currently true.

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isEnabled + () +

    +
    +
    + + + +
    +
    + + + + +

    Checks if the UI element's enabled property is currently true.

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isFocusable + () +

    +
    +
    + + + +
    +
    + + + + +

    Check if the UI element's focusable property is currently true.

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isFocused + () +

    +
    +
    + + + +
    +
    + + + + +

    Check if the UI element's focused property is currently true

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isLongClickable + () +

    +
    +
    + + + +
    +
    + + + + +

    Check if the view's long-clickable property is currently true

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isScrollable + () +

    +
    +
    + + + +
    +
    + + + + +

    Check if the view's scrollable property is currently true

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isSelected + () +

    +
    +
    + + + +
    +
    + + + + +

    Checks if the UI element's selected property is currently true.

    +
    +
    Returns
    +
    • true if it is else false
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + longClick + () +

    +
    +
    + + + +
    +
    + + + + +

    Long clicks the center of the visible bounds of the UI element

    +
    +
    Returns
    +
    • true if operation was successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + longClickBottomRight + () +

    +
    +
    + + + +
    +
    + + + + +

    Long clicks bottom and right corner of the UI element

    +
    +
    Returns
    +
    • true if operation was successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + longClickTopLeft + () +

    +
    +
    + + + +
    +
    + + + + +

    Long clicks on the top and left corner of the UI element

    +
    +
    Returns
    +
    • true if operation was successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + performMultiPointerGesture + (PointerCoords... touches) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a multi-touch gesture. You must specify touch coordinates for + at least 2 pointers. Each pointer must have all of its touch steps + defined in an array of MotionEvent.PointerCoords. You can use this method to + specify complex gestures, like circles and irregular shapes, where each + pointer may take a different path. + + To create a single point on a pointer's touch path: + + PointerCoords p = new PointerCoords(); + p.x = stepX; + p.y = stepY; + p.pressure = 1; + p.size = 1; +

    +
    +
    Parameters
    + + + + +
    touches + represents the pointers' paths. Each MotionEvent.PointerCoords + array represents a different pointer. Each MotionEvent.PointerCoords in an + array element represents a touch point on a pointer's path.
    +
    +
    +
    Returns
    +
    • true if all touch events for this gesture are injected successfully, + false otherwise
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + performTwoPointerGesture + (Point startPoint1, Point startPoint2, Point endPoint1, Point endPoint2, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Generates a two-pointer gesture with arbitrary starting and ending points.

    +
    +
    Parameters
    + + + + + + + + + + + + + + + + +
    startPoint1 + start point of pointer 1
    startPoint2 + start point of pointer 2
    endPoint1 + end point of pointer 1
    endPoint2 + end point of pointer 2
    steps + the number of steps for the gesture. Steps are injected + about 5 milliseconds apart, so 100 steps may take around 0.5 seconds to complete.
    +
    +
    +
    Returns
    +
    • true if all touch events for this gesture are injected successfully, + false otherwise
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + pinchIn + (int percent, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a two-pointer gesture, where each pointer moves diagonally + toward the other, from the edges to the center of this UiObject .

    +
    +
    Parameters
    + + + + + + + +
    percent + percentage of the object's diagonal length for the pinch gesture
    steps + the number of steps for the gesture. Steps are injected + about 5 milliseconds apart, so 100 steps may take around 0.5 seconds to complete.
    +
    +
    +
    Returns
    +
    • true if all touch events for this gesture are injected successfully, + false otherwise
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + pinchOut + (int percent, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a two-pointer gesture, where each pointer moves diagonally + opposite across the other, from the center out towards the edges of the + this UiObject.

    +
    +
    Parameters
    + + + + + + + +
    percent + percentage of the object's diagonal length for the pinch gesture
    steps + the number of steps for the gesture. Steps are injected + about 5 milliseconds apart, so 100 steps may take around 0.5 seconds to complete.
    +
    +
    +
    Returns
    +
    • true if all touch events for this gesture are injected successfully, + false otherwise
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + setText + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Sets the text in an editable field, after clearing the field's content. + +

    + The UiSelector selector of this object must reference a UI element that is editable. + +

    + When you call this method, the method sets focus on the editable field, clears its existing + content, then injects your specified text into the field. + +

    + If you want to capture the original contents of the field, call getText() first. + You can then modify the text and use this method to update the field. + +

    Improvements: + Post API Level 19 (KitKat release), the underlying implementation is updated to a dedicated + set text accessibility action, and it also now supports Unicode.

    +
    +
    Parameters
    + + + + +
    text + string to set
    +
    +
    +
    Returns
    +
    • true if operation is successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + swipeDown + (int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs the swipe down action on the UiObject. + The swipe gesture can be performed over any surface. The targeted + UI element does not need to be scrollable. + See also: +

    +
    +
    Parameters
    + + + + +
    steps + indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.
    +
    +
    +
    Returns
    +
    • true if successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + swipeLeft + (int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs the swipe left action on the UiObject. + The swipe gesture can be performed over any surface. The targeted + UI element does not need to be scrollable. + See also: +

    +
    +
    Parameters
    + + + + +
    steps + indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.
    +
    +
    +
    Returns
    +
    • true if successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + swipeRight + (int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs the swipe right action on the UiObject. + The swipe gesture can be performed over any surface. The targeted + UI element does not need to be scrollable. + See also: +

    +
    +
    Parameters
    + + + + +
    steps + indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.
    +
    +
    +
    Returns
    +
    • true if successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + swipeUp + (int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs the swipe up action on the UiObject. + See also: +

    +
    +
    Parameters
    + + + + +
    steps + indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.
    +
    +
    +
    Returns
    +
    • true of successful
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + waitForExists + (long timeout) +

    +
    +
    + + + +
    +
    + + + + +

    Waits a specified length of time for a view to become visible. + + This method waits until the view becomes visible on the display, or + until the timeout has elapsed. You can use this method in situations where + the content that you want to select is not immediately displayed.

    +
    +
    Parameters
    + + + + +
    timeout + the amount of time to wait (in milliseconds)
    +
    +
    +
    Returns
    +
    • true if the view is displayed, else false if timeout elapsed while waiting
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + waitUntilGone + (long timeout) +

    +
    +
    + + + +
    +
    + + + + +

    Waits a specified length of time for a view to become undetectable. + + This method waits until a view is no longer matchable, or until the + timeout has elapsed. + + A view becomes undetectable when the UiSelector of the object is + unable to find a match because the element has either changed its state or is no + longer displayed. + + You can use this method when attempting to wait for some long operation + to compete, such as downloading a large file or connecting to a remote server.

    +
    +
    Parameters
    + + + + +
    timeout + time to wait (in milliseconds)
    +
    +
    +
    Returns
    +
    • true if the element is gone before timeout elapsed, else false if timeout elapsed + but a matching element is still found.
    +
    + +
    +
    + + + + + + + +

    Protected Methods

    + + + + + +
    +

    + + protected + + + + + AccessibilityNodeInfo + + findAccessibilityNodeInfo + (long timeout) +

    +
    +
    + + + +
    +
    + + + + +

    Finds a matching UI element in the accessibility hierarchy, by + using the selector for this UiObject.

    +
    +
    Parameters
    + + + + +
    timeout + in milliseconds
    +
    +
    +
    Returns
    +
    • AccessibilityNodeInfo if found else null
    +
    + +
    +
    + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiObject2.html b/docs/html/reference/android/support/test/uiautomator/UiObject2.html new file mode 100644 index 00000000000..4c198bfd529 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiObject2.html @@ -0,0 +1,3829 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiObject2 | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + + class +

    UiObject2

    + + + + + extends Object
    + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳android.support.test.uiautomator.UiObject2
    + + + + + + + +
    + + +

    Class Overview

    +

    A UiObject2 represents a UI element. Unlike UiObject, it is bound to a particular + view instance and can become stale if the underlying view object is destroyed. As a result, it + may be necessary to call findObject(BySelector) to obtain a new + UiObject2 instance if the UI changes significantly. +

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + void + + clear() + +
    + Clears the text content if this object is an editable field. + + + +
    + +
    + + + + + + void + + click() + +
    + Clicks on this object. + + + +
    + +
    + + + + + <R> + R + + clickAndWait(EventCondition<R> condition, long timeout) + +
    + Clicks on this object, and waits for the given condition to become true. + + + +
    + +
    + + + + + + void + + drag(Point dest, int speed) + +
    + Drags this object to the specified location. + + + +
    + +
    + + + + + + void + + drag(Point dest) + +
    + Drags this object to the specified location. + + + +
    + +
    + + + + + + boolean + + equals(Object object) + +
    + + + + +
    + +
    + + + + + + UiObject2 + + findObject(BySelector selector) + +
    + Searches all elements under this object and returns the first object to match the criteria. + + + +
    + +
    + + + + + + List<UiObject2> + + findObjects(BySelector selector) + +
    + Searches all elements under this object and returns all objects that match the criteria. + + + +
    + +
    + + + + + + boolean + + fling(Direction direction) + +
    + Performs a fling gesture on this object. + + + +
    + +
    + + + + + + boolean + + fling(Direction direction, int speed) + +
    + Performs a fling gesture on this object. + + + +
    + +
    + + + + + + String + + getApplicationPackage() + +
    + Returns the package name of the app that this object belongs to. + + + +
    + +
    + + + + + + int + + getChildCount() + +
    + Returns the number of child elements directly under this object. + + + +
    + +
    + + + + + + List<UiObject2> + + getChildren() + +
    + Returns a collection of the child elements directly under this object. + + + +
    + +
    + + + + + + String + + getClassName() + +
    + Returns the class name of the underlying View represented by this + object. + + + +
    + +
    + + + + + + String + + getContentDescription() + +
    + Returns the content description for this object. + + + +
    + +
    + + + + + + UiObject2 + + getParent() + +
    + Returns this object's parent. + + + +
    + +
    + + + + + + String + + getResourceName() + +
    + Returns the fully qualified resource name for this object's id. + + + +
    + +
    + + + + + + String + + getText() + +
    + Returns the text value for this object. + + + +
    + +
    + + + + + + Rect + + getVisibleBounds() + +
    + Returns the visible bounds of this object in screen coordinates. + + + +
    + +
    + + + + + + Point + + getVisibleCenter() + +
    + Returns a point in the center of the visible bounds of this object. + + + +
    + +
    + + + + + + boolean + + hasObject(BySelector selector) + +
    + Returns whether there is a match for the given criteria under this object. + + + +
    + +
    + + + + + + int + + hashCode() + +
    + + + + +
    + +
    + + + + + + boolean + + isCheckable() + +
    + Returns whether this object is checkable. + + + +
    + +
    + + + + + + boolean + + isChecked() + +
    + Returns whether this object is checked. + + + +
    + +
    + + + + + + boolean + + isClickable() + +
    + Returns whether this object is clickable. + + + +
    + +
    + + + + + + boolean + + isEnabled() + +
    + Returns whether this object is enabled. + + + +
    + +
    + + + + + + boolean + + isFocusable() + +
    + Returns whether this object is focusable. + + + +
    + +
    + + + + + + boolean + + isFocused() + +
    + Returns whether this object is focused. + + + +
    + +
    + + + + + + boolean + + isLongClickable() + +
    + Returns whether this object is long clickable. + + + +
    + +
    + + + + + + boolean + + isScrollable() + +
    + Returns whether this object is scrollable. + + + +
    + +
    + + + + + + boolean + + isSelected() + +
    + Returns whether this object is selected. + + + +
    + +
    + + + + + + void + + longClick() + +
    + Performs a long click on this object. + + + +
    + +
    + + + + + + void + + pinchClose(float percent, int speed) + +
    + Performs a pinch close gesture on this object. + + + +
    + +
    + + + + + + void + + pinchClose(float percent) + +
    + Performs a pinch close gesture on this object. + + + +
    + +
    + + + + + + void + + pinchOpen(float percent, int speed) + +
    + Performs a pinch open gesture on this object. + + + +
    + +
    + + + + + + void + + pinchOpen(float percent) + +
    + Performs a pinch open gesture on this object. + + + +
    + +
    + + + + + + void + + recycle() + +
    + Recycle this object. + + + +
    + +
    + + + + + + boolean + + scroll(Direction direction, float percent) + +
    + Performs a scroll gesture on this object. + + + +
    + +
    + + + + + + boolean + + scroll(Direction direction, float percent, int speed) + +
    + Performs a scroll gesture on this object. + + + +
    + +
    + + + + + + void + + setGestureMargin(int margin) + +
    + Sets the margins used for gestures in pixels. + + + +
    + +
    + + + + + + void + + setGestureMargins(int left, int top, int right, int bottom) + +
    + Sets the margins used for gestures in pixels. + + + +
    + +
    + + + + + + void + + setText(String text) + +
    + Sets the text content if this object is an editable field. + + + +
    + +
    + + + + + + void + + swipe(Direction direction, float percent, int speed) + +
    + Performs a swipe gesture on this object. + + + +
    + +
    + + + + + + void + + swipe(Direction direction, float percent) + +
    + Performs a swipe gesture on this object. + + + +
    + +
    + + + + + <R> + R + + wait(UiObject2Condition<R> condition, long timeout) + +
    + Waits for given the condition to be met. + + + +
    + +
    + + + + + <R> + R + + wait(SearchCondition<R> condition, long timeout) + +
    + Waits for given the condition to be met. + + + +
    + +
    + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Methods

    + + + + + +
    +

    + + public + + + + + void + + clear + () +

    +
    +
    + + + +
    +
    + + + + +

    Clears the text content if this object is an editable field.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + click + () +

    +
    +
    + + + +
    +
    + + + + +

    Clicks on this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + R + + clickAndWait + (EventCondition<R> condition, long timeout) +

    +
    +
    + + + +
    +
    + + + + +

    Clicks on this object, and waits for the given condition to become true.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + drag + (Point dest, int speed) +

    +
    +
    + + + +
    +
    + + + + +

    Drags this object to the specified location.

    +
    +
    Parameters
    + + + + + + + +
    dest + The end point that this object should be dragged to.
    speed + The speed at which to perform this gesture in pixels per second. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + drag + (Point dest) +

    +
    +
    + + + +
    +
    + + + + +

    Drags this object to the specified location.

    +
    +
    Parameters
    + + + + +
    dest + The end point that this object should be dragged to. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + equals + (Object object) +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject2 + + findObject + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Searches all elements under this object and returns the first object to match the criteria. +

    + +
    +
    + + + + +
    +

    + + public + + + + + List<UiObject2> + + findObjects + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Searches all elements under this object and returns all objects that match the criteria.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + fling + (Direction direction) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a fling gesture on this object.

    +
    +
    Parameters
    + + + + +
    direction + The direction in which to fling.
    +
    +
    +
    Returns
    +
    • Whether the object can still scroll in the given direction. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + fling + (Direction direction, int speed) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a fling gesture on this object.

    +
    +
    Parameters
    + + + + + + + +
    direction + The direction in which to fling.
    speed + The speed at which to perform this gesture in pixels per second.
    +
    +
    +
    Returns
    +
    • Whether the object can still scroll in the given direction. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getApplicationPackage + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the package name of the app that this object belongs to.

    + +
    +
    + + + + +
    +

    + + public + + + + + int + + getChildCount + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the number of child elements directly under this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + List<UiObject2> + + getChildren + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns a collection of the child elements directly under this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getClassName + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the class name of the underlying View represented by this + object. +

    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getContentDescription + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the content description for this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject2 + + getParent + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns this object's parent.

    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getResourceName + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the fully qualified resource name for this object's id.

    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getText + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the text value for this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + Rect + + getVisibleBounds + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the visible bounds of this object in screen coordinates.

    + +
    +
    + + + + +
    +

    + + public + + + + + Point + + getVisibleCenter + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns a point in the center of the visible bounds of this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + hasObject + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether there is a match for the given criteria under this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + int + + hashCode + () +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isCheckable + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is checkable.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isChecked + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is checked.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isClickable + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is clickable.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isEnabled + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is enabled.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isFocusable + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is focusable.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isFocused + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is focused.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isLongClickable + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is long clickable.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isScrollable + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is scrollable.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isSelected + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns whether this object is selected.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + longClick + () +

    +
    +
    + + + +
    +
    + + + + +

    Performs a long click on this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + pinchClose + (float percent, int speed) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a pinch close gesture on this object.

    +
    +
    Parameters
    + + + + + + + +
    percent + The size of the pinch as a percentage of this object's size.
    speed + The speed at which to perform this gesture in pixels per second. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + pinchClose + (float percent) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a pinch close gesture on this object.

    +
    +
    Parameters
    + + + + +
    percent + The size of the pinch as a percentage of this object's size. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + pinchOpen + (float percent, int speed) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a pinch open gesture on this object.

    +
    +
    Parameters
    + + + + + + + +
    percent + The size of the pinch as a percentage of this object's size.
    speed + The speed at which to perform this gesture in pixels per second. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + pinchOpen + (float percent) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a pinch open gesture on this object.

    +
    +
    Parameters
    + + + + +
    percent + The size of the pinch as a percentage of this object's size. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + recycle + () +

    +
    +
    + + + +
    +
    + + + + +

    Recycle this object.

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scroll + (Direction direction, float percent) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a scroll gesture on this object.

    +
    +
    Parameters
    + + + + + + + +
    direction + The direction in which to scroll.
    percent + The distance to scroll as a percentage of this object's visible size.
    +
    +
    +
    Returns
    +
    • Whether the object can still scroll in the given direction. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scroll + (Direction direction, float percent, int speed) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a scroll gesture on this object.

    +
    +
    Parameters
    + + + + + + + + + + +
    direction + The direction in which to scroll.
    percent + The distance to scroll as a percentage of this object's visible size.
    speed + The speed at which to perform this gesture in pixels per second.
    +
    +
    +
    Returns
    +
    • Whether the object can still scroll in the given direction. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setGestureMargin + (int margin) +

    +
    +
    + + + +
    +
    + + + + +

    Sets the margins used for gestures in pixels.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setGestureMargins + (int left, int top, int right, int bottom) +

    +
    +
    + + + +
    +
    + + + + +

    Sets the margins used for gestures in pixels.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setText + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Sets the text content if this object is an editable field.

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + swipe + (Direction direction, float percent, int speed) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a swipe gesture on this object.

    +
    +
    Parameters
    + + + + + + + + + + +
    direction + The direction in which to swipe.
    percent + The length of the swipe as a percentage of this object's size.
    speed + The speed at which to perform this gesture in pixels per second. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + swipe + (Direction direction, float percent) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a swipe gesture on this object.

    +
    +
    Parameters
    + + + + + + + +
    direction + The direction in which to swipe.
    percent + The length of the swipe as a percentage of this object's size. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + R + + wait + (UiObject2Condition<R> condition, long timeout) +

    +
    +
    + + + +
    +
    + + + + +

    Waits for given the condition to be met.

    +
    +
    Parameters
    + + + + + + + +
    condition + The UiObject2Condition to evaluate.
    timeout + Maximum amount of time to wait in milliseconds.
    +
    +
    +
    Returns
    +
    • The final result returned by the condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + R + + wait + (SearchCondition<R> condition, long timeout) +

    +
    +
    + + + +
    +
    + + + + +

    Waits for given the condition to be met.

    +
    +
    Parameters
    + + + + + + + +
    condition + The SearchCondition to evaluate.
    timeout + Maximum amount of time to wait in milliseconds.
    +
    +
    +
    Returns
    +
    • The final result returned by the condition. +
    +
    + +
    +
    + + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiObject2Condition.html b/docs/html/reference/android/support/test/uiautomator/UiObject2Condition.html new file mode 100644 index 00000000000..d2eeb77c941 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiObject2Condition.html @@ -0,0 +1,1131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiObject2Condition | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + abstract + class +

    UiObject2Condition

    + + + + + extends Object
    + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳android.support.test.uiautomator.UiObject2Condition<R>
    + + + + + + + +
    + + +

    Class Overview

    +

    A UiObject2Condition is a condition which is satisfied when a UiObject2 is in a + particular state. +

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + UiObject2Condition() + +
    + + + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + UiObject2Condition + () +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiObjectNotFoundException.html b/docs/html/reference/android/support/test/uiautomator/UiObjectNotFoundException.html new file mode 100644 index 00000000000..917816faa71 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiObjectNotFoundException.html @@ -0,0 +1,1511 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiObjectNotFoundException | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + + class +

    UiObjectNotFoundException

    + + + + + + + + + + + + + extends Exception
    + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳java.lang.Throwable
        ↳java.lang.Exception
         ↳android.support.test.uiautomator.UiObjectNotFoundException
    + + + + + + + +
    + + +

    Class Overview

    +

    Generated in test runs when a UiSelector selector could not be matched + to any UI element displayed.

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + UiObjectNotFoundException(String msg) + +
    + + + + + + + + UiObjectNotFoundException(String detailMessage, Throwable throwable) + +
    + + + + + + + + UiObjectNotFoundException(Throwable throwable) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Throwable + +
    + + +
    +
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + UiObjectNotFoundException + (String msg) +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + +
    +

    + + public + + + + + + + UiObjectNotFoundException + (String detailMessage, Throwable throwable) +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + +
    +

    + + public + + + + + + + UiObjectNotFoundException + (Throwable throwable) +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiScrollable.html b/docs/html/reference/android/support/test/uiautomator/UiScrollable.html new file mode 100644 index 00000000000..a3feca3595d --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiScrollable.html @@ -0,0 +1,4623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiScrollable | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + + class +

    UiScrollable

    + + + + + + + + + + + + + extends UiCollection
    + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳android.support.test.uiautomator.UiObject
        ↳android.support.test.uiautomator.UiCollection
         ↳android.support.test.uiautomator.UiScrollable
    + + + + + + + +
    + + +

    Class Overview

    +

    UiScrollable is a UiCollection and provides support for searching + for items in scrollable layout elements. This class can be used with + horizontally or vertically scrollable controls.

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Constants
    + + From class +android.support.test.uiautomator.UiObject +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + UiScrollable(UiSelector container) + +
    + Constructor. + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + boolean + + flingBackward() + +
    + Performs a backwards fling action with the default number of fling + steps (5). + + + +
    + +
    + + + + + + boolean + + flingForward() + +
    + Performs a forward fling with the default number of fling steps (5). + + + +
    + +
    + + + + + + boolean + + flingToBeginning(int maxSwipes) + +
    + Performs a fling gesture to reach the beginning of a scrollable layout element. + + + +
    + +
    + + + + + + boolean + + flingToEnd(int maxSwipes) + +
    + Performs a fling gesture to reach the end of a scrollable layout element. + + + +
    + +
    + + + + + + UiObject + + getChildByDescription(UiSelector childPattern, String text) + +
    + Searches for a child element in the present scrollable container. + + + +
    + +
    + + + + + + UiObject + + getChildByDescription(UiSelector childPattern, String text, boolean allowScrollSearch) + +
    + Searches for a child element in the present scrollable container. + + + +
    + +
    + + + + + + UiObject + + getChildByInstance(UiSelector childPattern, int instance) + +
    + Searches for a child element in the present scrollable container that + matches the selector you provided. + + + +
    + +
    + + + + + + UiObject + + getChildByText(UiSelector childPattern, String text) + +
    + Searches for a child element in the present scrollable + container. + + + +
    + +
    + + + + + + UiObject + + getChildByText(UiSelector childPattern, String text, boolean allowScrollSearch) + +
    + Searches for a child element in the present scrollable container. + + + +
    + +
    + + + + + + int + + getMaxSearchSwipes() + +
    + Gets the maximum number of scrolls allowed when performing a + scroll action in search of a child element. + + + +
    + +
    + + + + + + double + + getSwipeDeadZonePercentage() + +
    + Returns the percentage of a widget's size that's considered as a no-touch + zone when swiping. + + + +
    + +
    + + + + + + boolean + + scrollBackward(int steps) + +
    + Performs a backward scroll. + + + +
    + +
    + + + + + + boolean + + scrollBackward() + +
    + Performs a backward scroll with the default number of scroll steps (55). + + + +
    + +
    + + + + + + boolean + + scrollDescriptionIntoView(String text) + +
    + Performs a forward scroll action on the scrollable layout element until + the content-description is found, or until swipe attempts have been exhausted. + + + +
    + +
    + + + + + + boolean + + scrollForward() + +
    + Performs a forward scroll with the default number of scroll steps (55). + + + +
    + +
    + + + + + + boolean + + scrollForward(int steps) + +
    + Performs a forward scroll. + + + +
    + +
    + + + + + + boolean + + scrollIntoView(UiSelector selector) + +
    + Perform a scroll forward action to move through the scrollable layout + element until a visible item that matches the selector is found. + + + +
    + +
    + + + + + + boolean + + scrollIntoView(UiObject obj) + +
    + Perform a forward scroll action to move through the scrollable layout element until + a visible item that matches the UiObject is found. + + + +
    + +
    + + + + + + boolean + + scrollTextIntoView(String text) + +
    + Performs a forward scroll action on the scrollable layout element until + the text you provided is visible, or until swipe attempts have been exhausted. + + + +
    + +
    + + + + + + boolean + + scrollToBeginning(int maxSwipes) + +
    + Scrolls to the beginning of a scrollable layout element. + + + +
    + +
    + + + + + + boolean + + scrollToBeginning(int maxSwipes, int steps) + +
    + Scrolls to the beginning of a scrollable layout element. + + + +
    + +
    + + + + + + boolean + + scrollToEnd(int maxSwipes, int steps) + +
    + Scrolls to the end of a scrollable layout element. + + + +
    + +
    + + + + + + boolean + + scrollToEnd(int maxSwipes) + +
    + Scrolls to the end of a scrollable layout element. + + + +
    + +
    + + + + + + UiScrollable + + setAsHorizontalList() + +
    + Set the direction of swipes to be horizontal when performing scroll actions. + + + +
    + +
    + + + + + + UiScrollable + + setAsVerticalList() + +
    + Set the direction of swipes to be vertical when performing scroll actions. + + + +
    + +
    + + + + + + UiScrollable + + setMaxSearchSwipes(int swipes) + +
    + Sets the maximum number of scrolls allowed when performing a + scroll action in search of a child element. + + + +
    + +
    + + + + + + UiScrollable + + setSwipeDeadZonePercentage(double swipeDeadZonePercentage) + +
    + Sets the percentage of a widget's size that's considered as no-touch + zone when swiping. + + + +
    + +
    + + + + + + + + + + + + + + + + +
    Protected Methods
    + + + + + + boolean + + exists(UiSelector selector) + +
    + Used privately when performing swipe searches to decide if an element has become + visible or not. + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + android.support.test.uiautomator.UiCollection + +
    + + +
    +
    + +From class + + android.support.test.uiautomator.UiObject + +
    + + +
    +
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + UiScrollable + (UiSelector container) +

    +
    +
    + + + +
    +
    + + + + +

    Constructor.

    +
    +
    Parameters
    + + + + +
    container + a UiSelector selector to identify the scrollable + layout element.
    +
    + +
    +
    + + + + + + + + + + + + + +

    Public Methods

    + + + + + +
    +

    + + public + + + + + boolean + + flingBackward + () +

    +
    +
    + + + +
    +
    + + + + +

    Performs a backwards fling action with the default number of fling + steps (5). If the swipe direction is set to vertical, + then the swipe will be performed from top to bottom. If the swipe + direction is set to horizontal, then the swipes will be performed from + left to right. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true if scrolled, and false if can't scroll anymore
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + flingForward + () +

    +
    +
    + + + +
    +
    + + + + +

    Performs a forward fling with the default number of fling steps (5). + If the swipe direction is set to vertical, then the swipes will be + performed from bottom to top. If the swipe + direction is set to horizontal, then the swipes will be performed from + right to left. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true if scrolled, false if can't scroll anymore
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + flingToBeginning + (int maxSwipes) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a fling gesture to reach the beginning of a scrollable layout element. + The beginning can be at the top-most edge in the case of vertical controls, or + the left-most edge for horizontal controls. Make sure to take into + account devices configured with right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true on scrolled else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + flingToEnd + (int maxSwipes) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a fling gesture to reach the end of a scrollable layout element. + The end can be at the bottom-most edge in the case of vertical controls, or + the right-most edge for horizontal controls. Make sure to take into + account devices configured with right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true on scrolled, else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getChildByDescription + (UiSelector childPattern, String text) +

    +
    +
    + + + +
    +
    + + + + +

    Searches for a child element in the present scrollable container. + The search first looks for a child element that matches the selector + you provided, then looks for the content-description in its children elements. + If both search conditions are fulfilled, the method returns a {@ link UiObject} + representing the element matching the selector (not the child element in its + subhierarchy containing the content-description). By default, this method performs a + scroll search. + See getChildByDescription(UiSelector, String, boolean)

    +
    +
    Parameters
    + + + + + + + +
    childPattern + UiSelector for a child in a scollable layout element
    text + Content-description to find in the children of + the childPattern match
    +
    +
    +
    Returns
    +
    • UiObject representing the child element that matches the search conditions
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getChildByDescription + (UiSelector childPattern, String text, boolean allowScrollSearch) +

    +
    +
    + + + +
    +
    + + + + +

    Searches for a child element in the present scrollable container. + The search first looks for a child element that matches the selector + you provided, then looks for the content-description in its children elements. + If both search conditions are fulfilled, the method returns a {@ link UiObject} + representing the element matching the selector (not the child element in its + subhierarchy containing the content-description).

    +
    +
    Parameters
    + + + + + + + + + + +
    childPattern + UiSelector for a child in a scollable layout element
    text + Content-description to find in the children of + the childPattern match (may be a partial match)
    allowScrollSearch + set to true if scrolling is allowed
    +
    +
    +
    Returns
    +
    • UiObject representing the child element that matches the search conditions
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getChildByInstance + (UiSelector childPattern, int instance) +

    +
    +
    + + + +
    +
    + + + + +

    Searches for a child element in the present scrollable container that + matches the selector you provided. The search is performed without + scrolling and only on visible elements.

    +
    +
    Parameters
    + + + + + + + +
    childPattern + UiSelector for a child in a scollable layout element
    instance + int number representing the occurance of + a childPattern match
    +
    +
    +
    Returns
    +
    • UiObject representing the child element that matches the search conditions
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getChildByText + (UiSelector childPattern, String text) +

    +
    +
    + + + +
    +
    + + + + +

    Searches for a child element in the present scrollable + container. The search first looks for a child element that matches the + selector you provided, then looks for the text in its children elements. + If both search conditions are fulfilled, the method returns a {@ link UiObject} + representing the element matching the selector (not the child element in its + subhierarchy containing the text). By default, this method performs a + scroll search. + See getChildByText(UiSelector, String, boolean)

    +
    +
    Parameters
    + + + + + + + +
    childPattern + UiSelector selector for a child in a scrollable layout element
    text + String to find in the children of the childPattern match
    +
    +
    +
    Returns
    +
    • UiObject representing the child element that matches the search conditions
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiObject + + getChildByText + (UiSelector childPattern, String text, boolean allowScrollSearch) +

    +
    +
    + + + +
    +
    + + + + +

    Searches for a child element in the present scrollable container. The + search first looks for a child element that matches the + selector you provided, then looks for the text in its children elements. + If both search conditions are fulfilled, the method returns a {@ link UiObject} + representing the element matching the selector (not the child element in its + subhierarchy containing the text).

    +
    +
    Parameters
    + + + + + + + + + + +
    childPattern + UiSelector selector for a child in a scrollable layout element
    text + String to find in the children of the childPattern match
    allowScrollSearch + set to true if scrolling is allowed
    +
    +
    +
    Returns
    +
    • UiObject representing the child element that matches the search conditions
    +
    +
    +
    Throws
    + + + + + + + +
    + UiObjectNotFoundException
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + int + + getMaxSearchSwipes + () +

    +
    +
    + + + +
    +
    + + + + +

    Gets the maximum number of scrolls allowed when performing a + scroll action in search of a child element. + See getChildByDescription(UiSelector, String) and + getChildByText(UiSelector, String).

    +
    +
    Returns
    +
    • max the number of search swipes to perform until giving up
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + double + + getSwipeDeadZonePercentage + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns the percentage of a widget's size that's considered as a no-touch + zone when swiping. The no-touch zone is set as a percentage of a widget's total + width or height, denoting a margin around the swipable area of the widget. + Swipes must start and end inside this margin. This is important when the + widget being swiped may not respond to the swipe if started at a point + too near to the edge. The default is 10% from either edge.

    +
    +
    Returns
    +
    • a value between 0 and 1
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollBackward + (int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a backward scroll. If the swipe direction is set to vertical, + then the swipes will be performed from top to bottom. If the swipe + direction is set to horizontal, then the swipes will be performed from + left to right. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Parameters
    + + + + +
    steps + number of steps. Use this to control the speed of the scroll action.
    +
    +
    +
    Returns
    +
    • true if scrolled, false if can't scroll anymore
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollBackward + () +

    +
    +
    + + + +
    +
    + + + + +

    Performs a backward scroll with the default number of scroll steps (55). + If the swipe direction is set to vertical, + then the swipes will be performed from top to bottom. If the swipe + direction is set to horizontal, then the swipes will be performed from + left to right. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true if scrolled, and false if can't scroll anymore
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollDescriptionIntoView + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a forward scroll action on the scrollable layout element until + the content-description is found, or until swipe attempts have been exhausted. + See setMaxSearchSwipes(int)

    +
    +
    Parameters
    + + + + +
    text + content-description to find within the contents of this scrollable layout element.
    +
    +
    +
    Returns
    +
    • true if item is found; else, false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollForward + () +

    +
    +
    + + + +
    +
    + + + + +

    Performs a forward scroll with the default number of scroll steps (55). + If the swipe direction is set to vertical, + then the swipes will be performed from bottom to top. If the swipe + direction is set to horizontal, then the swipes will be performed from + right to left. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true if scrolled, false if can't scroll anymore
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollForward + (int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a forward scroll. If the swipe direction is set to vertical, + then the swipes will be performed from bottom to top. If the swipe + direction is set to horizontal, then the swipes will be performed from + right to left. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Parameters
    + + + + +
    steps + number of steps. Use this to control the speed of the scroll action
    +
    +
    +
    Returns
    +
    • true if scrolled, false if can't scroll anymore
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollIntoView + (UiSelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Perform a scroll forward action to move through the scrollable layout + element until a visible item that matches the selector is found. + + See scrollDescriptionIntoView(String) and scrollTextIntoView(String).

    +
    +
    Parameters
    + + + + +
    selector + UiSelector selector
    +
    +
    +
    Returns
    +
    • true if the item was found and now is in view; else, false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollIntoView + (UiObject obj) +

    +
    +
    + + + +
    +
    + + + + +

    Perform a forward scroll action to move through the scrollable layout element until + a visible item that matches the UiObject is found.

    +
    +
    Parameters
    + + + + +
    obj + UiObject
    +
    +
    +
    Returns
    +
    • true if the item was found and now is in view else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollTextIntoView + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Performs a forward scroll action on the scrollable layout element until + the text you provided is visible, or until swipe attempts have been exhausted. + See setMaxSearchSwipes(int)

    +
    +
    Parameters
    + + + + +
    text + test to look for
    +
    +
    +
    Returns
    +
    • true if item is found; else, false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollToBeginning + (int maxSwipes) +

    +
    +
    + + + +
    +
    + + + + +

    Scrolls to the beginning of a scrollable layout element. The beginning + can be at the top-most edge in the case of vertical controls, or the + left-most edge for horizontal controls. Make sure to take into account + devices configured with right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true on scrolled else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollToBeginning + (int maxSwipes, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Scrolls to the beginning of a scrollable layout element. The beginning + can be at the top-most edge in the case of vertical controls, or the + left-most edge for horizontal controls. Make sure to take into account + devices configured with right-to-left languages like Arabic and Hebrew.

    +
    +
    Parameters
    + + + + +
    steps + use steps to control the speed, so that it may be a scroll, or fling
    +
    +
    +
    Returns
    +
    • true on scrolled else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollToEnd + (int maxSwipes, int steps) +

    +
    +
    + + + +
    +
    + + + + +

    Scrolls to the end of a scrollable layout element. The end can be at the + bottom-most edge in the case of vertical controls, or the right-most edge for + horizontal controls. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Parameters
    + + + + +
    steps + use steps to control the speed, so that it may be a scroll, or fling
    +
    +
    +
    Returns
    +
    • true on scrolled else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + scrollToEnd + (int maxSwipes) +

    +
    +
    + + + +
    +
    + + + + +

    Scrolls to the end of a scrollable layout element. The end can be at the + bottom-most edge in the case of vertical controls, or the right-most edge for + horizontal controls. Make sure to take into account devices configured with + right-to-left languages like Arabic and Hebrew.

    +
    +
    Returns
    +
    • true on scrolled, else false
    +
    +
    +
    Throws
    + + + + +
    UiObjectNotFoundException +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiScrollable + + setAsHorizontalList + () +

    +
    +
    + + + +
    +
    + + + + +

    Set the direction of swipes to be horizontal when performing scroll actions.

    +
    +
    Returns
    +
    • reference to itself
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiScrollable + + setAsVerticalList + () +

    +
    +
    + + + +
    +
    + + + + +

    Set the direction of swipes to be vertical when performing scroll actions.

    +
    +
    Returns
    +
    • reference to itself
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiScrollable + + setMaxSearchSwipes + (int swipes) +

    +
    +
    + + + +
    +
    + + + + +

    Sets the maximum number of scrolls allowed when performing a + scroll action in search of a child element. + See getChildByDescription(UiSelector, String) and + getChildByText(UiSelector, String).

    +
    +
    Parameters
    + + + + +
    swipes + the number of search swipes to perform until giving up
    +
    +
    +
    Returns
    +
    • reference to itself
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiScrollable + + setSwipeDeadZonePercentage + (double swipeDeadZonePercentage) +

    +
    +
    + + + +
    +
    + + + + +

    Sets the percentage of a widget's size that's considered as no-touch + zone when swiping. + The no-touch zone is set as percentage of a widget's total width or height, + denoting a margin around the swipable area of the widget. Swipes must + always start and end inside this margin. This is important when the + widget being swiped may not respond to the swipe if started at a point + too near to the edge. The default is 10% from either edge.

    +
    +
    Parameters
    + + + + +
    swipeDeadZonePercentage + is a value between 0 and 1
    +
    +
    +
    Returns
    +
    • reference to itself
    +
    + +
    +
    + + + + + + + +

    Protected Methods

    + + + + + +
    +

    + + protected + + + + + boolean + + exists + (UiSelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Used privately when performing swipe searches to decide if an element has become + visible or not.

    +
    +
    Returns
    +
    • true if found else false
    +
    + +
    +
    + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiSelector.html b/docs/html/reference/android/support/test/uiautomator/UiSelector.html new file mode 100644 index 00000000000..0698a449c2e --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiSelector.html @@ -0,0 +1,3328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiSelector | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + + class +

    UiSelector

    + + + + + extends Object
    + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳android.support.test.uiautomator.UiSelector
    + + + + + + + +
    + + +

    Class Overview

    +

    Specifies the elements in the layout hierarchy for tests to target, filtered + by properties such as text value, content-description, class name, and state + information. You can also target an element by its location in a layout + hierarchy.

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + UiSelector() + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + UiSelector + + checkable(boolean val) + +
    + Set the search criteria to match widgets that are checkable. + + + +
    + +
    + + + + + + UiSelector + + checked(boolean val) + +
    + Set the search criteria to match widgets that + are currently checked (usually for checkboxes). + + + +
    + +
    + + + + + + UiSelector + + childSelector(UiSelector selector) + +
    + Adds a child UiSelector criteria to this selector. + + + +
    + +
    + + + + + + UiSelector + + className(String className) + +
    + Set the search criteria to match the class property + for a widget (for example, "android.widget.Button"). + + + +
    + +
    + + + + + <T> + UiSelector + + className(Class<T> type) + +
    + Set the search criteria to match the class property + for a widget (for example, "android.widget.Button"). + + + +
    + +
    + + + + + + UiSelector + + classNameMatches(String regex) + +
    + Set the search criteria to match the class property + for a widget, using a regular expression. + + + +
    + +
    + + + + + + UiSelector + + clickable(boolean val) + +
    + Set the search criteria to match widgets that are clickable. + + + +
    + +
    + + + + + + UiSelector + + description(String desc) + +
    + Set the search criteria to match the content-description + property for a widget. + + + +
    + +
    + + + + + + UiSelector + + descriptionContains(String desc) + +
    + Set the search criteria to match the content-description + property for a widget. + + + +
    + +
    + + + + + + UiSelector + + descriptionMatches(String regex) + +
    + Set the search criteria to match the content-description + property for a widget. + + + +
    + +
    + + + + + + UiSelector + + descriptionStartsWith(String desc) + +
    + Set the search criteria to match the content-description + property for a widget. + + + +
    + +
    + + + + + + UiSelector + + enabled(boolean val) + +
    + Set the search criteria to match widgets that are enabled. + + + +
    + +
    + + + + + + UiSelector + + focusable(boolean val) + +
    + Set the search criteria to match widgets that are focusable. + + + +
    + +
    + + + + + + UiSelector + + focused(boolean val) + +
    + Set the search criteria to match widgets that have focus. + + + +
    + +
    + + + + + + UiSelector + + fromParent(UiSelector selector) + +
    + Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget. + + + +
    + +
    + + + + + + UiSelector + + index(int index) + +
    + Set the search criteria to match the widget by its node + index in the layout hierarchy. + + + +
    + +
    + + + + + + UiSelector + + instance(int instance) + +
    + Set the search criteria to match the + widget by its instance number. + + + +
    + +
    + + + + + + UiSelector + + longClickable(boolean val) + +
    + Set the search criteria to match widgets that are long-clickable. + + + +
    + +
    + + + + + + UiSelector + + packageName(String name) + +
    + Set the search criteria to match the package name + of the application that contains the widget. + + + +
    + +
    + + + + + + UiSelector + + packageNameMatches(String regex) + +
    + Set the search criteria to match the package name + of the application that contains the widget. + + + +
    + +
    + + + + + + UiSelector + + resourceId(String id) + +
    + Set the search criteria to match the given resource ID. + + + +
    + +
    + + + + + + UiSelector + + resourceIdMatches(String regex) + +
    + Set the search criteria to match the resource ID + of the widget, using a regular expression. + + + +
    + +
    + + + + + + UiSelector + + scrollable(boolean val) + +
    + Set the search criteria to match widgets that are scrollable. + + + +
    + +
    + + + + + + UiSelector + + selected(boolean val) + +
    + Set the search criteria to match widgets that + are currently selected. + + + +
    + +
    + + + + + + UiSelector + + text(String text) + +
    + Set the search criteria to match the visible text displayed + in a widget (for example, the text label to launch an app). + + + +
    + +
    + + + + + + UiSelector + + textContains(String text) + +
    + Set the search criteria to match the visible text in a widget + where the visible text must contain the string in your input argument. + + + +
    + +
    + + + + + + UiSelector + + textMatches(String regex) + +
    + Set the search criteria to match the visible text displayed in a layout + element, using a regular expression. + + + +
    + +
    + + + + + + UiSelector + + textStartsWith(String text) + +
    + Set the search criteria to match visible text in a widget that is + prefixed by the text parameter. + + + +
    + +
    + + + + + + String + + toString() + +
    + + + + + + + + + + + + + + + + +
    Protected Methods
    + + + + + + UiSelector + + cloneSelector() + +
    + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + UiSelector + () +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + + + + + + + + + + +

    Public Methods

    + + + + + +
    +

    + + public + + + + + UiSelector + + checkable + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that are checkable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + checked + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that + are currently checked (usually for checkboxes). + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + childSelector + (UiSelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Adds a child UiSelector criteria to this selector. + + Use this selector to narrow the search scope to + child widgets under a specific parent widget.

    +
    +
    Returns
    +
    • UiSelector with this added search criterion
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + className + (String className) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").

    +
    +
    Parameters
    + + + + +
    className + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + className + (Class<T> type) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").

    +
    +
    Parameters
    + + + + +
    type + type
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + classNameMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the class property + for a widget, using a regular expression.

    +
    +
    Parameters
    + + + + +
    regex + a regular expression
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + clickable + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that are clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + description + (String desc) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument. + + Matching is case-sensitive.

    +
    +
    Parameters
    + + + + +
    desc + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + descriptionContains + (String desc) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must contain + the string in your input argument. + + Matching is case-insensitive.

    +
    +
    Parameters
    + + + + +
    desc + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + descriptionMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument.

    +
    +
    Parameters
    + + + + +
    regex + a regular expression
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + descriptionStartsWith + (String desc) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must start + with the string in your input argument. + + Matching is case-insensitive.

    +
    +
    Parameters
    + + + + +
    desc + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + enabled + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that are enabled. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + focusable + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that are focusable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + focused + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that have focus. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + fromParent + (UiSelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget. + + Use this selector to narrow the search scope to + sibling widgets as well all child widgets under a parent.

    +
    +
    Returns
    +
    • UiSelector with this added search criterion
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + index + (int index) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the widget by its node + index in the layout hierarchy. + + The index value must be 0 or greater. + + Using the index can be unreliable and should only + be used as a last resort for matching. Instead, + consider using the instance(int) method.

    +
    +
    Parameters
    + + + + +
    index + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + instance + (int instance) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the + widget by its instance number. + + The instance value must be 0 or greater, where + the first instance is 0. + + For example, to simulate a user click on + the third image that is enabled in a UI screen, you + could specify a a search criteria where the instance is + 2, the className(String) matches the image + widget class, and enabled(boolean) is true. + The code would look like this: + + new UiSelector().className("android.widget.ImageView") + .enabled(true).instance(2); +

    +
    +
    Parameters
    + + + + +
    instance + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + longClickable + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that are long-clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + packageName + (String name) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the package name + of the application that contains the widget.

    +
    +
    Parameters
    + + + + +
    name + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + packageNameMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the package name + of the application that contains the widget.

    +
    +
    Parameters
    + + + + +
    regex + a regular expression
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + resourceId + (String id) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the given resource ID.

    +
    +
    Parameters
    + + + + +
    id + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + resourceIdMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the resource ID + of the widget, using a regular expression.

    +
    +
    Parameters
    + + + + +
    regex + a regular expression
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + scrollable + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that are scrollable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + selected + (boolean val) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match widgets that + are currently selected. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.

    +
    +
    Parameters
    + + + + +
    val + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + text + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the visible text displayed + in a widget (for example, the text label to launch an app). + + The text for the element must match exactly with the string in your input + argument. Matching is case-sensitive.

    +
    +
    Parameters
    + + + + +
    text + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + textContains + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the visible text in a widget + where the visible text must contain the string in your input argument. + + The matching is case-sensitive.

    +
    +
    Parameters
    + + + + +
    text + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + textMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match the visible text displayed in a layout + element, using a regular expression. + + The text in the widget must match exactly with the string in your + input argument.

    +
    +
    Parameters
    + + + + +
    regex + a regular expression
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + UiSelector + + textStartsWith + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Set the search criteria to match visible text in a widget that is + prefixed by the text parameter. + + The matching is case-insensitive.

    +
    +
    Parameters
    + + + + +
    text + Value to match
    +
    +
    +
    Returns
    +
    • UiSelector with the specified search criteria
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + String + + toString + () +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + + + + +

    Protected Methods

    + + + + + +
    +

    + + protected + + + + + UiSelector + + cloneSelector + () +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/UiWatcher.html b/docs/html/reference/android/support/test/uiautomator/UiWatcher.html new file mode 100644 index 00000000000..0ebb057ce3e --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/UiWatcher.html @@ -0,0 +1,909 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +UiWatcher | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + + interface +

    UiWatcher

    + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + +
    android.support.test.uiautomator.UiWatcher
    + + + + + + + +
    + + +

    Class Overview

    +

    See registerWatcher(String, UiWatcher) on how to register a + a condition watcher to be called by the automation library. The automation library will + invoke checkForCondition() only when a regular API call is in retry mode because it is unable + to locate its selector yet. Only during this time, the watchers are invoked to check if there is + something else unexpected on the screen.

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + abstract + + + + + boolean + + checkForCondition() + +
    + Custom handler that is automatically called when the testing framework is unable to + find a match using the UiSelector + + When the framework is in the process of matching a UiSelector and it + is unable to match any widget based on the specified criteria in the selector, + the framework will perform retries for a predetermined time, waiting for the display + to update and show the desired widget. + + + +
    + +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Methods

    + + + + + +
    +

    + + public + + + abstract + + boolean + + checkForCondition + () +

    +
    +
    + + + +
    +
    + + + + +

    Custom handler that is automatically called when the testing framework is unable to + find a match using the UiSelector + + When the framework is in the process of matching a UiSelector and it + is unable to match any widget based on the specified criteria in the selector, + the framework will perform retries for a predetermined time, waiting for the display + to update and show the desired widget. While the framework is in this state, it will call + registered watchers' checkForCondition(). This gives the registered watchers a chance + to take a look at the display and see if there is a recognized condition that can be + handled and in doing so allowing the current test to continue. + + An example usage would be to look for dialogs popped due to other background + processes requesting user attention and have nothing to do with the application + currently under test.

    +
    +
    Returns
    +
    • true to indicate a matched condition or false for nothing was matched
    +
    + +
    +
    + + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/Until.html b/docs/html/reference/android/support/test/uiautomator/Until.html new file mode 100644 index 00000000000..727342b4705 --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/Until.html @@ -0,0 +1,2824 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Until | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + public + + + + class +

    Until

    + + + + + extends Object
    + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳android.support.test.uiautomator.Until
    + + + + + + + +
    + + +

    Class Overview

    +

    The Until class provides factory methods for constructing common conditions. +

    + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + Until() + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + static + + UiObject2Condition<Boolean> + + checkable(boolean isCheckable) + +
    + Returns a condition that depends on a UiObject2's checkable state. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + checked(boolean isChecked) + +
    + Returns a condition that depends on a UiObject2's checked state. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + clickable(boolean isClickable) + +
    + Returns a condition that depends on a UiObject2's clickable state. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + descContains(String substring) + +
    + Returns a condition that is satisfied when the object's content description contains the + given string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + descEndsWith(String substring) + +
    + Returns a condition that is satisfied when the object's content description ends with the + given string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + descEquals(String contentDescription) + +
    + Returns a condition that is satisfied when the object's content description exactly matches + the given string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + descMatches(Pattern regex) + +
    + Returns a condition that is satisfied when the object's content description matches the given + regex. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + descMatches(String regex) + +
    + Returns a condition that is satisfied when the object's content description matches the given + regex. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + descStartsWith(String substring) + +
    + Returns a condition that is satisfied when the object's content description starts with the + given string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + enabled(boolean isEnabled) + +
    + Returns a condition that depends on a UiObject2's enabled state. + + + +
    + +
    + + + + static + + SearchCondition<UiObject2> + + findObject(BySelector selector) + +
    + Returns a SearchCondition that is satisfied when at least one element matching the + selector can be found. + + + +
    + +
    + + + + static + + SearchCondition<List<UiObject2>> + + findObjects(BySelector selector) + +
    + Returns a SearchCondition that is satisfied when at least one element matching the + selector can be found. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + focusable(boolean isFocusable) + +
    + Returns a condition that depends on a UiObject2's focusable state. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + focused(boolean isFocused) + +
    + Returns a condition that depends on a UiObject2's focused state. + + + +
    + +
    + + + + static + + SearchCondition<Boolean> + + gone(BySelector selector) + +
    + Returns a SearchCondition that is satisfied when no elements matching the selector + can be found. + + + +
    + +
    + + + + static + + SearchCondition<Boolean> + + hasObject(BySelector selector) + +
    + Returns a SearchCondition that is satisfied when at least one element matching the + selector can be found. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + longClickable(boolean isLongClickable) + +
    + Returns a condition that depends on a UiObject2's long clickable state. + + + +
    + +
    + + + + static + + EventCondition<Boolean> + + newWindow() + +
    + Returns a condition that depends on a new window having appeared. + + + +
    + +
    + + + + static + + EventCondition<Boolean> + + scrollFinished(Direction direction) + +
    + Returns a condition that depends on a scroll having reached the end in the given + direction. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + scrollable(boolean isScrollable) + +
    + Returns a condition that depends on a UiObject2's scrollable state. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + selected(boolean isSelected) + +
    + Returns a condition that depends on a UiObject2's selected state. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + textContains(String substring) + +
    + Returns a condition that is satisfied when the object's text value contains the given string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + textEndsWith(String substring) + +
    + Returns a condition that is satisfied when the object's text value ends with the given + string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + textEquals(String text) + +
    + Returns a condition that is satisfied when the object's text value exactly matches the given + string. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + textMatches(String regex) + +
    + Returns a condition that is satisfied when the object's text value matches the given regex. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + textMatches(Pattern regex) + +
    + Returns a condition that is satisfied when the object's text value matches the given regex. + + + +
    + +
    + + + + static + + UiObject2Condition<Boolean> + + textNotEquals(String text) + +
    + + + + static + + UiObject2Condition<Boolean> + + textStartsWith(String substring) + +
    + Returns a condition that is satisfied when the object's text value starts with the given + string. + + + +
    + +
    + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + Until + () +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + + + + + + + + + + +

    Public Methods

    + + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + checkable + (boolean isCheckable) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's checkable state.

    +
    +
    Parameters
    + + + + +
    isCheckable + Whether the object should be checkable to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + checked + (boolean isChecked) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's checked state.

    +
    +
    Parameters
    + + + + +
    isChecked + Whether the object should be checked to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + clickable + (boolean isClickable) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's clickable state.

    +
    +
    Parameters
    + + + + +
    isClickable + Whether the object should be clickable to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + descContains + (String substring) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's content description contains the + given string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + descEndsWith + (String substring) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's content description ends with the + given string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + descEquals + (String contentDescription) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's content description exactly matches + the given string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + descMatches + (Pattern regex) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's content description matches the given + regex. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + descMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's content description matches the given + regex. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + descStartsWith + (String substring) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's content description starts with the + given string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + enabled + (boolean isEnabled) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's enabled state.

    +
    +
    Parameters
    + + + + +
    isEnabled + Whether the object should be enabled to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + SearchCondition<UiObject2> + + findObject + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a SearchCondition that is satisfied when at least one element matching the + selector can be found. The condition will return the first matching element. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + SearchCondition<List<UiObject2>> + + findObjects + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a SearchCondition that is satisfied when at least one element matching the + selector can be found. The condition will return all matching elements. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + focusable + (boolean isFocusable) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's focusable state.

    +
    +
    Parameters
    + + + + +
    isFocusable + Whether the object should be focusable to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + focused + (boolean isFocused) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's focused state.

    +
    +
    Parameters
    + + + + +
    isFocused + Whether the object should be focused to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + SearchCondition<Boolean> + + gone + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a SearchCondition that is satisfied when no elements matching the selector + can be found. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + SearchCondition<Boolean> + + hasObject + (BySelector selector) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a SearchCondition that is satisfied when at least one element matching the + selector can be found. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + longClickable + (boolean isLongClickable) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's long clickable state.

    +
    +
    Parameters
    + + + + +
    isLongClickable + Whether the object should be long clickable to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + EventCondition<Boolean> + + newWindow + () +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a new window having appeared.

    + +
    +
    + + + + +
    +

    + + public + static + + + + EventCondition<Boolean> + + scrollFinished + (Direction direction) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a scroll having reached the end in the given + direction.

    +
    +
    Parameters
    + + + + +
    direction + The direction of the scroll. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + scrollable + (boolean isScrollable) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's scrollable state.

    +
    +
    Parameters
    + + + + +
    isScrollable + Whether the object should be scrollable to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + selected + (boolean isSelected) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that depends on a UiObject2's selected state.

    +
    +
    Parameters
    + + + + +
    isSelected + Whether the object should be selected to satisfy this condition. +
    +
    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textContains + (String substring) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's text value contains the given string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textEndsWith + (String substring) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's text value ends with the given + string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textEquals + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's text value exactly matches the given + string. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textMatches + (String regex) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's text value matches the given regex. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textMatches + (Pattern regex) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's text value matches the given regex. +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textNotEquals + (String text) +

    +
    +
    + + + +
    +
    + + + + +

    + +
    +
    + + + + +
    +

    + + public + static + + + + UiObject2Condition<Boolean> + + textStartsWith + (String substring) +

    +
    +
    + + + +
    +
    + + + + +

    Returns a condition that is satisfied when the object's text value starts with the given + string. +

    + +
    +
    + + + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + diff --git a/docs/html/reference/android/support/test/uiautomator/package-summary.html b/docs/html/reference/android/support/test/uiautomator/package-summary.html new file mode 100644 index 00000000000..ab808b48a3c --- /dev/null +++ b/docs/html/reference/android/support/test/uiautomator/package-summary.html @@ -0,0 +1,964 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +android.support.test.uiautomator | Android Developers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + +
    +
    + + + + +
    +
    + +
    + package +

    android.support.test.uiautomator

    +
    + +
    + +
    + + + + + + + + + + +

    Interfaces

    +
    + + + + + + + + + + + + + + + + +
    IAutomationSupport + Provides auxiliary support for running test cases  + + + +
    UiWatcher + See registerWatcher(String, UiWatcher) on how to register a + a condition watcher to be called by the automation library.  + + + +
    + +
    + + + + +

    Classes

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    By +

    By is a utility class which enables the creation of BySelectors in a concise + manner.  + + + +

    BySelector + A BySelector specifies criteria for matching UI elements during a call to + findObject(BySelector).  + + + +
    Configurator + Allows you to set key parameters for running uiautomator tests.  + + + +
    EventCondition<R> + An EventCondition is a condition which depends on an event or series of events having + occurred.  + + + +
    SearchCondition<R> + A SearchCondition is a condition that is satisfied by searching for UI elements.  + + + +
    UiAutomatorInstrumentationTestRunner + Test runner for UiAutomatorTestCases.  + + + +
    UiAutomatorTestCase + + This class is deprecated. + It is no longer necessary to extend UiAutomatorTestCase. You can use + getInstance(Instrumentation) from any test class as long as you have access to + an Instrumentation instance. +  + + + +
    UiCollection + Used to enumerate a container's UI elements for the purpose of counting, + or targeting a sub elements by a child's text or description.  + + + +
    UiDevice + UiDevice provides access to state information about the device.  + + + +
    UiObject + A UiObject is a representation of a view.  + + + +
    UiObject2 + A UiObject2 represents a UI element.  + + + +
    UiObject2Condition<R> + A UiObject2Condition is a condition which is satisfied when a UiObject2 is in a + particular state.  + + + +
    UiScrollable + UiScrollable is a UiCollection and provides support for searching + for items in scrollable layout elements.  + + + +
    UiSelector + Specifies the elements in the layout hierarchy for tests to target, filtered + by properties such as text value, content-description, class name, and state + information.  + + + +
    Until + The Until class provides factory methods for constructing common conditions.  + + + +
    + +
    + + + + +

    Enums

    +
    + + + + + + + + + + +
    Direction + An enumeration used to specify the primary direction of certain gestures.  + + + +
    + +
    + + + + +

    Exceptions

    +
    + + + + + + + + + + + + + + + + +
    StaleObjectException + A StaleObjectException exception is thrown when a UiObject2 is used after the + underlying View has been destroyed.  + + + +
    UiObjectNotFoundException + Generated in test runs when a UiSelector selector could not be matched + to any UI element displayed.  + + + +
    + +
    + + + + + + + +
    +
    + +
    + + + + + + + + diff --git a/docs/html/tools/help/index.jd b/docs/html/tools/help/index.jd index 75324b79aa4..4c97d0c1bfa 100644 --- a/docs/html/tools/help/index.jd +++ b/docs/html/tools/help/index.jd @@ -70,11 +70,6 @@ avd) the emulator (emulator), and the Dalvik Debug Monitor S an emulator instance or connected Android-powered device. It also provides access to the device shell for advanced command-line operations. -
    uiautomator
    -
    The {@code uiautomator} testing framework lets you test your user interface (UI) efficiently - by creating automated functional UI testcases that can be run against your app on one or - more devices.
    -
    Dalvik Debug Monitor Server (ddms)
    Lets you debug Android applications.
    @@ -95,25 +90,6 @@ with Traceview and dmtracedump
    Converts the HPROF file that is generated by the Android SDK tools to a standard format so you can view the file in a profiling tool of your choice.
    - -
    Monkey
    -
    Runs on your emulator or device and generates pseudo-random streams of user events such -as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey -to stress-test applications that you are developing, in a random yet repeatable manner. - -
    - -
    monkeyrunner
    -
    Provides an API for writing programs that control an Android device or emulator from -outside of Android code.
    -
    Systrace
    Lets you analyze the execution of your application in the context of system processes, to help diagnose display and performance issues.
    diff --git a/docs/html/tools/testing-support-library/index.jd b/docs/html/tools/testing-support-library/index.jd new file mode 100644 index 00000000000..aeace8e5064 --- /dev/null +++ b/docs/html/tools/testing-support-library/index.jd @@ -0,0 +1,625 @@ +page.title=Testing Support Library + +@jd:body + +
    + +
    + +

    + The Android Testing Support Library provides an extensive framework for testing Android apps. + This library provides a set of APIs that allow you to quickly build and run test code for + your apps, including JUnit 4 and functional user interface (UI) tests. You can run tests + created using these APIs from the Android Studio IDE or from the command line. +

    + +

    The Android Testing Support library is available through the Android SDK Manager. + For more information, see Testing Support Library Setup +

    + +

    + This page provides information about what tools are provided in the Android Testing Support + Library, how to use them in your testing environment, and information about library releases. +

    + +

    + Testing Support Library Features +

    + +

    + The Android Testing Support Library includes the following test automation tools: +

    + + + +

    + AndroidJUnitRunner +

    + +

    + The + {@code AndroidJUnitRunner} + class is a JUnit test runner that lets you + run JUnit 3 or JUnit 4-style test classes on Android devices, including those using the + Espresso and UI Automator testing frameworks. + The test runner handles loading your test package and the app under test + to a device, running your tests, and reporting test results. This class replaces the {@link + android.test.InstrumentationTestRunner} class, which only supports JUnit 3 tests. +

    + +

    + The key features of this test runner include: +

    + + + +

    Requires Android 2.2 (API level 8) or higher.

    + +

    + JUnit support +

    + +

    + The test runner is compatible with your JUnit 3 and JUnit 4 (up to JUnit + 4.10) tests. However, you should avoid mixing JUnit 3 and and JUnit 4 test code in the same + package, as this might cause unexpected results. If you are creating an instrumented JUnit 4 + test class to run on a device or emulator, your test class must be prefixed with the + {@code @RunWith(AndroidJUnit4.class)} annotation. +

    + +

    The following code snippet shows how you might write an instrumented JUnit 4 test to validate + that the add operation in the {@code CalculatorActivity} class works correctly. +

    + +
    +import android.support.test.runner.AndroidJUnit4;
    +import android.support.test.runner.AndroidJUnitRunner;
    +import android.test.ActivityInstrumentationTestCase2;
    +
    +@RunWith(AndroidJUnit4.class)
    +public class CalculatorInstrumentationTest
    +        extends ActivityInstrumentationTestCase2<CalculatorActivity> {
    +
    +    @Before
    +    public void setUp() throws Exception {
    +        super.setUp();
    +
    +        // Injecting the Instrumentation instance is required
    +        // for your test to run with AndroidJUnitRunner.
    +        injectInstrumentation(InstrumentationRegistry.getInstrumentation());
    +        mActivity = getActivity();
    +    }
    +
    +    @Test
    +    public void typeOperandsAndPerformAddOperation() {
    +        // Call the CalculatorActivity add() method and pass in some operand values, then
    +        // check that the expected value is returned.
    +    }
    +
    +    @After
    +    public void tearDown() throws Exception {
    +        super.tearDown();
    +    }
    +}
    +
    + +

    + Access to instrumentation information +

    + +

    + You can use the + {@code InstrumentationRegistry} + class to access information related to your + test run. This class includes the {@link android.app.Instrumentation} object, target app {@link + android.content.Context} object, test app {@link android.content.Context} object, and the + command line arguments passed into your test. This data is useful when you are writing tests + using the UI Automator framework or when writing tests that have dependencies on the {@link + android.app.Instrumentation} or {@link android.content.Context} objects. +

    + +

    + Test filtering +

    + +

    + In your JUnit 4.x tests, you can use annotations to configure the test run. This feature + minimizes the need to add boilerplate and conditional code in your tests. In addition to the + standard annotations supported by JUnit 4, the test runner also supports Android-specific + annotations, including: +

    + + + +

    + Test sharding +

    + +

    + The test runner supports splitting a single test suite into multiple + shards, so you can easily run tests belonging to the same shard together as a group, + under the same {@link android.app.Instrumentation} instance. Each shard is identified by an + index number. When running tests, use the {@code -e numShards} option to specify the number + of separate shards to create and the {@code -e shardIndex} option to specify which shard to + run. +

    + +

    + For example, to split the test suite into 10 shards and run only the tests grouped in the + second shard, use the following command: +

    + +
    +adb shell am instrument -w -e numShards 10 -e shardIndex 2
    + +

    + To learn more about using this test runner, see the + API reference. +

    + +

    + Espresso +

    + +

    + The Espresso testing framework provides a set of APIs to build UI tests to test user flows + within an app. These APIs let you write automated UI tests that are concise and that run + reliably. Espresso is well-suited for writing white box-style automated tests, where + the test code utilizes implementation code details from the app under test. +

    + +

    + The key features of the Espresso testing framework include: +

    + + + +

    Requires Android 2.2 (API level 8) or higher.

    + +

    + View matching +

    + +

    + The {@code Espresso.onView()} + method lets you access a UI component in the target app and + interact with it. The method accepts a + {@code Matcher} argument and searches the view + hierarchy to locate a corresponding {@link android.view.View} instance that meets some given + criteria. You can refine searches by specifying such criteria as: +

    + + + +

    + For example, to target a button that has the ID value of {@code my_button}, you can specify + a matcher like this: +

    + +
    +onView(withId(R.id.my_button));
    + +

    + If the search is successful, the + {@code onView()} + method returns a reference which lets you + perform user actions and test assertions against the target view. +

    + +

    + Adapter matching +

    + +

    + In an {@link android.widget.AdapterView} layout, the layout is dynamically populated with + children views at runtime. If the target view is inside a layout subclassed from {@link + android.widget.AdapterView} (such as a {@link android.widget.ListView} or {@link + android.widget.GridView}), the + {@code onView()} + method might not work because only a subset of + the layout’s views may be loaded in the current view hierarchy. +

    + +

    + Instead, use the {@code Espresso.onData()} + method to access a target view element. The {@code Espresso.onData()} + method returns a reference which lets you perform user actions and test assertions against the + elements in an {@link android.widget.AdapterView}. +

    + +

    + Action APIs +

    + +

    + Typically, you test an app by performing some user interactions against the app’s user + interface. You can easily automate these actions in your test by using the + {@code ViewActions} + API. You can perform such UI interactions as: +

    + + + +

    + For example, to simulate entering a string value and pressing a button to submit the value, + you can write an automated test script like this. The + {@code ViewInteraction.perform()} + and {@code DataInteraction.perform()} + methods take one or more + {@code ViewAction} + arguments and run the actions in the order provided. +

    + +
    +// Type text into an EditText view, then close the soft keyboard
    +onView(withId(R.id.editTextUserInput))
    +    .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard());
    +
    +// Press the button to submit the text change
    +onView(withId(R.id.changeTextBt)).perform(click());
    + +

    + UI thread synchronization +

    + +

    + Tests on Android devices can fail randomly because of timing issues. This testing issue is + referred to as test flakiness. Prior to Espresso, the workaround was to insert a + sufficiently long sleep or timeout period into a test or to add code to keep retrying the + failing operation. The Espresso testing framework handles synchronization between the + {@link android.app.Instrumentation} and the UI thread; this removes the need for the previous + timing workarounds and ensures that your test actions and assertions run more reliably. +

    + +

    + To learn more about using Espresso, see the + API reference. +

    + +

    + UI Automator +

    + +

    + The UI Automator testing framework provides a set of APIs to build UI tests that perform + interactions on user apps and system apps. The UI Automator APIs allows you to perform + operations such as opening the Settings menu or the app launcher in a test device. The UI + Automator testing framework is well-suited for writing black box-style automated + tests, where the test code does not rely on internal implementation details of the target + app. +

    + +

    + The key features of the UI Automator testing framework include: +

    + + + +

    Requires Android 4.3 (API level 18) or higher.

    + +

    + UI Automator Viewer +

    + +

    + The {@code uiautomatorviewer} tool provides a convenient GUI to scan and analyze the UI + components currently displayed on an Android device. You can use this tool to inspect the + layout hierarchy and view the properties of UI components that are visible on the foreground + of the device. This information lets you create more fine-grained tests using UI Automator, + for example by creating a UI selector that matches a specific visible property. +

    + +

    + The {@code uiautomatorviewer} tool is located in the {@code <android-sdk>/tools/} + directory. +

    + +

    + Access to device state +

    + +

    + The UI Automator testing framework provides a + {@code UiDevice} + class to access and perform operations on the device on which the target app is running. You + can call its methods to access device properties such as current orientation or display size. + The {@code UiDevice} + class also let you perform actions such as: +

    + + + +

    + For example, to simulate a Home button press, call the {@code UiDevice.pressHome()} method. +

    + +

    + UI Automator APIs +

    + +

    + The UI Automator APIs allow you to write robust tests without needing to know about the + implementation details of the app that you are targeting. You can use these APIs to capture + and manipulate UI components across multiple apps: +

    + + + +

    + For example, the following code shows how you can write a test script that brings up the + default app launcher in the device: +

    + +
    +// Initialize UiDevice instance
    +mDevice = UiDevice.getInstance(getInstrumentation());
    +
    +// Perform a short press on the HOME button
    +mDevice().pressHome();
    +
    +// Bring up the default launcher by searching for
    +// a UI component that matches the content-description for the launcher button
    +UiObject allAppsButton = mDevice
    +        .findObject(new UiSelector().description("Apps"));
    +
    +// Perform a click on the button to bring up the launcher
    +allAppsButton.clickAndWaitForNewWindow();
    + +

    + To learn more about using UI Automator, see the + API reference. +

    + +

    + Testing Support Library Setup +

    + +

    + The Android Testing Support Library package is included with the latest version of the + Android Support Repository, which you can obtain as a supplemental download through the + Android SDK Manager. +

    + +

    + To download the Android Support Repository through the SDK Manager: +

    + +
      +
    1. Start the Android SDK Manager. +
    2. + +
    3. In the SDK Manager window, scroll to the end of the Packages list, find the + Extras folder and, if necessary, expand to show its contents. +
    4. + +
    5. Select the Android Support Repository item. +
    6. + +
    7. Click the Install packages... button. +
    8. +
    + +

    + After downloading, the tool installs the Support Repository files to your existing Android + SDK directory. The library files are located in the following subdirectory of your SDK: + {@code <sdk>/extras/android/m2repository} directory. +

    + +

    + The Android Testing Support Library classes are located under the + {@code android.support.test} package. +

    + +

    + To use the Android Testing Support Library in your Gradle project, add these dependencies in + your {@code build.gradle} file: +

    + +
    +dependencies {
    +  androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
    +  // Set this dependency to build and run Espresso tests
    +  androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
    +  // Set this dependency to build and run UI Automator tests
    +  androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.0.0'
    +}
    + +

    To set +{@code AndroidJUnitRunner} + as the default test instrumentation runner in your Gradle project, specify this dependency in + your {@code build.gradle} file:

    + +
    +android {
    +    defaultConfig {
    +        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    +    }
    +}
    + +

    + It is strongly recommended that you use the Android Testing Support Library together with the + Android Studio IDE. Android Studio offers capabilities that support test + development, such as: +

    + + + +

    + For more information about Android Studio and to download it, see + Download Android Studio and SDK Tools. +

    \ No newline at end of file diff --git a/docs/html/tools/testing/testing-tools.jd b/docs/html/tools/testing/testing-tools.jd new file mode 100644 index 00000000000..5e0a5bcd26f --- /dev/null +++ b/docs/html/tools/testing/testing-tools.jd @@ -0,0 +1,56 @@ +page.title=Android Testing Tools +@jd:body + +
    +
    +

    See also

    +
      +
    1. Best Practices for Testing
    2. +
    +
    +
    + +

    + Testing is a critical software development activity because it helps you + improve the quality of your apps, ensure better user satisfaction, and + reduce overall development time spent on fixing defects. +

    + +

    The following sections describe tools that help + you test your mobile apps for the Android platform. + +

    +
    Android + Testing Support Library
    +
    This library provides a set of APIs that allow + you to quickly build and run test code for your apps, including JUnit 4 and functional user + interface (UI) tests. The Android Testing Support Library includes the following test automation + tools: + +
      +
    • AndroidJUnitRunner: + JUnit 4-compatible test runner for Android +
    • + +
    • Espresso: + UI testing framework; suitable for functional UI testing within an app +
    • + +
    • UI Automator: + UI testing framework; suitable for cross-app functional UI testing across system and installed apps +
    • +
    +
    + +
    Monkey
    +
    This tool runs on your emulator or device and generates pseudo-random streams of user +events such as clicks, touches, or gestures, as well as a number of system-level events. You can +use the Monkey tool to stress-test applications that you are developing, in a random yet +repeatable manner. +
    + +
    monkeyrunner
    +
    This testing system provides an API for writing programs that control an Android device or +emulator from outside of Android code.
    + +
    \ No newline at end of file diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index 62c21a6a528..9ba7a225065 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -165,39 +165,11 @@ class="en">Tools Help
  • lint
  • logcat
  • mksdcard
  • -
  • monkey
  • -
  • ProGuard
  • SDK Manager
  • Systrace
  • Tracer for OpenGL ES
  • Traceview
  • -
  • zipalign
  • @@ -221,6 +193,34 @@ class="en">MonkeyRunner + + + + -- GitLab