diff options
Diffstat (limited to 'library/core-src/com/android/uiautomator/core/Configurator.java')
-rw-r--r-- | library/core-src/com/android/uiautomator/core/Configurator.java | 118 |
1 files changed, 67 insertions, 51 deletions
diff --git a/library/core-src/com/android/uiautomator/core/Configurator.java b/library/core-src/com/android/uiautomator/core/Configurator.java index 55ed3e7..5f62fc3 100644 --- a/library/core-src/com/android/uiautomator/core/Configurator.java +++ b/library/core-src/com/android/uiautomator/core/Configurator.java @@ -16,10 +16,14 @@ package com.android.uiautomator.core; /** - * The Configurator allows for modification of some key framework parameters. - * New settings take effect immediately and can be changed any time during a test run. + * 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. * - * Can be obtained by calling {@link #getInstance()} + * To modify parameters using Configurator, first obtain an instance by calling + * {@link #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. * @since API Level 18 */ public final class Configurator { @@ -42,7 +46,7 @@ public final class Configurator { } /** - * Retrieves a singleton instance of Configurator + * Retrieves a singleton instance of Configurator. * * @return Configurator instance * @since API Level 18 @@ -55,11 +59,15 @@ public final class Configurator { } /** - * Sets the timeout used to wait for user interface idle before an automation action. + * Sets the timeout for waiting for the user interface to go into an idle + * state before starting a uiautomator action. * - * All automation APIs, except {@link UiDevice}, perform this wait for idle before looking for - * the widget specified by the object's {@link UiSelector}. Once idle is detected, a - * wait for selector will begin. See {@link #setWaitForSelectorTimeout(long)} + * By default, all core uiautomator objects except {@link UiDevice} will perform + * this wait before starting to search for the widget specified by the + * object's {@link 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 {@link #setWaitForSelectorTimeout(long)} * * @param timeout Timeout value in milliseconds * @return self @@ -71,13 +79,17 @@ public final class Configurator { } /** - * Gets the timeout used to wait for user interface idle before an automation action. + * Gets the current timeout used for waiting for the user interface to go + * into an idle state. * - * All automation APIs, except {@link UiDevice}, perform this wait for idle before looking for - * the widget specified by the object's {@link UiSelector}. Once idle is detected, a - * wait for selector will begin. See {@link #setWaitForSelectorTimeout(long)} + * By default, all core uiautomator objects except {@link UiDevice} will perform + * this wait before starting to search for the widget specified by the + * object's {@link 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 {@link #setWaitForSelectorTimeout(long)} * - * @return current timeout in milliseconds + * @return Current timeout value in milliseconds * @since API Level 18 */ public long getWaitForIdleTimeout() { @@ -85,12 +97,13 @@ public final class Configurator { } /** - * Sets the timeout used to wait for a widget matching a selector to become visible - * in user interface. + * Sets the timeout for waiting for a widget to become visible in the user + * interface so that it can be matched by a selector. * - * The user interface content is dynamic and sometimes the specific widget to be - * automated may not yet be visible. This wait allows the framework to keep looking - * for a matching widget to the object's {@link UiSelector}, up until the timeout. + * 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. * * @param timeout Timeout value in milliseconds. * @return self @@ -102,14 +115,15 @@ public final class Configurator { } /** - * Gets the timeout used to wait for a widget matching a selector to become visible - * in user interface. + * 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. * - * The user interface content is dynamic and sometimes the specific widget to be - * automated, may not yet be visible. This wait allows the framework to keep looking - * for a matching widget to the object's {@link UiSelector}, up until the timeout. + * 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. * - * @return current timeout in milliseconds + * @return Current timeout value in milliseconds * @since API Level 18 */ public long getWaitForSelectorTimeout() { @@ -117,13 +131,13 @@ public final class Configurator { } /** - * Sets the timeout used to wait for acknowledgment events caused by automation scroll - * swipe action. + * Sets the timeout for waiting for an acknowledgement of an + * uiautomtor scroll swipe action. * - * The acknowledgment event is an accessibility event, corresponding to the scroll action. - * This acknowledgment helps the framework determine if the requested action was successful. - * Changing this timeout value should only be made in very rare cases and in general use, - * should not be modified. + * The acknowledgment is an <a href="http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html">AccessibilityEvent</a>, + * corresponding to the scroll action, that lets the framework determine if + * the scroll action was successful. Generally, this timeout should not be modified. + * See {@link UiScrollable} * * @param timeout Timeout value in milliseconds * @return self @@ -135,13 +149,13 @@ public final class Configurator { } /** - * Gets the timeout used to wait for acknowledgment events caused by automation scroll - * swipe action. + * Gets the timeout for waiting for an acknowledgement of an + * uiautomtor scroll swipe action. * - * The acknowledgment event is an accessibility event, corresponding to the scroll action. - * This acknowledgment helps the framework determine if the requested action was successful. - * Changing this timeout value should only be made in very rare cases and in general use, - * should not be modified. + * The acknowledgment is an <a href="http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html">AccessibilityEvent</a>, + * corresponding to the scroll action, that lets the framework determine if + * the scroll action was successful. Generally, this timeout should not be modified. + * See {@link UiScrollable} * * @return current timeout in milliseconds * @since API Level 18 @@ -151,13 +165,13 @@ public final class Configurator { } /** - * Sets the timeout used to wait for acknowledgment events caused by generic automation - * actions such as clicks, setText, pressMenu etc... + * Sets the timeout for waiting for an acknowledgment of generic uiautomator + * actions, such as clicks, text setting, and menu presses. * - * The acknowledgment event is an accessibility event, corresponding to an action, that the - * framework looks for after an action is performed. This acknowledgment helps the - * framework determine if the requested action was successful. Changing this timeout - * value should only be made in very rare cases and in general use, should not be modified. + * The acknowledgment is an <a href="http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html">AccessibilityEvent</a>, + * corresponding to an action, that lets the framework determine if the + * action was successful. Generally, this timeout should not be modified. + * See {@link UiObject} * * @param timeout Timeout value in milliseconds * @return self @@ -169,13 +183,13 @@ public final class Configurator { } /** - * Gets the timeout used to wait for acknowledgment events caused by generic automation - * actions such as clicks, setText, pressMenu etc... + * Gets the current timeout for waiting for an acknowledgment of generic + * uiautomator actions, such as clicks, text setting, and menu presses. * - * The acknowledgment event is an accessibility event, corresponding to an action, that the - * framework looks for after an action is performed. This acknowledgment helps the - * framework determine if the requested action was successful. Changing this timeout - * value should only be made in very rare cases and in general use, should not be modified. + * The acknowledgment is an <a href="http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html">AccessibilityEvent</a>, + * corresponding to an action, that lets the framework determine if the + * action was successful. Generally, this timeout should not be modified. + * See {@link UiObject} * * @return current timeout in milliseconds * @since API Level 18 @@ -185,7 +199,8 @@ public final class Configurator { } /** - * Sets a delay between key presses when sending text. + * Sets a delay between key presses when injecting text input. + * See {@link UiObject#setText(String)} * * @param delay Delay value in milliseconds * @return self @@ -197,7 +212,8 @@ public final class Configurator { } /** - * Gets the delay between key presses when sending text. + * Gets the current delay between key presses when injecting text input. + * See {@link UiObject#setText(String)} * * @return current delay in milliseconds * @since API Level 18 @@ -205,4 +221,4 @@ public final class Configurator { public long getKeyInjectionDelay() { return mKeyInjectionDelay; } -} + |