### Install Android SDK components with sdkmanager Source: https://github.com/android/android-test/blob/main/CONTRIBUTING.md One-time setup command to install the required Android SDK components (build-tools 36.0.0 and platform android-36) using sdkmanager. ```bash cmdline-tools/latest/bin/sdkmanager "build-tools;36.0.0" "platforms;android-36" ``` -------------------------------- ### ServiceTestRule.startService Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha06.txt Starts a service. ```APIDOC ## [POST] /ServiceTestRule/startService ### Description Starts a service. ### Method POST ### Endpoint /ServiceTestRule/startService ### Parameters #### Request Body - **intent** (android.content.Intent) - Required - The intent to start the service. ### Response #### Success Response (200) No return value. #### Error Response - **TimeoutException** - If the service start times out. ``` -------------------------------- ### AtraceLogger.atraceStart Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha06.txt Starts atrace with the specified tags and options. ```APIDOC ## [POST] /AtraceLogger/atraceStart ### Description Starts atrace with the specified tags and options. ### Method POST ### Endpoint /AtraceLogger/atraceStart ### Parameters #### Request Body - **tags** (java.util.Set) - Required - The tags to trace. - **bufferSize** (int) - Required - The buffer size. - **bufferCount** (int) - Required - The buffer count. - **outputFile** (java.io.File) - Required - The output file. - **extraOptions** (java.lang.String) - Required - Extra options. ### Response #### Success Response (200) No return value. #### Error Response - **IOException** - If an I/O error occurs. ``` -------------------------------- ### Web.onWebView() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-beta02.txt Static factory methods to start a WebInteraction on a WebView. ```APIDOC ## [CLASS] androidx.test.espresso.web.sugar.Web ### Description Entry point for performing web interactions in Espresso. Provides static methods to obtain a WebInteraction instance for a WebView. ### Methods - `public static Web.WebInteraction onWebView()` - Returns a WebInteraction for the default WebView. - `public static Web.WebInteraction onWebView(Matcher viewMatcher)` - Returns a WebInteraction for a WebView matching the given view matcher. ### Usage Example ```java Web.onWebView().perform(...); ``` ``` -------------------------------- ### Web.onWebView() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha04.txt Static factory methods to start a WebInteraction on a WebView. ```APIDOC ## [STATIC] Web.onWebView() ### Description Starts a WebInteraction on the currently displayed WebView. ### Method STATIC ### Signature `public static Web.WebInteraction onWebView()` ### Parameters None. ### Returns - `Web.WebInteraction` - A WebInteraction instance for the current WebView. ### Example ```java Web.onWebView(); ``` ``` ```APIDOC ## [STATIC] Web.onWebView(Matcher) ### Description Starts a WebInteraction on a WebView matching the given matcher. ### Method STATIC ### Signature `public static Web.WebInteraction onWebView(org.hamcrest.Matcher viewMatcher)` ### Parameters - **viewMatcher** (Matcher) - Required - Matcher to select the WebView. ### Returns - `Web.WebInteraction` - A WebInteraction instance for the matched WebView. ### Example ```java Web.onWebView(withId(R.id.web_view)); ``` ``` -------------------------------- ### EspressoRemote.init() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Initializes the remote Espresso instance. ```APIDOC ## EspressoRemote.init() ### Description Initializes the EspressoRemote instance. ### Method instance ### Signature public void init() ``` -------------------------------- ### TestCaseStartedEvent Source: https://github.com/android/android-test/blob/main/runner/android_junit_runner/java/androidx/test/api/1.7.0_internal.txt Event indicating that a test case has started, including timestamp. Also provides a method to get the event type. ```APIDOC ## TestCaseStartedEvent ### Description Event that represents the start of a test case, including test case information and timestamp, and provides the event type. ### Class `androidx.test.services.events.platform.TestCaseStartedEvent` ### Constructors - `TestCaseStartedEvent(TestCaseInfo testCase, TimeStamp timeStamp)` - Creates an event with the given test case and timestamp. - `TestCaseStartedEvent(Parcel source)` - Creates an event from a Parcel. ### Methods #### instanceType() - Returns: `EventType` - The event type for this event. ### Fields - `testCase` (TestCaseInfo) - Public final field with information about the test case. - `timeStamp` (TimeStamp) - Public final field with the timestamp of the event. ``` -------------------------------- ### ActivityScenario.launch(Class, Bundle) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.4.0_public.txt Launches an activity with optional initial arguments for testing. ```APIDOC ## ActivityScenario.launch(Class, Bundle) ### Description Launches an activity with optional initial arguments for testing. ### Method static ActivityScenario launch(Class activityClass, Bundle bundle) ### Parameters - **activityClass** (Class) - Required - The class of the activity to launch. - **bundle** (Bundle) - Optional - Initial arguments to pass to the activity. ### Returns - **ActivityScenario** - An ActivityScenario instance for controlling the launched activity. ### Example ```java Bundle args = new Bundle(); args.putString("key", "value"); ActivityScenario scenario = ActivityScenario.launch(MainActivity.class, args); ``` ``` -------------------------------- ### InteractionResponse.getStatus() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the status of an InteractionResponse. ```APIDOC ## InteractionResponse.getStatus() ### Description Returns the status of the interaction response. ### Method instance ### Signature public androidx.test.espresso.remote.InteractionResponse.Status! getStatus() ### Returns - **Status** - The status (Ok or Error). ``` -------------------------------- ### ActivityScenario.launch(Intent, Bundle) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.4.0_public.txt Launches an activity using an Intent and optional arguments for testing. ```APIDOC ## ActivityScenario.launch(Intent, Bundle) ### Description Launches an activity using an Intent and optional arguments for testing. ### Method static ActivityScenario launch(Intent intent, Bundle bundle) ### Parameters - **intent** (Intent) - Required - The Intent used to launch the activity. - **bundle** (Bundle) - Optional - Initial arguments to pass to the activity. ### Returns - **ActivityScenario** - An ActivityScenario instance for controlling the launched activity. ### Example ```java Intent intent = new Intent(context, MainActivity.class); Bundle args = new Bundle(); ActivityScenario scenario = ActivityScenario.launch(intent, args); ``` ``` -------------------------------- ### get() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-rc03.txt Returns the root view. ```APIDOC ## get() ### Description Returns the root view. ### Method get ### Signature public View get() ### Returns - **View** - The root view. ``` -------------------------------- ### Rebuild entry_point_deploy.jar with Bazel Source: https://github.com/android/android-test/blob/main/opensource/README.md Run these commands from the project root to rebuild the jar. The first command builds the target, and the second copies the resulting jar to the opensource/ directory. ```bash bazel build tools/device_broker/java/com/google/android/apps/common/testing/suite:entry_point_deploy.jar cp bazel-bin/tools/device_broker/java/com/google/android/apps/common/testing/suite/entry_point_deploy.jar opensource/ ``` -------------------------------- ### ActivityTestRule.getActivityResult Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha06.txt Gets the result of the activity under test. ```APIDOC ## [GET] /ActivityTestRule/getActivityResult ### Description Gets the result of the activity under test. ### Method GET ### Endpoint /ActivityTestRule/getActivityResult ### Parameters None ### Response #### Success Response (200) - **result** (android.app.Instrumentation.ActivityResult) - The activity result. ``` -------------------------------- ### ActivityTestRule.getActivity Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha06.txt Gets the current activity under test. ```APIDOC ## [GET] /ActivityTestRule/getActivity ### Description Gets the current activity under test. ### Method GET ### Endpoint /ActivityTestRule/getActivity ### Parameters None ### Response #### Success Response (200) - **activity** (T) - The current activity. ``` -------------------------------- ### Web.onWebView() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Static factory method to start a WebInteraction on the current WebView. ```APIDOC ## [STATIC] onWebView() ### Description Starts a WebInteraction on the currently displayed WebView. Returns a WebInteraction that can be used to perform actions and assertions. ### Method STATIC ### Endpoint androidx.test.espresso.web.sugar.Web.onWebView() ### Parameters None ### Response #### Success Response - **Web.WebInteraction** - A WebInteraction instance for chaining operations. #### Response Example ```java Web.onWebView() ``` ``` -------------------------------- ### ActivityScenario.launch(Intent, Bundle) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/current_public.txt Launches an activity using the provided intent and additional options, returning an ActivityScenario. ```APIDOC ## ActivityScenario.launch(Intent, Bundle) ### Description Launches an activity using the provided intent and additional options, returning an ActivityScenario. ### Method launch ### Parameters - **android.content.Intent** - Required - The intent used to launch the activity. - **android.os.Bundle** - Optional - Additional launch options. ### Response - **androidx.test.core.app.ActivityScenario** - The scenario controlling the launched activity. ``` -------------------------------- ### InteractionResponse.RemoteError.getDescription() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the error description from a RemoteError. ```APIDOC ## InteractionResponse.RemoteError.getDescription() ### Description Returns the error description. ### Method instance ### Signature public String! getDescription() ### Returns - **String** - The error description. ``` -------------------------------- ### ActivityScenario.launch(Class, Bundle?) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.5.0_public.txt Launches an activity with optional launch arguments. This is a static factory method. ```APIDOC ## ActivityScenario.launch(Class, Bundle?) ### Description Launches an activity of the specified class with optional launch arguments. Returns an ActivityScenario for controlling the activity. ### Method launch ### Signature public static ActivityScenario launch(Class activityClass, android.os.Bundle? launchArgs) ### Parameters - **activityClass** (Class) - Required - The class of the activity to launch. - **launchArgs** (android.os.Bundle?) - Optional - Bundle of arguments to pass to the activity. ### Returns - **ActivityScenario** - A scenario for controlling the launched activity. ### Example ```java Bundle args = new Bundle(); args.putString("key", "value"); ActivityScenario scenario = ActivityScenario.launch(MainActivity.class, args); ``` ``` -------------------------------- ### InteractionResponse.RemoteError.getCode() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the error code from a RemoteError. ```APIDOC ## InteractionResponse.RemoteError.getCode() ### Description Returns the error code. ### Method instance ### Signature public int getCode() ### Returns - **int** - The error code. ``` -------------------------------- ### InteractionResponse.getRemoteError() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the remote error from an InteractionResponse. ```APIDOC ## InteractionResponse.getRemoteError() ### Description Returns the remote error associated with this interaction response. ### Method instance ### Signature public androidx.test.espresso.remote.InteractionResponse.RemoteError! getRemoteError() ### Returns - **RemoteError** - The remote error. ``` -------------------------------- ### ActivityScenario.launch(Class, Bundle) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/current_public.txt Launches an activity of the specified class with additional options and returns an ActivityScenario. ```APIDOC ## ActivityScenario.launch(Class, Bundle) ### Description Launches an activity of the specified class with additional options and returns an ActivityScenario. ### Method launch ### Parameters - **Class** - Required - The activity class to launch. - **android.os.Bundle** - Optional - Additional launch options. ### Response - **androidx.test.core.app.ActivityScenario** - The scenario controlling the launched activity. ``` -------------------------------- ### ActivityScenario.launch(Intent, Bundle?) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.5.0_public.txt Launches an activity using an intent and optional launch arguments. This is a static factory method. ```APIDOC ## ActivityScenario.launch(Intent, Bundle?) ### Description Launches an activity using the provided intent and optional launch arguments. Returns an ActivityScenario for controlling the activity. ### Method launch ### Signature public static ActivityScenario launch(android.content.Intent intent, android.os.Bundle? launchArgs) ### Parameters - **intent** (android.content.Intent) - Required - The intent used to launch the activity. - **launchArgs** (android.os.Bundle?) - Optional - Bundle of arguments to pass to the activity. ### Returns - **ActivityScenario** - A scenario for controlling the launched activity. ### Example ```java Intent intent = new Intent(context, MainActivity.class); Bundle args = new Bundle(); ActivityScenario scenario = ActivityScenario.launch(intent, args); ``` ``` -------------------------------- ### InteractionRequest.getViewMatcher() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the view matcher from an InteractionRequest. ```APIDOC ## InteractionRequest.getViewMatcher() ### Description Returns the view matcher associated with this interaction request. ### Method instance ### Signature public org.hamcrest.Matcher! getViewMatcher() ### Returns - **Matcher** - The view matcher. ``` -------------------------------- ### AdapterViewProtocols Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-rc03.txt Documentation for the AdapterViewProtocols class. ```APIDOC ## AdapterViewProtocols ### Description Provides standard AdapterViewProtocol implementations. ### Methods - `standardProtocol()` - Returns a standard AdapterViewProtocol. ``` -------------------------------- ### InteractionRequest.getViewAssertion() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the view assertion from an InteractionRequest. ```APIDOC ## InteractionRequest.getViewAssertion() ### Description Returns the view assertion associated with this interaction request. ### Method instance ### Signature public androidx.test.espresso.ViewAssertion! getViewAssertion() ### Returns - **ViewAssertion** - The view assertion. ``` -------------------------------- ### InteractionRequest.getViewAction() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the view action from an InteractionRequest. ```APIDOC ## InteractionRequest.getViewAction() ### Description Returns the view action associated with this interaction request. ### Method instance ### Signature public androidx.test.espresso.ViewAction! getViewAction() ### Returns - **ViewAction** - The view action. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.3.1_alpha03.txt Builder for Root with methods to set decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder for creating Root instances. ### Constructor - `Builder()` ### Methods - `build()` : `Root` - `withDecorView(View)` : `Builder` - `withWindowLayoutParams(WindowManager.LayoutParams)` : `Builder` ``` -------------------------------- ### InteractionRequest.getRootMatcher() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Gets the root matcher from an InteractionRequest. ```APIDOC ## InteractionRequest.getRootMatcher() ### Description Returns the root matcher associated with this interaction request. ### Method instance ### Signature public org.hamcrest.Matcher! getRootMatcher() ### Returns - **Matcher** - The root matcher. ``` -------------------------------- ### Run androidx-test-core tests Source: https://github.com/android/android-test/blob/main/CONTRIBUTING.md Run the androidx-test-core tests. ```bash bazelisk test //core/javatests/... ``` -------------------------------- ### AdapterViewProtocols Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-rc01.txt Documentation for the AdapterViewProtocols utility class. ```APIDOC ## AdapterViewProtocols ### Description A utility class for obtaining standard AdapterViewProtocol instances. ### Methods - `standardProtocol()` - Returns a standard AdapterViewProtocol. ``` -------------------------------- ### UiObject2.getVisibleBounds() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the visible bounds of the UiObject2. ```APIDOC ## UiObject2.getVisibleBounds() ### Description Gets the visible bounds of the UiObject2. ### Method getVisibleBounds ### Signature public android.graphics.Rect getVisibleBounds() ### Parameters None ### Returns Rect - The visible bounds. ``` -------------------------------- ### UiObject2.getText() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the text content of the UiObject2. ```APIDOC ## UiObject2.getText() ### Description Gets the text content of the UiObject2. ### Method getText ### Signature public java.lang.String getText() ### Parameters None ### Returns String - The text content. ``` -------------------------------- ### AdapterViewProtocols Source: https://github.com/android/android-test/blob/main/api/axt_1.0.2_api.txt Provides standard AdapterViewProtocol instances. ```APIDOC ## AdapterViewProtocols ### Description Provides standard AdapterViewProtocol instances. ### Methods - **standardProtocol()** (AdapterViewProtocol) - Returns the standard protocol. ``` -------------------------------- ### ActivityScenario.launch(Class) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.4.0_public.txt Launches an activity for testing. Returns an ActivityScenario instance to control the activity lifecycle. ```APIDOC ## ActivityScenario.launch(Class) ### Description Launches an activity for testing. Returns an ActivityScenario instance to control the activity lifecycle. ### Method static ActivityScenario launch(Class activityClass) ### Parameters - **activityClass** (Class) - Required - The class of the activity to launch. ### Returns - **ActivityScenario** - An ActivityScenario instance for controlling the launched activity. ### Example ```java ActivityScenario scenario = ActivityScenario.launch(MainActivity.class); ``` ``` -------------------------------- ### UiObject2.getResourceName() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the resource name of the UiObject2. ```APIDOC ## UiObject2.getResourceName() ### Description Gets the resource name of the UiObject2. ### Method getResourceName ### Signature public java.lang.String getResourceName() ### Parameters None ### Returns String - The resource name. ``` -------------------------------- ### Root.isReady() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha06.txt Indicates whether the root is ready for interaction. This is used to determine if the window is fully drawn. ```APIDOC ## Root.isReady() ### Description Indicates whether the root is ready for interaction. This is used to determine if the window is fully drawn. ### Method isReady ### Returns - **boolean** - True if the root is ready, false otherwise. ``` -------------------------------- ### UiObject2.getParent() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the parent UiObject2 of this object. ```APIDOC ## UiObject2.getParent() ### Description Gets the parent UiObject2 of this object. ### Method getParent ### Signature public androidx.test.uiautomator.UiObject2 getParent() ### Parameters None ### Returns UiObject2 - The parent object, or null if none. ``` -------------------------------- ### ActivityScenario.launch(Intent, Bundle) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.7.0_public.txt Launches an activity using the provided intent and activity options. Allows custom launch options alongside the intent. ```APIDOC ## [SDK] ActivityScenario.launch(Intent, Bundle) ### Description Static factory method that launches an activity with the given intent and activity options bundle. Returns an ActivityScenario for lifecycle control. ### Method launch ### Signature public static ActivityScenario launch(Intent intent, Bundle activityOptions) ### Parameters - **intent** (Intent) - Required - The intent used to launch the activity. - **activityOptions** (Bundle, nullable) - Optional - Activity options bundle, may be null. ### Returns ActivityScenario - An instance of ActivityScenario for the launched activity. ``` -------------------------------- ### UiObject2.getContentDescription() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the content description of the UiObject2. ```APIDOC ## UiObject2.getContentDescription() ### Description Gets the content description of the UiObject2. ### Method getContentDescription ### Signature public java.lang.String getContentDescription() ### Parameters None ### Returns String - The content description. ``` -------------------------------- ### UiObject2.getClassName() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the class name of the UiObject2. ```APIDOC ## UiObject2.getClassName() ### Description Gets the class name of the UiObject2. ### Method getClassName ### Signature public java.lang.String getClassName() ### Parameters None ### Returns String - The class name. ``` -------------------------------- ### Web.onWebView() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-beta02.txt Entry point to start a WebInteraction on the current or a matching WebView. Returns a WebInteraction for performing actions and assertions. ```APIDOC ## Web.onWebView() ### Description Returns a WebInteraction to start an interaction with the current WebView. Optionally, a View matcher can be provided to target a specific WebView. ### Method Web.onWebView() ### Overloads - `public static Web.WebInteraction onWebView()` - `public static Web.WebInteraction onWebView(org.hamcrest.Matcher)` ### Parameters - `matcher` (org.hamcrest.Matcher) - Optional - Matcher to select a specific WebView. ### Returns - `Web.WebInteraction` - A WebInteraction instance to chain actions and assertions. ``` -------------------------------- ### UiObject2.getParent() Source: https://github.com/android/android-test/blob/main/api/atsl_1.0.2_api.txt Gets the parent UI object. ```APIDOC ## getParent() ### Description Gets the parent UI object. ### Method getParent ### Parameters None ### Returns UiObject2 - The parent object, or null if none. ``` -------------------------------- ### Web Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-rc03.txt Documentation for the Web class entry point. ```APIDOC ## [CLASS] Web ### Description Web is a final class that provides static factory methods to create WebInteraction instances for interacting with WebViews in Espresso tests. ### Static Methods - `onWebView()` - Returns a WebInteraction for the default WebView. - `onWebView(org.hamcrest.Matcher)` - Returns a WebInteraction for a WebView matching the given view matcher. ``` -------------------------------- ### ActivityScenario.launch(Class) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.7.0_public.txt Launches an activity for testing and returns an ActivityScenario to control it. This method initiates the activity with default launch options. ```APIDOC ## [SDK] ActivityScenario.launch(Class) ### Description Static factory method that launches an activity of the specified class for testing. Returns an ActivityScenario instance which can be used to interact with the activity and control its lifecycle. ### Method launch ### Signature public static ActivityScenario launch(Class activityClass) ### Parameters - **activityClass** (Class) - Required - The class of the activity to launch. ### Returns ActivityScenario - An instance of ActivityScenario for the launched activity. ``` -------------------------------- ### Evaluation.getValue Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-rc01.txt Method to get the value of an evaluation. ```APIDOC ## [METHOD] Evaluation.getValue ### Description Returns the value of the evaluation. ### Method instance ### Signature `public java.lang.Object getValue()` ### Returns - **Object** - The value. ``` -------------------------------- ### Web Source: https://github.com/android/android-test/blob/main/api/axt_1.2.0_beta01_api.txt Documentation for the Web class, which provides static methods to start WebView interactions. ```APIDOC ## [CLASS] androidx.test.espresso.web.sugar.Web ### Description Entry point for WebView interactions in Espresso. ### Constructors - **Web()** - Creates a Web instance. ### Methods - **onWebView()** (static Web.WebInteraction) - Returns a WebInteraction for the default WebView. - **onWebView(org.hamcrest.Matcher)** (static Web.WebInteraction) - Returns a WebInteraction for a WebView matching the given matcher. ``` -------------------------------- ### Evaluation.getStatus Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-rc01.txt Method to get the status of an evaluation. ```APIDOC ## [METHOD] Evaluation.getStatus ### Description Returns the status of the evaluation. ### Method instance ### Signature `public int getStatus()` ### Returns - **int** - The status. ``` -------------------------------- ### Evaluation.getMessage Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-rc01.txt Method to get the message from an evaluation. ```APIDOC ## [METHOD] Evaluation.getMessage ### Description Returns the message associated with the evaluation. ### Method instance ### Signature `public java.lang.String getMessage()` ### Returns - **String** - The message. ``` -------------------------------- ### AdapterViewProtocols Source: https://github.com/android/android-test/blob/main/api/axt_1.3.1_alpha01.txt Documentation for the AdapterViewProtocols class, which provides standard protocol implementations. ```APIDOC ## AdapterViewProtocols ### Description Provides standard AdapterViewProtocol implementations. ### Methods - `AdapterViewProtocol standardProtocol()` ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.3.1_alpha01.txt Builder for creating Root instances with decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder for constructing Root objects. ### Constructor - `Builder()` - Creates a new builder instance. ### Methods - `build()` - Returns the constructed Root. - `withDecorView(View)` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` - Sets the window layout parameters. ``` -------------------------------- ### SimpleAtom.getScript() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha04.txt Method to get the JavaScript script. ```APIDOC ## [METHOD] SimpleAtom.getScript() ### Description Returns the JavaScript script to execute. ### Method instance ### Signature public final java.lang.String getScript() ### Returns - **String** - The script. ``` -------------------------------- ### Evaluation.getValue() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha04.txt Method to get the value from an Evaluation. ```APIDOC ## [METHOD] Evaluation.getValue() ### Description Returns the value of the evaluation. ### Method instance ### Signature public java.lang.Object getValue() ### Returns - **Object** - The value, or null if none. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Builder for creating Root instances with decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder for creating Root instances with decor view and window layout parameters. ### Constructor - `Builder()` ### Methods - `build()` - Returns a Root. - `withDecorView(View)` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` - Sets the window layout parameters. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.3.1_alpha02.txt Builder for creating Root instances with decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder class for Root. ### Class Constructor public Builder() ### Methods - `build()` - Returns the constructed Root. - `withDecorView(android.view.View)` - Sets the decor view. - `withWindowLayoutParams(android.view.WindowManager.LayoutParams)` - Sets the window layout parameters. ``` -------------------------------- ### Evaluation.getMessage() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha04.txt Method to get the message from an Evaluation. ```APIDOC ## [METHOD] Evaluation.getMessage() ### Description Returns the message associated with the evaluation. ### Method instance ### Signature public java.lang.String getMessage() ### Returns - **String** - The message, or null if none. ``` -------------------------------- ### UiObject2.getVisibleBounds() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Gets the visible bounds of the UiObject2. ```APIDOC ## UiObject2.getVisibleBounds() ### Description Gets the visible bounds of the UiObject2. ### Method getVisibleBounds ### Signature public android.graphics.Rect getVisibleBounds() ### Parameters None ### Returns Rect - The visible bounds. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.1.0-alpha01_api.txt Builder for creating Root instances with decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder for Root, allowing customization of the root's decor view and window layout parameters. ### Constructor - `Root.Builder()` - Creates a new builder instance. ### Methods - `build()` - Builds the Root instance. - `withDecorView(View)` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` - Sets the window layout parameters. ### Usage ```java Root.Builder builder = new Root.Builder(); Root root = builder .withDecorView(decorView) .withWindowLayoutParams(layoutParams) .build(); ``` ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.7.0_public.txt Builder for creating Root instances with decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder for constructing Root instances. ### Constructor - `Root.Builder()` ### Methods - `build()` : Root - `withDecorView(View)` : Builder - `withWindowLayoutParams(WindowManager.LayoutParams)` : Builder ``` -------------------------------- ### UiObject2.getText() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Gets the text content of the UiObject2. ```APIDOC ## UiObject2.getText() ### Description Gets the text content of the UiObject2. ### Method getText ### Signature public java.lang.String getText() ### Parameters None ### Returns String - The text content. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.1.0_api.txt Builder for creating Root instances with decor view and window layout parameters. ```APIDOC ## Root.Builder ### Description Builder for Root, allowing customization of the root view. ### Constructor `Root.Builder()` ### Methods - `build()` - Returns the constructed Root. - `withDecorView(View)` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` - Sets the window layout parameters. ``` -------------------------------- ### UiObject2.getResourceName() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Gets the resource name of the UiObject2. ```APIDOC ## UiObject2.getResourceName() ### Description Gets the resource name of the UiObject2. ### Method getResourceName ### Signature public java.lang.String getResourceName() ### Parameters None ### Returns String - The resource name. ``` -------------------------------- ### UiObject2.getParent() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Gets the parent UiObject2 of this object. ```APIDOC ## UiObject2.getParent() ### Description Gets the parent UiObject2 of this object. ### Method getParent ### Signature public androidx.test.uiautomator.UiObject2 getParent() ### Parameters None ### Returns UiObject2 - The parent object, or null if there is no parent. ``` -------------------------------- ### Intents.init() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-beta01.txt Initializes the Espresso Intents monitoring environment. This must be called before any intent verification or stubbing methods. ```APIDOC ## Intents.init() ### Description Initializes the Espresso Intents monitoring environment. This must be called before any intent verification or stubbing methods. ``` -------------------------------- ### By.descStartsWith(String) Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-beta02.txt Creates a BySelector that matches elements whose content description starts with the given string. ```APIDOC ## By.descStartsWith(String) ### Description Creates a BySelector that matches elements whose content description starts with the given string. ### Method By.descStartsWith ### Parameters - **desc** (String) - Required - The prefix that the content description must start with. ### Returns - **BySelector** - A selector matching elements with a content description starting with the prefix. ``` -------------------------------- ### UiObject2.getContentDescription() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Gets the content description of the UiObject2. ```APIDOC ## UiObject2.getContentDescription() ### Description Gets the content description of the UiObject2. ### Method getContentDescription ### Signature public java.lang.String getContentDescription() ### Parameters None ### Returns String - The content description. ``` -------------------------------- ### UiObject2.getClassName() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Gets the class name of the UiObject2. ```APIDOC ## UiObject2.getClassName() ### Description Gets the class name of the UiObject2. ### Method getClassName ### Signature public java.lang.String getClassName() ### Parameters None ### Returns String - The class name. ``` -------------------------------- ### UiObject2.getParent() Source: https://github.com/android/android-test/blob/main/api/axt_1.1.0_api.txt Gets the parent UiObject2 of this object. ```APIDOC ## UiObject2.getParent() ### Description Gets the parent UiObject2 of this object. ### Method getParent ### Signature public androidx.test.uiautomator.UiObject2 getParent() ### Parameters None ### Returns UiObject2 - The parent object, or null if this is the root. ``` -------------------------------- ### Evaluation.getValue Source: https://github.com/android/android-test/blob/main/api/axt_1.3.1_alpha02.txt Method to get the value from an Evaluation. ```APIDOC ## [METHOD] getValue ### Description Returns the value of the evaluation. ### Method instance ### Signature `public java.lang.Object getValue()` ### Returns - **Object** - The value. ``` -------------------------------- ### Web.onWebView(Matcher) Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Static factory method to start a WebInteraction on a WebView matching the given matcher. ```APIDOC ## [STATIC] onWebView(Matcher) ### Description Starts a WebInteraction on a WebView that matches the given view matcher. Useful when multiple WebViews are present. ### Method STATIC ### Endpoint androidx.test.espresso.web.sugar.Web.onWebView(org.hamcrest.Matcher) ### Parameters #### Path Parameters - **viewMatcher** (org.hamcrest.Matcher) - Required - Matcher to select the WebView. ### Response #### Success Response - **Web.WebInteraction** - A WebInteraction instance for chaining operations. #### Response Example ```java Web.onWebView(withId(R.id.webview)) ``` ``` -------------------------------- ### EspressoRemote.getInstance() Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.4.0_public.txt Static factory method to obtain the singleton EspressoRemote instance. ```APIDOC ## EspressoRemote.getInstance() ### Description Returns the singleton instance of the EspressoRemote class, which provides remote interaction capabilities for Espresso tests. ### Method static ### Signature public static androidx.test.espresso.remote.EspressoRemote! getInstance() ### Returns - **EspressoRemote** - The singleton instance of EspressoRemote. ``` -------------------------------- ### Evaluation.getMessage Source: https://github.com/android/android-test/blob/main/api/axt_1.3.1_alpha02.txt Method to get the message from an Evaluation. ```APIDOC ## [METHOD] getMessage ### Description Returns the message associated with the evaluation. ### Method instance ### Signature `public java.lang.String getMessage()` ### Returns - **String** - The message. ``` -------------------------------- ### IdlingRegistry.getInstance() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-beta02.txt Gets the singleton instance of IdlingRegistry. ```APIDOC ## IdlingRegistry.getInstance() ### Description Gets the singleton instance of IdlingRegistry. ### Method getInstance ### Signature public static androidx.test.espresso.IdlingRegistry getInstance() ### Parameters None ### Returns androidx.test.espresso.IdlingRegistry - the singleton instance ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.0.2_api.txt Builder for creating Root instances. ```APIDOC ## Root.Builder ### Description Builder for constructing Root objects. ### Constructor `Root.Builder()` ### Methods - `build()` - Returns the constructed Root. - `withDecorView(View)` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` - Sets the window layout parameters. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.0.0_api.txt Builder for creating Root instances. ```APIDOC ## [CLASS] Root.Builder ### Description Builder for creating Root instances. Allows setting the decor view and window layout parameters. ### Constructor `Root.Builder()` ### Methods - `build()` - Returns the constructed Root. - `withDecorView(View)` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` - Sets the window layout parameters. ### Usage Example ```java Root.Builder builder = new Root.Builder(); Root root = builder .withDecorView(decorView) .withWindowLayoutParams(layoutParams) .build(); ``` ``` -------------------------------- ### IdlingPolicies.getMasterIdlingPolicy() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-beta02.txt Gets the master idling policy. ```APIDOC ## IdlingPolicies.getMasterIdlingPolicy() ### Description Gets the master idling policy. ### Method getMasterIdlingPolicy ### Signature public static androidx.test.espresso.IdlingPolicy getMasterIdlingPolicy() ### Parameters None ### Returns androidx.test.espresso.IdlingPolicy - the master policy ``` -------------------------------- ### getChildCount() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-rc01.txt Gets the number of child nodes. ```APIDOC ## UiObject2.getChildCount() ### Description Returns the number of child UiObject2 instances. ### Method N/A (SDK method) ### Signature `public int getChildCount()` ### Parameters None. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/espresso/core/java/androidx/test/espresso/api/3.6.0_public.txt Builder for creating Root instances. ```APIDOC ## Root.Builder ### Description Builder for Root. ### Methods - **build()** - Returns the constructed Root. - **withDecorView(View)** - Sets the decor view. - **withWindowLayoutParams(WindowManager.LayoutParams)** - Sets window layout parameters. ### Usage ```java Root root = new Root.Builder() .withDecorView(decorView) .withWindowLayoutParams(params) .build(); ``` ``` -------------------------------- ### getApplicationPackage() Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0-rc01.txt Gets the application package name. ```APIDOC ## UiObject2.getApplicationPackage() ### Description Returns the package name of the application that contains this UiObject2. ### Method N/A (SDK method) ### Signature `public java.lang.String getApplicationPackage()` ### Parameters None. ``` -------------------------------- ### ActivityScenario.launch Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.6.0_public.txt Launches an activity for testing. Provides static methods to launch an activity by class or intent, with optional initial bundle state. ```APIDOC ## ActivityScenario.launch ### Description Launches an activity for testing. Provides static methods to launch an activity by class or intent, with optional initial bundle state. ### Method launch (static) ### Signature public static ActivityScenario launch(Class activityClass) public static ActivityScenario launch(Class activityClass, Bundle? initialBundle) public static ActivityScenario launch(Intent intent) public static ActivityScenario launch(Intent intent, Bundle? initialBundle) ### Parameters - **activityClass** (Class) - Required - The activity class to launch. - **intent** (Intent) - Required - The intent used to launch the activity. - **initialBundle** (Bundle?) - Optional - Optional bundle to pass as the activity's saved instance state. ### Returns - **ActivityScenario** - The scenario controlling the launched activity. ``` -------------------------------- ### ActivityScenario.launch(Class) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/1.5.0_public.txt Launches an activity for testing, returning an ActivityScenario to control its lifecycle. This is a static factory method. ```APIDOC ## ActivityScenario.launch(Class) ### Description Launches an activity of the specified class for testing. Returns an ActivityScenario that can be used to control the activity's lifecycle and interact with it. ### Method launch ### Signature public static ActivityScenario launch(Class activityClass) ### Parameters - **activityClass** (Class) - Required - The class of the activity to launch. ### Returns - **ActivityScenario** - A scenario for controlling the launched activity. ### Example ```java ActivityScenario scenario = ActivityScenario.launch(MainActivity.class); ``` ``` -------------------------------- ### BasicScreenCaptureProcessor Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha04.txt Documentation for the BasicScreenCaptureProcessor class. ```APIDOC ## [CLASS] BasicScreenCaptureProcessor ### Description Default implementation of ScreenCaptureProcessor that saves screenshots to a file. ### Constructor - `BasicScreenCaptureProcessor()` ### Methods - `protected String getDefaultFilename()` - Returns the default filename for the screenshot. - `protected String getFilename(String tag)` - Generates a filename based on the given tag. - `public String process(ScreenCapture capture) throws IOException` - Processes the capture and returns the filename. ### Fields - `protected String mDefaultFilenamePrefix` - Prefix for the default filename. - `protected File mDefaultScreenshotPath` - Directory where screenshots are saved. - `protected String mFileNameDelimiter` - Delimiter used in filenames. - `protected String mTag` - Tag used in filename generation. ``` -------------------------------- ### AtraceLogger Source: https://github.com/android/android-test/blob/main/api/axt_1.2.0_beta01_api.txt Utility for starting and stopping atrace logging. ```APIDOC ## AtraceLogger ### Description Utility for starting and stopping atrace logging. ### Methods #### getAtraceLoggerInstance - **Signature**: `static androidx.test.rule.logging.AtraceLogger getAtraceLoggerInstance(android.app.Instrumentation)` - **Description**: Returns an instance of AtraceLogger. #### atraceStart - **Signature**: `void atraceStart(java.util.Set, int, int, java.io.File, java.lang.String) throws java.io.IOException` - **Description**: Starts atrace logging with the given categories, buffer size, file, and trace name. #### atraceStop - **Signature**: `void atraceStop() throws java.io.IOException, java.lang.InterruptedException` - **Description**: Stops atrace logging. ``` -------------------------------- ### AtraceLogger.getAtraceLoggerInstance Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-alpha06.txt Gets the AtraceLogger instance for the given instrumentation. ```APIDOC ## [GET] /AtraceLogger/getAtraceLoggerInstance ### Description Gets the AtraceLogger instance for the given instrumentation. ### Method GET ### Endpoint /AtraceLogger/getAtraceLoggerInstance ### Parameters #### Query Parameters - **instrumentation** (android.app.Instrumentation) - Required - The instrumentation. ### Response #### Success Response (200) - **logger** (androidx.test.rule.logging.AtraceLogger) - The AtraceLogger instance. ``` -------------------------------- ### By.descStartsWith(String) Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Creates a BySelector that matches elements whose content description starts with the given text. ```APIDOC ## By.descStartsWith(String) ### Description Creates a BySelector that matches elements whose content description starts with the given text. ### Method descStartsWith ### Parameters - **text** (String) - Required - The text that the content description must start with. ### Returns - **BySelector** - A selector matching elements whose content description starts with the specified text. ``` -------------------------------- ### By.descStartsWith(String) Source: https://github.com/android/android-test/blob/main/api/axt_1.1.1-alpha02_api.txt Creates a BySelector that matches elements whose content description starts with the given text. ```APIDOC ## By.descStartsWith(String) ### Description Creates a BySelector that matches elements whose content description starts with the given text. ### Method descStartsWith ### Parameters - **text** (String) - Required - The prefix to match. ### Returns - **BySelector** - A BySelector that matches elements whose content description starts with the specified text. ``` -------------------------------- ### getPackageName Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-rc01.txt Gets the package name of the underlying view. ```APIDOC ## [METHOD] getPackageName ### Description Returns the package name of the underlying view. Throws UiObjectNotFoundException if the object is not found. ### Method getPackageName ### Returns - **java.lang.String** - The package name of the view. ### Exceptions - **androidx.test.uiautomator.UiObjectNotFoundException** - If the object is not found. ``` -------------------------------- ### Root.Builder Source: https://github.com/android/android-test/blob/main/api/axt_1.3.0.txt Builder for Root with decor view and layout parameters. ```APIDOC ## Root.Builder ### Description Builder for creating Root instances with decor view and window layout parameters. ### Constructor - `Root.Builder()` ### Methods - `build()` : `Root` - Builds the Root. - `withDecorView(View)` : `Builder` - Sets the decor view. - `withWindowLayoutParams(WindowManager.LayoutParams)` : `Builder` - Sets window layout parameters. ``` -------------------------------- ### UiObject2.getVisibleCenter() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the visible center point of the UiObject2. ```APIDOC ## UiObject2.getVisibleCenter() ### Description Gets the visible center point of the UiObject2. ### Method getVisibleCenter ### Signature public android.graphics.Point getVisibleCenter() ### Parameters None ### Returns Point - The visible center point. ``` -------------------------------- ### By.descStartsWith Source: https://github.com/android/android-test/blob/main/api/axt_1.0.2_api.txt Creates a BySelector that matches elements whose content description starts with the given string. ```APIDOC ## By.descStartsWith ### Description Creates a BySelector that matches elements whose content description starts with the given string. ### Method static BySelector ### Signature public static androidx.test.uiautomator.BySelector descStartsWith(java.lang.String desc) ### Parameters - **desc** (java.lang.String) - Required - The prefix to match in the content description. ### Returns androidx.test.uiautomator.BySelector - The created BySelector. ``` -------------------------------- ### UiObject2.getChildren() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the list of child UiObject2 objects. ```APIDOC ## UiObject2.getChildren() ### Description Gets the list of child UiObject2 objects. ### Method getChildren ### Signature public java.util.List getChildren() ### Parameters None ### Returns List - The list of children. ``` -------------------------------- ### UiObject2.getChildCount() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the number of child UiObject2 objects. ```APIDOC ## UiObject2.getChildCount() ### Description Gets the number of child UiObject2 objects. ### Method getChildCount ### Signature public int getChildCount() ### Parameters None ### Returns int - The number of children. ``` -------------------------------- ### ActivityScenario.launch(Class) Source: https://github.com/android/android-test/blob/main/core/java/androidx/test/core/api/current_public.txt Launches an activity of the specified class and returns an ActivityScenario instance. ```APIDOC ## ActivityScenario.launch(Class) ### Description Launches an activity of the specified class and returns an ActivityScenario instance. ### Method launch ### Parameters - **Class** - Required - The activity class to launch. ### Response - **androidx.test.core.app.ActivityScenario** - The scenario controlling the launched activity. ``` -------------------------------- ### descriptionStartsWith(String) Source: https://github.com/android/android-test/blob/main/api/axt_1.1.1-alpha02_api.txt Sets the content description property of the selector to match UI elements whose description starts with the given text. ```APIDOC ## descriptionStartsWith(String) ### Description Sets the content description property of the selector to match UI elements whose description starts with the given text. ### Method descriptionStartsWith ### Signature `public UiSelector descriptionStartsWith(String text)` ### Parameters - **text** (String) - Required - The text that the description must start with. ### Returns This UiSelector instance for chaining. ``` -------------------------------- ### UiObject2.getApplicationPackage() Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0.txt Gets the application package name of the UiObject2. ```APIDOC ## UiObject2.getApplicationPackage() ### Description Gets the application package name of the UiObject2. ### Method getApplicationPackage ### Signature public java.lang.String getApplicationPackage() ### Parameters None ### Returns String - The application package name. ``` -------------------------------- ### SimpleAtom.getScript Source: https://github.com/android/android-test/blob/main/api/axt_1.4.0-rc01.txt Final method to get the JavaScript script. ```APIDOC ## [METHOD] SimpleAtom.getScript ### Description Returns the JavaScript script for the atom. ### Method final ### Signature `public final java.lang.String getScript()` ### Returns - **String** - The JavaScript script. ```