appium-espresso-driver 2.9.1 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +225 -16
- package/build/lib/commands/execute.js +12 -1
- package/build/lib/commands/execute.js.map +1 -0
- package/build/lib/commands/general.js.map +1 -0
- package/build/lib/commands/idling-resources.js.map +1 -0
- package/build/lib/commands/index.js.map +1 -0
- package/build/lib/commands/services.js.map +1 -0
- package/build/lib/desired-caps.js.map +1 -0
- package/build/lib/driver.js.map +1 -0
- package/build/lib/espresso-runner.js.map +1 -0
- package/build/lib/logger.js.map +1 -0
- package/build/lib/server-builder.js.map +1 -0
- package/build/lib/utils.js.map +1 -0
- package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
- package/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/helpers/ViewFinder.kt +49 -42
- package/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/model/HamcrestMatcher.kt +50 -42
- package/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/model/MatcherJson.kt +6 -4
- package/espresso-server/app/src/test/java/io/appium/espressoserver/test/model/HamcrestMatcherTest.kt +66 -34
- package/espresso-server/app/src/test/java/io/appium/espressoserver/test/model/MatcherJsonTest.kt +4 -4
- package/lib/commands/execute.js +12 -1
- package/npm-shrinkwrap.json +357 -828
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,11 @@ The Espresso package consists of two main parts:
|
|
|
13
13
|
- The driver part (written in Node.js) ensures the communication between the Espresso server and Appium. Also includes several handlers that directly use ADB and/or other system tools without a need to talk to the server.
|
|
14
14
|
- The server part (written in Kotlin with some parts of Java), which is running on the device under test and transforms REST API calls into low-level Espresso commands.
|
|
15
15
|
|
|
16
|
+
> **Note**
|
|
17
|
+
>
|
|
18
|
+
> Since version 2.0.0 Espresso driver has dropped the support of Appium 1, and is only compatible to Appium 2. Use the `appium driver install espresso`
|
|
19
|
+
> command to add it to your Appium 2 dist.
|
|
20
|
+
|
|
16
21
|
|
|
17
22
|
## Comparison with UiAutomator2
|
|
18
23
|
|
|
@@ -54,7 +59,7 @@ appium:printPageSourceOnFindFailure | Enforces the server to dump the actual XML
|
|
|
54
59
|
|
|
55
60
|
Capability Name | Description
|
|
56
61
|
--- | ---
|
|
57
|
-
appium:systemPort | The number of the port the Espresso server is listening on. By default the first free port from 8300..8399 range is selected. It is recommended to set this value if you are running [parallel tests](
|
|
62
|
+
appium:systemPort | The number of the port the Espresso server is listening on. By default the first free port from 8300..8399 range is selected. It is recommended to set this value if you are running [parallel tests](docs/parallel-tests.md) on the same machine.
|
|
58
63
|
appium:skipServerInstallation | Skip the Espresso Server component installation on the device under test and all the related checks if set to `true`. This could help to speed up the session startup if you know for sure the correct server version is installed on the device. In case the server is not installed or an incorrect version of it is installed then you may get an unexpected error later. `false` by default
|
|
59
64
|
appium:espressoServerLaunchTimeout | The maximum number of milliseconds to wait util Espresso server is listening on the device. `45000` ms by default
|
|
60
65
|
appium:forceEspressoRebuild | Whether to always enforce Espresso server rebuild (`true`). By default Espresso caches the already built server apk and only rebuilds it when it is necessary, because rebuilding process needs extra time. `false` by default
|
|
@@ -66,11 +71,11 @@ appium:showGradleLog | Whether to include Gradle log to the regular server logs
|
|
|
66
71
|
Capability Name | Description
|
|
67
72
|
--- | ---
|
|
68
73
|
appium:app | Full path to the application to be tested (the app must be located on the same machine where the server is running). The `.apk` application extension is supported. Since driver version 2.1.0 `.aab` files are supported as well (they get converted to `.apk` format automatically if [bundletool.jar](https://github.com/google/bundletool/releases) could be found in your PATH). For older driver versions `.aab` files need to be [converted](https://stackoverflow.com/questions/53040047/generate-apk-file-from-aab-file-android-app-bundle) manually to `.apk` format using [bundletool](https://developer.android.com/studio/command-line/bundletool) first. Could also be an URL to a remote location. If neither of the `app` or `appPackage` capabilities are provided then the driver will fail to start a session. Also, if `app` capability is not provided it is expected that the app under test is already installed on the device under test and `noReset` is equal to `true`.
|
|
69
|
-
appium:appPackage | Application package identifier to be started. If not provided then Espresso will try to detect it automatically from the package provided by the `app` capability. Read [How To Troubleshoot Activities Startup](
|
|
70
|
-
appium:appActivity | Main application activity identifier. If not provided then Espresso will try to detect it automatically from the package provided by the `app` capability. Read [How To Troubleshoot Activities Startup](
|
|
71
|
-
appium:appWaitActivity | Identifier of the first activity that the application invokes. If not provided then equals to `appium:appActivity`. Read [How To Troubleshoot Activities Startup](
|
|
72
|
-
appium:appWaitPackage | Identifier of the first package that is invoked first. If not provided then equals to `appium:appPackage`. Read [How To Troubleshoot Activities Startup](
|
|
73
|
-
appium:appWaitDuration | Maximum amount of milliseconds to wait until the application under test is started (e. g. an activity returns the control to the caller). `20000` ms by default. Read [How To Troubleshoot Activities Startup](
|
|
74
|
+
appium:appPackage | Application package identifier to be started. If not provided then Espresso will try to detect it automatically from the package provided by the `app` capability. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details
|
|
75
|
+
appium:appActivity | Main application activity identifier. If not provided then Espresso will try to detect it automatically from the package provided by the `app` capability. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details
|
|
76
|
+
appium:appWaitActivity | Identifier of the first activity that the application invokes. If not provided then equals to `appium:appActivity`. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details
|
|
77
|
+
appium:appWaitPackage | Identifier of the first package that is invoked first. If not provided then equals to `appium:appPackage`. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details
|
|
78
|
+
appium:appWaitDuration | Maximum amount of milliseconds to wait until the application under test is started (e. g. an activity returns the control to the caller). `20000` ms by default. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details
|
|
74
79
|
appium:intentOptions | The mapping of custom options for the intent that is going to be passed to the main app activity. Check [Intent Options](#intent-options) for more details.
|
|
75
80
|
appium:activityOptions | The mapping of custom options for the main app activity that is going to be started. Check [Activity Options](#activity-options) for more details.
|
|
76
81
|
appium:androidInstallTimeout | Maximum amount of milliseconds to wait until the application under test is installed. `90000` ms by default
|
|
@@ -153,8 +158,8 @@ appium:chromedriverPort | The port number to use for Chromedriver communication.
|
|
|
153
158
|
appium:chromedriverPorts | Array of possible port numbers to assign for Chromedriver communication. If none of the port in this array is free then an error is thrown.
|
|
154
159
|
appium:chromedriverArgs | Array of chromedriver [command line arguments](http://www.assertselenium.com/java/list-of-chrome-driver-command-line-arguments/). Note, that not all command line arguments that are available for the desktop browser are also available for the mobile one.
|
|
155
160
|
appium:chromedriverExecutable | Full path to the chromedriver executable on the server file system.
|
|
156
|
-
appium:chromedriverExecutableDir | Full path to the folder where chromedriver executables are located. This folder is used then to store the downloaded chromedriver executables if automatic download is enabled. Read [Automatic Chromedriver Discovery article](
|
|
157
|
-
appium:chromedriverChromeMappingFile | Full path to the chromedrivers mapping file. This file is used to statically map webview/browser versions to the chromedriver versions that are capable of automating them. Read [Automatic Chromedriver Discovery article](
|
|
161
|
+
appium:chromedriverExecutableDir | Full path to the folder where chromedriver executables are located. This folder is used then to store the downloaded chromedriver executables if automatic download is enabled. Read [Automatic Chromedriver Discovery article](docs/hybrid-mode.md#automatic-discovery-of-compatible-chromedriver) for more details.
|
|
162
|
+
appium:chromedriverChromeMappingFile | Full path to the chromedrivers mapping file. This file is used to statically map webview/browser versions to the chromedriver versions that are capable of automating them. Read [Automatic Chromedriver Discovery article](docs/hybrid-mode.md#automatic-discovery-of-compatible-chromedriver) for more details.
|
|
158
163
|
appium:chromedriverUseSystemExecutable | Set it to `true` in order to enforce the usage of chromedriver, which gets downloaded by Appium automatically upon installation. This driver might not be compatible with the destination browser or a web view. `false` by default.
|
|
159
164
|
appium:chromedriverDisableBuildCheck | Being set to `true` disables the compatibility validation between the current chromedriver and the destination browser/web view. Use it with care.
|
|
160
165
|
appium:autoWebviewTimeout | Set the maximum number of milliseconds to wait until a web view is available if `autoWebview` capability is set to `true`. `2000` ms by default
|
|
@@ -361,8 +366,8 @@ accessibility id | This strategy is mapped to the native Espresso `withContentDe
|
|
|
361
366
|
class name | This strategy is mapped to the native Espresso `withClassName` [matcher](https://developer.android.com/reference/androidx/test/espresso/matcher/ViewMatchers#withClassName(org.hamcrest.Matcher%3Cjava.lang.String%3E)) (exact match of element's class name). | 'android.view.View'
|
|
362
367
|
text | This strategy is mapped to the native Espresso `withText` [matcher](https://developer.android.com/reference/androidx/test/espresso/matcher/ViewMatchers#withText(org.hamcrest.Matcher%3Cjava.lang.String%3E)) (exact match of element's text). | 'my text'
|
|
363
368
|
`-android viewtag` or `tag name` | This strategy is mapped to the native Espresso `withTagValue` [matcher](https://developer.android.com/reference/androidx/test/espresso/matcher/ViewMatchers#withtagvalue) (exact match of element's tag value). | 'my tag'
|
|
364
|
-
-android datamatcher | This strategy allows to create Espresso [data interaction](https://developer.android.com/reference/android/support/test/espresso/DataInteraction) selectors which can quickly and reliably scroll to the necessary elements. Read [Espresso DataMatcher Selector](
|
|
365
|
-
-android viewmatcher | This strategy allows
|
|
369
|
+
-android datamatcher | This strategy allows to create Espresso [data interaction](https://developer.android.com/reference/android/support/test/espresso/DataInteraction) selectors which can quickly and reliably scroll to the necessary elements. Read [Espresso DataMatcher Selector](docs/espresso-datamatcher-selector.md) to know more on how to construct these locators. Also check the [Unlocking New Testing Capabilities with Espresso Driver by Daniel Graham](https://www.youtube.com/watch?v=gU9EEUV5n9U) presentation video from Appium Conf 2019. | `{"name": "hasEntry", "args": ["title", "WebView3"]}`
|
|
370
|
+
-android viewmatcher | This strategy allows constructing of Espresso [view matchers](https://developer.android.com/reference/androidx/test/espresso/matcher/ViewMatchers) based on the given JSON representation of them. The representation is expected to contain the following fields: `name`: _mandatory_ matcher function name; `args`: _optional_ matcher function arguments, each argument could also be a function; `class`: _optional_ full qualified class name of the corresponding matcher (if not provided then [org.hamcrest.Matchers](https://hamcrest.org/JavaHamcrest/javadoc/2.2/org/hamcrest/Matchers.html) one is used), `scope` (since Espresso driver 2.11.0): _optional_ JSON representation of a [RootMatchers](https://developer.android.com/reference/androidx/test/espresso/matcher/RootMatchers) method. Check [unit tests](https://github.com/appium/appium-espresso-driver/blob/master/espresso-server/app/src/test/java/io/appium/espressoserver/test/model/HamcrestMatcherTest.kt) for more examples. | `{"name": "withText", "args": [{"name": "containsString", "args": "getExternalStoragePublicDirectory", "class": "org.hamcrest.Matchers"}], "class": "androidx.test.espresso.matcher.ViewMatchers"}`
|
|
366
371
|
xpath | For elements lookup Xpath strategy the driver uses the same XML tree that is generated by page source API. Only Xpath 1.0 is supported. | `By.xpath("//android.view.View[@text=\"Regular\" and @checkable=\"true\"]")`
|
|
367
372
|
|
|
368
373
|
|
|
@@ -384,7 +389,7 @@ Beside of standard W3C APIs the driver provides the following custom command ext
|
|
|
384
389
|
|
|
385
390
|
### mobile: shell
|
|
386
391
|
|
|
387
|
-
Executes the given shell command on the device under test via ADB connection. This extension exposes a potential security risk and thus is only enabled when explicitly activated by the `adb_shell` server
|
|
392
|
+
Executes the given shell command on the device under test via ADB connection. This extension exposes a potential security risk and thus is only enabled when explicitly activated by the `adb_shell` server command line feature specifier
|
|
388
393
|
|
|
389
394
|
#### Arguments
|
|
390
395
|
|
|
@@ -402,7 +407,7 @@ Depending on the `includeStderr` value this API could either return a string, wh
|
|
|
402
407
|
### mobile: execEmuConsoleCommand
|
|
403
408
|
|
|
404
409
|
Executes a command through emulator telnet console interface and returns its output.
|
|
405
|
-
The `emulator_console` server
|
|
410
|
+
The `emulator_console` server feature must be enabled in order to use this method.
|
|
406
411
|
|
|
407
412
|
#### Arguments
|
|
408
413
|
|
|
@@ -419,7 +424,27 @@ The actual command output. An error is thrown if command execution fails.
|
|
|
419
424
|
|
|
420
425
|
### mobile: performEditorAction
|
|
421
426
|
|
|
422
|
-
Performs IME action on the
|
|
427
|
+
Performs IME action on the _currently focused_ edit element.
|
|
428
|
+
|
|
429
|
+
Very often Android developers use [onEditorAction](https://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html#onEditorAction(android.widget.TextView,%20int,%20android.view.KeyEvent)) callback with `actionId` argument to implement actions handling, for example, when `Search` or `Done` button is pressed on the on-screen keyboard. This mobile extension is supposed to emulate the invokation of such callback on the focused element.
|
|
430
|
+
|
|
431
|
+
#### Arguments
|
|
432
|
+
|
|
433
|
+
Name | Type | Required | Description | Example
|
|
434
|
+
--- | --- | --- | --- | ---
|
|
435
|
+
action | string | yes | The name or an integer code of the editor action to be executed. The following action names are supported: `normal, unspecified, none, go, search, send, next, done, previous`. Read [EditorInfo](https://developer.android.com/reference/android/view/inputmethod/EditorInfo) for more details on this topic. | search
|
|
436
|
+
|
|
437
|
+
#### Examples
|
|
438
|
+
|
|
439
|
+
```java
|
|
440
|
+
// Java
|
|
441
|
+
driver.executeScript("mobile: performEditorAction", ImmutableMap.of("action", "Go"));
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
```python
|
|
445
|
+
# Python
|
|
446
|
+
driver.execute_script('mobile: performEditorAction', {'action': 'previous'})
|
|
447
|
+
```
|
|
423
448
|
|
|
424
449
|
### mobile: changePermissions
|
|
425
450
|
|
|
@@ -450,7 +475,7 @@ Array of strings, where each string is a permission name. the array could be emp
|
|
|
450
475
|
|
|
451
476
|
### mobile: startScreenStreaming
|
|
452
477
|
|
|
453
|
-
Starts device screen broadcast by creating MJPEG server. Multiple calls to this method have no effect unless the previous streaming session is stopped. This method only works if the `adb_screen_streaming`
|
|
478
|
+
Starts device screen broadcast by creating MJPEG server. Multiple calls to this method have no effect unless the previous streaming session is stopped. This method only works if the `adb_screen_streaming` feature is enabled on the server side. It is also required that [GStreamer](https://gstreamer.freedesktop.org/) with `gst-plugins-base`, `gst-plugins-good` and `gst-plugins-bad` packages is installed and available in PATH on the server machine.
|
|
454
479
|
|
|
455
480
|
#### Arguments
|
|
456
481
|
|
|
@@ -721,6 +746,45 @@ Name | Type | Required | Description | Example
|
|
|
721
746
|
--- | --- | --- | --- | ---
|
|
722
747
|
timeoutMs | number | no | The maximum number of milliseconds to block until GPS cache is refreshed. If the API call does not receive a confirmation about successful cache refresh within this timeout then an error is thrown. Providing zero or a negative value to it skips waiting completely and does not check for any errors. 20000 ms by default. | 60000
|
|
723
748
|
|
|
749
|
+
### mobile: pullFile
|
|
750
|
+
|
|
751
|
+
Pulls a remote file from the device.
|
|
752
|
+
|
|
753
|
+
#### Arguments
|
|
754
|
+
|
|
755
|
+
Name | Type | Required | Description | Example
|
|
756
|
+
--- | --- | --- | --- | ---
|
|
757
|
+
remotePath | string | yes | The full path to the remote file or a specially formatted path, which points to an item inside an app bundle, for example `@my.app.id/my/path`. It is mandatory for the app bundle to have [debugging enabled](https://developer.android.com/studio/debug) in order to use the latter remotePath format. If the file with the given name does not exist then an exception will be thrown. | /sdcard/foo.bar
|
|
758
|
+
|
|
759
|
+
#### Returned Result
|
|
760
|
+
|
|
761
|
+
Base64-encoded string, which represents the content of the remote file.
|
|
762
|
+
|
|
763
|
+
### mobile: pushFile
|
|
764
|
+
|
|
765
|
+
Pushes a local file to the device.
|
|
766
|
+
|
|
767
|
+
#### Arguments
|
|
768
|
+
|
|
769
|
+
Name | Type | Required | Description | Example
|
|
770
|
+
--- | --- | --- | --- | ---
|
|
771
|
+
remotePath | string | yes | The path on the device to where the payload should be written. The value format is similar to the one used in [pullFile](#mobile-pullfile) extension. If the file with the same name already exists then it will be silently overridden. | /sdcard/foo.bar
|
|
772
|
+
payload | string | yes | Base64-encoded content of the file to be pushed. | QXBwaXVt
|
|
773
|
+
|
|
774
|
+
### mobile: pullFolder
|
|
775
|
+
|
|
776
|
+
Pulls a remote folder from the device.
|
|
777
|
+
|
|
778
|
+
#### Arguments
|
|
779
|
+
|
|
780
|
+
Name | Type | Required | Description | Example
|
|
781
|
+
--- | --- | --- | --- | ---
|
|
782
|
+
remotePath | string | yes | Same as for [pullFile](#mobile-pullfile) extension, but should be pointing to a remote folder | /sdcard/yolo/
|
|
783
|
+
|
|
784
|
+
#### Returned Result
|
|
785
|
+
|
|
786
|
+
Base64-encoded string, which represents the zipped content of the remote folder.
|
|
787
|
+
|
|
724
788
|
### mobile: deleteFile
|
|
725
789
|
|
|
726
790
|
Deletes a file on the remote device.
|
|
@@ -731,6 +795,111 @@ Name | Type | Required | Description | Example
|
|
|
731
795
|
--- | --- | --- | --- | ---
|
|
732
796
|
remotePath | string | yes | The full path to the remote file or a file inside an application bundle | `/sdcard/myfile.txt` or `@my.app.id/path/in/bundle`
|
|
733
797
|
|
|
798
|
+
### mobile: isAppInstalled
|
|
799
|
+
|
|
800
|
+
Verify whether an application is installed on the device under test.
|
|
801
|
+
|
|
802
|
+
#### Arguments
|
|
803
|
+
|
|
804
|
+
Name | Type | Required | Description | Example
|
|
805
|
+
--- | --- | --- | --- | ---
|
|
806
|
+
appId | string | yes | The identifier of the application package to be checked | `my.app.id`
|
|
807
|
+
|
|
808
|
+
#### Returned Result
|
|
809
|
+
|
|
810
|
+
True or false
|
|
811
|
+
|
|
812
|
+
### mobile: queryAppState
|
|
813
|
+
|
|
814
|
+
Queries the current state of the app.
|
|
815
|
+
|
|
816
|
+
#### Arguments
|
|
817
|
+
|
|
818
|
+
Name | Type | Required | Description | Example
|
|
819
|
+
--- | --- | --- | --- | ---
|
|
820
|
+
appId | string | yes | The identifier of the application package to be checked | `my.app.id`
|
|
821
|
+
|
|
822
|
+
#### Returned Result
|
|
823
|
+
|
|
824
|
+
The following numbers could returned:
|
|
825
|
+
- The app is not installed: `0`
|
|
826
|
+
- The app is installed and is not running: `1`
|
|
827
|
+
- The app is running in background: `3`
|
|
828
|
+
- The app is running in foreground: `4`
|
|
829
|
+
|
|
830
|
+
### mobile: activateApp
|
|
831
|
+
|
|
832
|
+
Activates the given application or launches it if necessary.
|
|
833
|
+
The action literally simulates
|
|
834
|
+
clicking the corresponding application icon on the dashboard.
|
|
835
|
+
|
|
836
|
+
#### Arguments
|
|
837
|
+
|
|
838
|
+
Name | Type | Required | Description | Example
|
|
839
|
+
--- | --- | --- | --- | ---
|
|
840
|
+
appId | string | yes | The identifier of the application package to be activated | `my.app.id`
|
|
841
|
+
|
|
842
|
+
### mobile: removeApp
|
|
843
|
+
|
|
844
|
+
Remove the corresponding application if is installed.
|
|
845
|
+
The call is ignored if the app is not installed.
|
|
846
|
+
|
|
847
|
+
#### Arguments
|
|
848
|
+
|
|
849
|
+
Name | Type | Required | Description | Example
|
|
850
|
+
--- | --- | --- | --- | ---
|
|
851
|
+
appId | string | yes | The identifier of the application package to be removed | `my.app.id`
|
|
852
|
+
|
|
853
|
+
#### Returned Result
|
|
854
|
+
|
|
855
|
+
True is the app has been found on the device and successfully removed. Otherwise false.
|
|
856
|
+
|
|
857
|
+
### mobile: terminateApp
|
|
858
|
+
|
|
859
|
+
Terminates the app if it is running.
|
|
860
|
+
|
|
861
|
+
#### Arguments
|
|
862
|
+
|
|
863
|
+
Name | Type | Required | Description | Example
|
|
864
|
+
--- | --- | --- | --- | ---
|
|
865
|
+
appId | string | yes | The identifier of the application package to be terminated | `my.app.id`
|
|
866
|
+
timeout | number | no | The count of milliseconds to wait until the app is terminated. 500ms by default. | 1500
|
|
867
|
+
|
|
868
|
+
#### Returned Result
|
|
869
|
+
|
|
870
|
+
True if the app has been successfully terminated.
|
|
871
|
+
|
|
872
|
+
### mobile: installApp
|
|
873
|
+
|
|
874
|
+
Installs the given application package to the device under test.
|
|
875
|
+
|
|
876
|
+
#### Arguments
|
|
877
|
+
|
|
878
|
+
Name | Type | Required | Description | Example
|
|
879
|
+
--- | --- | --- | --- | ---
|
|
880
|
+
appPath | string | yes | The local .apk(s) path on the server filesystem or a remote url. | `/app/path.apk`
|
|
881
|
+
timeout | number | no | The count of milliseconds to wait until the app is installed.. 6000ms by default. | 120000
|
|
882
|
+
allowTestPackages | boolean | no | Set to true in order to allow test packages installation. false by default | true
|
|
883
|
+
useSdcard | boolean | no | Set to true to install the app on sdcard instead of the device memory. false by default | true
|
|
884
|
+
grantPermissions | boolean | no | Set to true in order to grant all the permissions requested in the application's manifest automatically after the installation is completed under Android 6+. false by default | true
|
|
885
|
+
replace | boolean | no | Set it to false if you don't want the application to be upgraded/reinstalled if it is already present on the device, but throw an error instead. true by default | false
|
|
886
|
+
|
|
887
|
+
### mobile: clearApp
|
|
888
|
+
|
|
889
|
+
Deletes all data associated with a package. Calls `adb shell pm clear` under the hood.
|
|
890
|
+
The app should be accessible, should not be running,
|
|
891
|
+
and should exist on the device under test for this extension to work properly.
|
|
892
|
+
|
|
893
|
+
#### Arguments
|
|
894
|
+
|
|
895
|
+
Name | Type | Required | Description | Example
|
|
896
|
+
--- | --- | --- | --- | ---
|
|
897
|
+
appId | string | yes | The identifier of the application package to be cleared | `my.app.id`
|
|
898
|
+
|
|
899
|
+
#### Returned Result
|
|
900
|
+
|
|
901
|
+
Stdout of the corresponding adb command.
|
|
902
|
+
|
|
734
903
|
### mobile: startActivity
|
|
735
904
|
|
|
736
905
|
Starts the given activity with intent options, activity options and locale. Activity could only be executed in scope of the current app package.
|
|
@@ -767,6 +936,32 @@ Name | Type | Required | Description | Example
|
|
|
767
936
|
intent | string | yes | The name of the service intent to stop. Only services in the app's under test scope could be stopped. | `com.some.package.name/.YourServiceSubClassName`
|
|
768
937
|
user | number or string | no | The user ID for which the service is started. The `current` user id is used by default | 1006
|
|
769
938
|
|
|
939
|
+
### mobile: broadcast
|
|
940
|
+
|
|
941
|
+
Send a broadcast Intent. Invokes `am broadcast` command under the hood.
|
|
942
|
+
|
|
943
|
+
#### Arguments
|
|
944
|
+
|
|
945
|
+
Name | Type | Required | Description | Example
|
|
946
|
+
--- | --- | --- | --- | ---
|
|
947
|
+
intent | string | no | The full name of the intent to broadcast | `com.some.package.name/.YourIntentClassName`
|
|
948
|
+
user | number or string | no | Specify which user to send to; if not specified then send to all users. Possible values are `all`/`current`/`<numeric user id>` | current
|
|
949
|
+
receiverPermission | string | no | Require receiver to hold the given permission | android.permission.READ_PROFILE
|
|
950
|
+
allowBackgroundActivityStarts | boolean | no | The receiver may start activities even if in the background if set to `true` | false
|
|
951
|
+
action | string | no | Action name. The actual value for the Activity Manager's `-a` argument. | android.intent.action.MAIN
|
|
952
|
+
uri | string | no | Unified resource identifier. The actual value for the Activity Manager's `-d` argument. | https://appium.io
|
|
953
|
+
mimeType | string | no | Mime type. The actual value for the Activity Manager's `-t` argument. | application/json
|
|
954
|
+
identifier | string | no | Optional identifier. The actual value for the Activity Manager's `-i` argument. | my_identifier
|
|
955
|
+
categories | string or Array<string> | no | One or more category names. The actual value(s) for the Activity Manager's `-c` argument. | android.intent.category.LAUNCHER
|
|
956
|
+
component | string | no | Component name. The actual value for the Activity Manager's `-n` argument. | com.myapp/com.myapp.SplashActivity
|
|
957
|
+
package | string | no | Package name. The actual value for the Activity Manager's `-p` argument. | com.myapp
|
|
958
|
+
extras | Array<Array<string>> | no | Optional intent arguments. Must be represented as an array of arrays, where each subarray item contains two (only in case it no value is required for the given type) or three string items: value type, key (variable name) and the value itself. Supported value types are: `s`: string. Value must be a valid string; `sn`: null. Value is ignored for this type; `z`: boolean. Value must be either `true` or `false`; `i`: integer. Value must be a valid 4-byte integer number; `l`: long. Value must be a valid 8-byte long number; `f`: float: Value must be a valid float number; `u`: uri. Value must be a valid uniform resource identifier string; `cn`: component name. Value must be a valid component name string; `ia`: Integer[]. Value must be a string of comma-separated integers; `ial`: List<Integer>. Value must be a string of comma-separated integers; `la`: Long[]. Value must be a string of comma-separated long numbers; `lal`: List<Long>. Value must be a string of comma-separated long numbers; `fa`: Float[]. Value must be a string of comma-separated float numbers; `fal`: List<Float>. Value must be a string of comma-separated float numbers; `sa`: String[]. Value must be comma-separated strings. To embed a comma into a string escape it using "\,"; `sal`: List<String>. Value must be comma-separated strings. To embed a comma into a string, escape it using "\," | [['s', 'varName1', 'My String1'], ['s', 'varName2', 'My String2'], ['ia', 'arrName', '1,2,3,4']]
|
|
959
|
+
flags | string | no | Intent startup-specific flags as a hexadecimal string. Check [Intent documentation](https://developer.android.com/reference/android/content/Intent.html) for the list of available flag values (constants starting with `FLAG_ACTIVITY_`). Flag values could be merged using the logical 'or' operation. | 0x10200000 is the combination of two flags: 0x10000000 `FLAG_ACTIVITY_NEW_TASK` `|` 0x00200000 `FLAG_ACTIVITY_RESET_TASK_IF_NEEDED`
|
|
960
|
+
|
|
961
|
+
#### Returned Result
|
|
962
|
+
|
|
963
|
+
The actual stdout of the downstream `am` command.
|
|
964
|
+
|
|
770
965
|
### mobile: getDeviceTime
|
|
771
966
|
|
|
772
967
|
Retrieves the current device's timestamp.
|
|
@@ -993,10 +1188,24 @@ For example, in the following arguments map
|
|
|
993
1188
|
the `anotherMethod` will be called on the object returned by `someMethod`, which has no arguments and which was executed on the current activity instance. Also `anotherMethod` accepts to arguments of type `java.lang.CharSequence` and `int`. The result of `anotherMethod` will be serialized and returned to the client.
|
|
994
1189
|
|
|
995
1190
|
|
|
1191
|
+
## Parallel Tests
|
|
1192
|
+
|
|
1193
|
+
It is possible to execute tests in parallel using Espresso driver.
|
|
1194
|
+
Appium allows to do this on per-process (multiple server processes running on different ports managing single session)
|
|
1195
|
+
or per-request basis (single server process managing multiple sessions, more preferable, uses less resources and ensures better control over running sessions). Check [Parallel Android Tests](docs/parallel-tests.md) article for
|
|
1196
|
+
more details.
|
|
1197
|
+
|
|
1198
|
+
> **Note**
|
|
1199
|
+
> If you are _not_ going to run your tests in parallel then consider enabling the `--session-override` Appium server argument. It forces the server to close all pending sessions before a new one could be opened,
|
|
1200
|
+
> which allows you to avoid possible issues with such sessions silently running/expiring in the background.
|
|
1201
|
+
|
|
1202
|
+
|
|
996
1203
|
## Troubleshooting
|
|
997
1204
|
|
|
998
|
-
* If
|
|
999
|
-
*
|
|
1205
|
+
* If you observe Espresso server crash on startup and various exceptions about missing class/method in the logcat output then consider updating [appium:espressoBuildConfig](#espresso-build-config) capability with module versions that match your application under test. This might require some experimentation, as different apps have different module requirements. Check, for example, [issue #812](https://github.com/appium/appium-espresso-driver/issues/812)
|
|
1206
|
+
* If you experince issues with application activities being not found or not starting then consider checking [How To Troubleshoot Activities Startup](docs/activity-startup.md) article.
|
|
1207
|
+
* Espresso requires the debug APK and app-under-test APK (AUT) to have the same signature. It automatically signs the AUT with the `io.appium.espressoserver.test` signature. This may be problematic if you're using an outdated Android SDK tools and/or an outdated Java version.
|
|
1208
|
+
* If there are problems starting a session, set the capability `forceEspressoRebuild` to `true` and retry. This will force rebuilding of Espresso Server. If the following session startup is successfull, set it back to `false`, so the session startup performance is back to normal.
|
|
1000
1209
|
* If you experience session startup failures due to exceptions similar to `Resources$NotFoundException` then try to adjust your ProGuard rules:
|
|
1001
1210
|
```
|
|
1002
1211
|
-dontwarn com.google.android.material.**
|
|
@@ -45,10 +45,21 @@ extensions.executeMobile = async function executeMobile(mobileCommand, opts = {}
|
|
|
45
45
|
getNotifications: 'mobileGetNotifications',
|
|
46
46
|
listSms: 'mobileListSms',
|
|
47
47
|
sensorSet: 'sensorSet',
|
|
48
|
+
pushFile: 'mobilePushFile',
|
|
49
|
+
pullFile: 'mobilePullFile',
|
|
50
|
+
pullFolder: 'mobilePullFolder',
|
|
48
51
|
deleteFile: 'mobileDeleteFile',
|
|
52
|
+
isAppInstalled: 'mobileIsAppInstalled',
|
|
53
|
+
queryAppState: 'mobileQueryAppState',
|
|
54
|
+
activateApp: 'mobileActivateApp',
|
|
55
|
+
removeApp: 'mobileRemoveApp',
|
|
56
|
+
terminateApp: 'mobileTerminateApp',
|
|
57
|
+
installApp: 'mobileInstallApp',
|
|
58
|
+
clearApp: 'mobileClearApp',
|
|
49
59
|
startActivity: 'mobileStartActivity',
|
|
50
60
|
startService: 'mobileStartService',
|
|
51
61
|
stopService: 'mobileStopService',
|
|
62
|
+
broadcast: 'mobileBroadcast',
|
|
52
63
|
registerIdlingResources: 'mobileRegisterIdlingResources',
|
|
53
64
|
unregisterIdlingResources: 'mobileUnregisterIdlingResources',
|
|
54
65
|
listIdlingResources: 'mobileListIdlingResources',
|
|
@@ -68,4 +79,4 @@ extensions.executeMobile = async function executeMobile(mobileCommand, opts = {}
|
|
|
68
79
|
|
|
69
80
|
var _default = extensions;
|
|
70
81
|
exports.default = _default;
|
|
71
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64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BTyxNQUFNLEtBQUtBLHFCQUFxQixDQUFDRixhQUFELENBQTFCLEVBQTJDQyxJQUEzQyxDQUFiO0FBQ0QsQ0FyRkQ7O2VBdUZlSCxVIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","names":["extensions","executeMobile","mobileCommand","opts","mobileCommandsMapping","shell","execEmuConsoleCommand","performEditorAction","changePermissions","getPermissions","startScreenStreaming","stopScreenStreaming","swipe","scrollToPage","navigateTo","clickAction","deviceInfo","isToastVisible","openDrawer","closeDrawer","setDate","setTime","getDeviceTime","backdoor","flashElement","uiautomator","uiautomatorPageSource","webAtoms","getContexts","dismissAutofill","getNotifications","listSms","sensorSet","pushFile","pullFile","pullFolder","deleteFile","isAppInstalled","queryAppState","activateApp","removeApp","terminateApp","installApp","clearApp","startActivity","startService","stopService","broadcast","registerIdlingResources","unregisterIdlingResources","listIdlingResources","unlock","refreshGpsCache","startMediaProjectionRecording","isMediaProjectionRecordingRunning","stopMediaProjectionRecording","_","has","errors","UnknownCommandError","keys"],"sources":["../../../lib/commands/execute.js"],"sourcesContent":["import _ from 'lodash';\nimport { errors } from 'appium/driver';\n\nconst extensions = {};\n\nextensions.executeMobile = async function executeMobile (mobileCommand, opts = {}) {\n const mobileCommandsMapping = {\n shell: 'mobileShell',\n\n execEmuConsoleCommand: 'mobileExecEmuConsoleCommand',\n\n performEditorAction: 'mobilePerformEditorAction',\n\n changePermissions: 'mobileChangePermissions',\n getPermissions: 'mobileGetPermissions',\n\n startScreenStreaming: 'mobileStartScreenStreaming',\n stopScreenStreaming: 'mobileStopScreenStreaming',\n\n swipe: 'mobileSwipe',\n scrollToPage: 'mobileScrollToPage',\n navigateTo: 'mobileNavigateTo',\n clickAction: 'mobileClickAction',\n\n deviceInfo: 'mobileGetDeviceInfo',\n\n isToastVisible: 'mobileIsToastVisible',\n\n openDrawer: 'mobileOpenDrawer',\n closeDrawer: 'mobileCloseDrawer',\n\n setDate: 'mobileSetDate',\n setTime: 'mobileSetTime',\n\n getDeviceTime: 'mobileGetDeviceTime',\n\n backdoor: 'mobileBackdoor',\n\n flashElement: 'mobileFlashElement',\n\n uiautomator: 'mobileUiautomator',\n uiautomatorPageSource: 'mobileUiautomatorPageSource',\n\n webAtoms: 'mobileWebAtoms',\n getContexts: 'mobileGetContexts',\n\n dismissAutofill: 'mobileDismissAutofill',\n\n getNotifications: 'mobileGetNotifications',\n\n listSms: 'mobileListSms',\n\n sensorSet: 'sensorSet',\n\n pushFile: 'mobilePushFile',\n pullFile: 'mobilePullFile',\n pullFolder: 'mobilePullFolder',\n deleteFile: 'mobileDeleteFile',\n\n isAppInstalled: 'mobileIsAppInstalled',\n queryAppState: 'mobileQueryAppState',\n activateApp: 'mobileActivateApp',\n removeApp: 'mobileRemoveApp',\n terminateApp: 'mobileTerminateApp',\n installApp: 'mobileInstallApp',\n clearApp: 'mobileClearApp',\n\n startActivity: 'mobileStartActivity',\n startService: 'mobileStartService',\n stopService: 'mobileStopService',\n broadcast: 'mobileBroadcast',\n\n registerIdlingResources: 'mobileRegisterIdlingResources',\n unregisterIdlingResources: 'mobileUnregisterIdlingResources',\n listIdlingResources: 'mobileListIdlingResources',\n\n unlock: 'mobileUnlock',\n\n refreshGpsCache: 'mobileRefreshGpsCache',\n\n startMediaProjectionRecording: 'mobileStartMediaProjectionRecording',\n isMediaProjectionRecordingRunning: 'mobileIsMediaProjectionRecordingRunning',\n stopMediaProjectionRecording: 'mobileStopMediaProjectionRecording',\n };\n\n if (!_.has(mobileCommandsMapping, mobileCommand)) {\n throw new errors.UnknownCommandError(`Unknown mobile command \"${mobileCommand}\". ` +\n `Only ${_.keys(mobileCommandsMapping)} commands are supported.`);\n }\n return await this[mobileCommandsMapping[mobileCommand]](opts);\n};\n\nexport default extensions;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA,MAAMA,UAAU,GAAG,EAAnB;;AAEAA,UAAU,CAACC,aAAX,GAA2B,eAAeA,aAAf,CAA8BC,aAA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AAE,gBA3DkB;IA6D5BC,aAAa,EAAE,qBA7Da;IA8D5BC,YAAY,EAAE,oBA9Dc;IA+D5BC,WAAW,EAAE,mBA/De;IAgE5BC,SAAS,EAAE,iBAhEiB;IAkE5BC,uBAAuB,EAAE,+BAlEG;IAmE5BC,yBAAyB,EAAE,iCAnEC;IAoE5BC,mBAAmB,EAAE,2BApEO;IAsE5BC,MAAM,EAAE,cAtEoB;IAwE5BC,eAAe,EAAE,uBAxEW;IA0E5BC,6BAA6B,EAAE,qCA1EH;IA2E5BC,iCAAiC,EAAE,yCA3EP;IA4E5BC,4BAA4B,EAAE;EA5EF,CAA9B;;EA+EA,IAAI,CAACC,eAAA,CAAEC,GAAF,CAAMrD,qBAAN,EAA6BF,aAA7B,CAAL,EAAkD;IAChD,MAAM,IAAIwD,cAAA,CAAOC,mBAAX,CAAgC,2BAA0BzD,aAAc,KAAzC,GAClC,QAAOsD,eAAA,CAAEI,IAAF,CAAOxD,qBAAP,CAA8B,0BADlC,CAAN;EAED;;EACD,OAAO,MAAM,KAAKA,qBAAqB,CAACF,aAAD,CAA1B,EAA2CC,IAA3C,CAAb;AACD,CArFD;;eAuFeH,U"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.js","names":["commands","helpers","extensions","assertRequiredOptions","options","requiredOptionNames","_","isArray","presentOptionNames","keys","missingOptionNames","difference","isEmpty","Error","JSON","stringify","launchApp","errors","UnsupportedOperationError","closeApp","reset","getClipboard","adb","getApiLevel","espresso","jwproxy","command","mobilePerformEditorAction","opts","action","mobileSwipe","direction","element","swiper","startCoordinates","endCoordinates","precisionDescriber","util","unwrapElement","mobileGetDeviceInfo","mobileIsToastVisible","text","isRegexp","hasValue","InvalidArgumentError","mobileOpenDrawer","gravity","mobileCloseDrawer","mobileSetDate","year","monthOfYear","dayOfMonth","mobileSetTime","hours","minutes","mobileNavigateTo","menuItemId","menuItemIdAsNumber","parseInt","isNaN","mobileWebAtoms","getDisplayDensity","mobileScrollToPage","scrollToTypes","res","validate","presence","scrollTo","inclusion","within","message","join","scrollToPage","numericality","onlyInteger","greaterThanOrEqualTo","smoothScroll","log","warn","mobileBackdoor","target","methods","elementId","targetElement","mobileUiautomator","strategy","locator","index","mobileUiautomatorPageSource","mobileFlashElement","durationMillis","repeatCount","mobileClickAction","tapper","coordinatesProvider","inputDevice","buttonState","updateSettings","settings","getSettings","suspendChromedriverProxy","chromedriver","proxyReqRes","bind","proxyCommand","jwpProxyActive","mobileStartActivity","appPackage","caps","appActivity","locale","optionalIntentArguments","optionalActivityArguments","startActivity","appWaitPackage","appWaitActivity","qualifyActivityName","debug","waitForActivity","mobileDismissAutofill","Object","assign"],"sources":["../../../lib/commands/general.js"],"sourcesContent":["import _ from 'lodash';\nimport { util } from 'appium/support';\nimport validate from 'validate.js';\nimport { errors } from 'appium/driver';\nimport { qualifyActivityName } from '../utils';\n\nconst commands = {}, helpers = {}, extensions = {};\n\nfunction assertRequiredOptions (options, requiredOptionNames) {\n if (!_.isArray(requiredOptionNames)) {\n requiredOptionNames = [requiredOptionNames];\n }\n const presentOptionNames = _.keys(options);\n const missingOptionNames = _.difference(requiredOptionNames, presentOptionNames);\n if (_.isEmpty(missingOptionNames)) {\n return options;\n }\n throw new Error(`The following options are required: ${JSON.stringify(missingOptionNames)}. ` +\n `You have only provided: ${JSON.stringify(presentOptionNames)}`);\n}\n\n// eslint-disable-next-line require-await\ncommands.launchApp = async function launchApp () {\n throw new errors.UnsupportedOperationError('Please create a new session in order to launch the application under test');\n};\n\n// eslint-disable-next-line require-await\ncommands.closeApp = async function closeApp () {\n throw new errors.UnsupportedOperationError('Please quit the session in order to close the application under test');\n};\n\n// eslint-disable-next-line require-await\ncommands.reset = async function reset () {\n throw new errors.UnsupportedOperationError(\n 'Please quit the session and create a new one ' +\n 'in order to close and launch the application under test');\n};\n\ncommands.getClipboard = async function getClipboard () {\n return (await this.adb.getApiLevel() < 29)\n ? (await this.espresso.jwproxy.command('/appium/device/get_clipboard', 'POST', {}))\n : (await this.adb.getClipboard());\n};\n\ncommands.mobilePerformEditorAction = async function mobilePerformEditorAction (opts = {}) {\n const {action} = assertRequiredOptions(opts, ['action']);\n return await this.espresso.jwproxy.command('/appium/device/perform_editor_action', 'POST', {action});\n};\n\ncommands.mobileSwipe = async function mobileSwipe (opts = {}) {\n const {direction, element, swiper, startCoordinates, endCoordinates, precisionDescriber} = assertRequiredOptions(opts, ['element']);\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/swipe`, 'POST', {\n direction, element, swiper, startCoordinates, endCoordinates, precisionDescriber\n });\n};\n\ncommands.mobileGetDeviceInfo = async function mobileGetDeviceInfo () {\n return await this.espresso.jwproxy.command('/appium/device/info', 'GET');\n};\n\ncommands.mobileIsToastVisible = async function mobileIsToastVisible (opts = {}) {\n const {text, isRegexp} = opts;\n if (!util.hasValue(text)) {\n throw new errors.InvalidArgumentError(`'text' argument is mandatory`);\n }\n return await this.espresso.jwproxy.command('/appium/execute_mobile/is_toast_displayed', 'POST', {\n text,\n isRegexp,\n });\n};\n\ncommands.mobileOpenDrawer = async function mobileOpenDrawer (opts = {}) {\n const {element, gravity} = assertRequiredOptions(opts, ['element']);\n\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/open_drawer`, 'POST', {\n gravity\n });\n};\n\ncommands.mobileCloseDrawer = async function mobileCloseDrawer (opts = {}) {\n const {element, gravity} = assertRequiredOptions(opts, ['element']);\n\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/close_drawer`, 'POST', {\n gravity\n });\n};\n\ncommands.mobileSetDate = async function mobileSetDate (opts = {}) {\n const {element, year, monthOfYear, dayOfMonth} = assertRequiredOptions(opts, ['element', 'year', 'monthOfYear', 'dayOfMonth']);\n\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/set_date`, 'POST', {\n year,\n monthOfYear,\n dayOfMonth,\n });\n};\n\ncommands.mobileSetTime = async function mobileSetTime (opts = {}) {\n const {element, hours, minutes} = assertRequiredOptions(opts, ['element', 'hours', 'minutes']);\n\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/set_time`, 'POST', {\n hours,\n minutes,\n });\n};\n\ncommands.mobileNavigateTo = async function mobileNavigateTo (opts = {}) {\n let {element, menuItemId} = assertRequiredOptions(opts, ['menuItemId', 'element']);\n\n let menuItemIdAsNumber = parseInt(menuItemId, 10);\n if (_.isNaN(menuItemIdAsNumber) || menuItemIdAsNumber < 0) {\n throw new errors.InvalidArgumentError(`'menuItemId' must be a non-negative number. Found ${menuItemId}`);\n }\n\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/navigate_to`, 'POST', {\n menuItemId\n });\n};\n\n/**\n * Runs a chain of Espresso web atoms (see https://developer.android.com/training/testing/espresso/web for reference)\n *\n * Takes JSON of the form\n *\n * {\n * \"webviewEl\": \"<ELEMENT_ID>\", // optional webview element to operate on\n * \"forceJavascriptEnabled\": true|false, // if webview disables javascript, webatoms won't work, this forces it\n * \"methodChain\": [\n * {\"name\": \"methodName\", \"atom\": {\"name\": \"atomName\", \"args\": [\"arg1\", \"arg2\", ...]}},\n * ...\n * ]\n * }\n *\n */\ncommands.mobileWebAtoms = async function mobileWebAtoms (opts = {}) {\n opts = assertRequiredOptions(opts, ['methodChain']);\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/web_atoms`, 'POST', opts);\n};\n\ncommands.getDisplayDensity = async function getDisplayDensity () {\n return await this.espresso.jwproxy.command('/appium/device/display_density', 'GET', {});\n};\n\ncommands.mobileScrollToPage = async function mobileScrollToPage (opts = {}) {\n\n // Validate the parameters\n const scrollToTypes = ['first', 'last', 'left', 'right'];\n const res = validate(opts, {\n element: {presence: true},\n scrollTo: {\n inclusion: {\n within: scrollToTypes,\n message: `\"scrollTo\" must be one of \"${scrollToTypes.join(', ')}\" found '%{value}'`,\n }\n },\n scrollToPage: {\n numericality: {\n onlyInteger: true,\n greaterThanOrEqualTo: 0,\n message: `\"scrollToPage\" must be a non-negative integer. Found '%{value}'`\n },\n },\n });\n if (util.hasValue(res)) {\n throw new errors.InvalidArgumentError(`Invalid scrollTo parameters: ${JSON.stringify(res)}`);\n }\n\n const {element, scrollTo, scrollToPage, smoothScroll} = opts;\n\n if (util.hasValue(scrollTo) && util.hasValue(scrollToPage)) {\n this.log.warn(`'scrollTo' and 'scrollToPage' where both provided. Defaulting to 'scrollTo'`);\n }\n\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/scroll_to_page`, 'POST', {\n scrollTo,\n scrollToPage,\n smoothScroll,\n });\n};\n\n\n/**\n * API to invoke methods defined in Android app.\n *\n * Example data\n * {\n * target: 'activity',\n * methods:\n * [\n * {\n * name: \"someMethod\",\n * },\n * {\n * name: \"anotherMethod\",\n * args:\n * [\n * {value: \"Lol\", type: 'java.lang.CharSequence'},\n * {value: 1, type: 'int'}\n * ]\n * }\n * ]\n * }\n *\n * In above example, method \"someMethod\" will be invoked on 'activity'. On the result, \"anotherMethod\" will be invoked\n * \"target\" can be either 'activity', 'application' or 'element'\n * If target is set to 'application', methods will be invoked on application class\n * If target is set to 'activity', methods will be invoked on current activity\n * If target is set to 'element', 'elementId' must be specified\n *\n * - Only 'Public' methods can be invoked. ('open' modifire is necessary in Kotlin)\n * - following primitive types are supported: \"int\", \"boolean\", \"byte\", \"short\", \"long\", \"float\", \"char\"\n * - Non-primitive types with fully qualified name \"java.lang.*\" is also supported:\n * Eg. \"java.lang.CharSequence\", \"java.lang.String\", \"java.lang.Integer\", \"java.lang.Float\",\n * \"java.lang.Double\", \"java.lang.Boolean\", \"java.lang.Long\", \"java.lang.Short\",\n * \"java.lang.Character\" etc...\n *\n *\n * @throws {Error} if target is not 'activity' or 'application'\n * @throws {Error} if a method is not found with given argument types\n *\n * @return {*} the result of the last method in the invocation chain. If method return type is void, then \"<VOID>\" will be returned\n *\n */\ncommands.mobileBackdoor = async function mobileBackdoor (opts = {}) {\n assertRequiredOptions(opts, ['target', 'methods']);\n const {target, methods} = opts;\n if (target === 'element') {\n assertRequiredOptions(opts, ['elementId']);\n }\n const {elementId: targetElement} = opts;\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/backdoor`, 'POST', {target, methods, targetElement});\n};\n\n/**\n * Execute UiAutomator2 commands to drive out of app areas.\n * strategy can be one of: \"clazz\", \"res\", \"text\", \"textContains\", \"textEndsWith\", \"textStartsWith\",\n * \"desc\", \"descContains\", \"descEndsWith\", \"descStartsWith\", \"pkg\"\n *\n * action can be one of: \"click\", \"longClick\", \"getText\", \"getContentDescription\", \"getClassName\",\n * \"getResourceName\", \"getVisibleBounds\", \"getVisibleCenter\", \"getApplicationPackage\",\n * \"getChildCount\", \"clear\", \"isCheckable\", \"isChecked\", \"isClickable\", \"isEnabled\",\n * \"isFocusable\", \"isFocused\", \"isLongClickable\", \"isScrollable\", \"isSelected\"\n */\ncommands.mobileUiautomator = async function mobileUiautomator (opts = {}) {\n const {strategy, locator, action, index} = assertRequiredOptions(opts, ['strategy', 'locator', 'action']);\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/uiautomator`, 'POST', {strategy, locator, index, action});\n};\n\n/**\n * Execute UiAutomator2 command to return the UI dump when AUT is in background.\n * @throws {Error} if uiautomator view dump is unsuccessful\n * @returns {string} uiautomator DOM xml as string\n */\ncommands.mobileUiautomatorPageSource = async function mobileUiautomatorPageSource () {\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/uiautomator_page_source`, 'GET');\n};\n\n/**\n * Flash the element with given id.\n * durationMillis and repeatCount are optional\n *\n */\ncommands.mobileFlashElement = async function mobileFlashElement (opts = {}) {\n const {element} = assertRequiredOptions(opts, ['element']);\n const {durationMillis, repeatCount} = opts;\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/flash`, 'POST', {\n durationMillis,\n repeatCount\n });\n};\n\n/**\n * Perform a 'GeneralClickAction' (https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction)\n */\ncommands.mobileClickAction = async function mobileClickAction (opts = {}) {\n const {element, tapper, coordinatesProvider, precisionDescriber,\n inputDevice, buttonState} = assertRequiredOptions(opts, ['element']);\n return await this.espresso.jwproxy.command(`/appium/execute_mobile/${util.unwrapElement(element)}/click_action`, 'POST', {\n tapper, coordinatesProvider, precisionDescriber, inputDevice, buttonState\n });\n};\n\ncommands.updateSettings = async function updateSettings (settings) {\n return await this.espresso.jwproxy.command(`/appium/settings`, 'POST', { settings });\n};\n\ncommands.getSettings = async function getSettings () {\n return await this.espresso.jwproxy.command(`/appium/settings`, 'GET');\n};\n\n// Stop proxying to any Chromedriver and redirect to Espresso\nhelpers.suspendChromedriverProxy = function suspendChromedriverProxy () {\n this.chromedriver = null;\n this.proxyReqRes = this.espresso.proxyReqRes.bind(this.espresso);\n this.proxyCommand = this.espresso.proxyCommand.bind(this.espresso);\n this.jwpProxyActive = true;\n};\n\n/**\n * Starts the given activity with intent options, activity options and locale.\n * Activity could only be executed in scope of the current app package.\n *\n * appActivity is mandatory\n *\n * locale, optionalIntentArguments, optionalActivityArguments are optional\n */\ncommands.mobileStartActivity = async function mobileStartActivity (opts = {}) {\n const appPackage = this.caps.appPackage;\n const {\n appActivity,\n locale,\n optionalIntentArguments,\n optionalActivityArguments\n } = assertRequiredOptions(opts, ['appActivity']);\n return await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {\n appPackage,\n appActivity,\n locale,\n optionalIntentArguments,\n optionalActivityArguments\n });\n};\n\ncommands.startActivity = async function startActivity (appPackage, appActivity,\n appWaitPackage, appWaitActivity) {\n // intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset\n // parameters are not supported by Espresso\n appPackage = appPackage || this.caps.appPackage;\n appWaitPackage = appWaitPackage || appPackage;\n appActivity = qualifyActivityName(appActivity, appPackage);\n appWaitActivity = qualifyActivityName(appWaitActivity || appActivity, appWaitPackage);\n this.log.debug(`Starting activity '${appActivity}' for package '${appPackage}'`);\n await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {\n appPackage,\n appActivity,\n });\n await this.adb.waitForActivity(appWaitPackage, appWaitActivity);\n};\n\ncommands.mobileDismissAutofill = async function mobileDismissAutofill (opts = {}) {\n const {element} = assertRequiredOptions(opts, ['element']);\n await this.espresso.jwproxy.command(\n `/session/:sessionId/appium/execute_mobile/${util.unwrapElement(element)}/dismiss_autofill`, 'POST', {});\n};\n\nObject.assign(extensions, commands, helpers);\nexport { commands, helpers };\nexport default extensions;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA,MAAMA,QAAQ,GAAG,EAAjB;AAAA,MAAqBC,OAAO,GAAG,EAA/B;AAAA,MAAmCC,UAAU,GAAG,EAAhD;;;;AAEA,SAASC,qBAAT,CAAgCC,OAAhC,EAAyCC,mBAAzC,EAA8D;EAC5D,IAAI,CAACC,eAAA,CAAEC,OAAF,CAAUF,mBAAV,CAAL,EAAqC;IACnCA,mBAAmB,GAAG,CAACA,mBAAD,CAAtB;EACD;;EACD,MAAMG,kBAAkB,GAAGF,eAAA,CAAEG,IAAF,CAAOL,OAAP,CAA3B;;EACA,MAAMM,kBAAkB,GAAGJ,eAAA,CAAEK,UAAF,CAAaN,mBAAb,EAAkCG,kBAAlC,CAA3B;;EACA,IAAIF,eAAA,CAAEM,OAAF,CAAUF,kBAAV,CAAJ,EAAmC;IACjC,OAAON,OAAP;EACD;;EACD,MAAM,IAAIS,KAAJ,CAAW,uCAAsCC,IAAI,CAACC,SAAL,CAAeL,kBAAf,CAAmC,IAA1E,GACb,2BAA0BI,IAAI,CAACC,SAAL,CAAeP,kBAAf,CAAmC,EAD1D,CAAN;AAED;;AAGDR,QAAQ,CAACgB,SAAT,GAAqB,eAAeA,SAAf,GAA4B;EAC/C,MAAM,IAAIC,cAAA,CAAOC,yBAAX,CAAqC,2EAArC,CAAN;AACD,CAFD;;AAKAlB,QAAQ,CAACmB,QAAT,G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CAAsC3F,IAAI,GAAG,EAA7C,EAAiD;EAChF,MAAM;IAACI;EAAD,IAAY7B,qBAAqB,CAACyB,IAAD,EAAO,CAAC,SAAD,CAAP,CAAvC;EACA,MAAM,KAAKJ,QAAL,CAAcC,OAAd,CAAsBC,OAAtB,CACH,6CAA4CW,aAAA,CAAKC,aAAL,CAAmBN,OAAnB,CAA4B,mBADrE,EACyF,MADzF,EACiG,EADjG,CAAN;AAED,CAJD;;AAMAwF,MAAM,CAACC,MAAP,CAAcvH,UAAd,EAA0BF,QAA1B,EAAoCC,OAApC;eAEeC,U"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idling-resources.js","names":["commands","mobileRegisterIdlingResources","opts","espresso","jwproxy","command","requireOptions","mobileUnregisterIdlingResources","mobileListIdlingResources"],"sources":["../../../lib/commands/idling-resources.js"],"sourcesContent":["import { requireOptions } from '../utils';\n\nconst commands = {};\n\n/**\n * @typedef {Object} IdlingResourcesOptions\n * @property {!string} classNames - The comma-separated list of idling resources class names.\n * Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.\n * Each class in the app source must implement a singleton pattern and have a static `getInstance()`\n * method returning the class instance, which implements `androidx.test.espresso.IdlingResource`\n * interface. Read\n * - https://developer.android.com/training/testing/espresso/idling-resource\n * - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057\n * for more details on how to design and use idling resources concept in Espresso.\n */\n\n/**\n * Registers one or more idling resources\n *\n * @param {IdlingResourcesOptions} opts\n * @throws {Error} If there was a failure while parsing options or registering\n * the actual instances\n */\ncommands.mobileRegisterIdlingResources = async function mobileRegisterIdlingResources (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/register_idling_resources', 'POST',\n requireOptions(opts, ['classNames']));\n};\n\n/**\n * Unregisters one or more idling resources\n *\n * @param {IdlingResourcesOptions} opts\n * @throws {Error} If there was a failure while parsing options or unregistering\n * the actual instances\n */\ncommands.mobileUnregisterIdlingResources = async function mobileUnregisterIdlingResources (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/unregister_idling_resources', 'POST',\n requireOptions(opts, ['classNames']));\n};\n\n/**\n * Returns a list of currently registered idling resources\n * or an empty list if no resources have been registered yet.\n *\n * @returns {Array<string>} The list of fully qualified class names\n */\ncommands.mobileListIdlingResources = async function mobileListIdlingResources () {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/list_idling_resources', 'GET');\n};\n\nexport { commands };\nexport default commands;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,MAAMA,QAAQ,GAAG,EAAjB;;;AAqBAA,QAAQ,CAACC,6BAAT,GAAyC,eAAeA,6BAAf,CAA8CC,IAAI,GAAG,EAArD,EAAyD;EAChG,OAAO,MAAM,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,OAAtB,CAA8B,kDAA9B,EAAkF,MAAlF,EACX,IAAAC,qBAAA,EAAeJ,IAAf,EAAqB,CAAC,YAAD,CAArB,CADW,CAAb;AAED,CAHD;;AAYAF,QAAQ,CAACO,+BAAT,GAA2C,eAAeA,+BAAf,CAAgDL,IAAI,GAAG,EAAvD,EAA2D;EACpG,OAAO,MAAM,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,OAAtB,CAA8B,oDAA9B,EAAoF,MAApF,EACX,IAAAC,qBAAA,EAAeJ,IAAf,EAAqB,CAAC,YAAD,CAArB,CADW,CAAb;AAED,CAHD;;AAWAF,QAAQ,CAACQ,yBAAT,GAAqC,eAAeA,yBAAf,GAA4C;EAC/E,OAAO,MAAM,KAAKL,QAAL,CAAcC,OAAd,CAAsBC,OAAtB,CAA8B,8CAA9B,EAA8E,KAA9E,CAAb;AACD,CAFD;;eAKeL,Q"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["commands","Object","assign","generalCmds","executeCmds","servicesCmds","idlingResourcesCmds"],"sources":["../../../lib/commands/index.js"],"sourcesContent":["import executeCmds from './execute';\nimport generalCmds from './general';\nimport servicesCmds from './services';\nimport idlingResourcesCmds from './idling-resources';\n\nconst commands = {};\nObject.assign(\n commands,\n generalCmds,\n executeCmds,\n servicesCmds,\n idlingResourcesCmds,\n // add other command types here\n);\n\nexport default commands;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA,MAAMA,QAAQ,GAAG,EAAjB;AACAC,MAAM,CAACC,MAAP,CACEF,QADF,EAEEG,gBAFF,EAGEC,gBAHF,EAIEC,iBAJF,EAKEC,wBALF;eASeN,Q"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.js","names":["commands","mobileStartService","opts","espresso","jwproxy","command","requireOptions","mobileStopService"],"sources":["../../../lib/commands/services.js"],"sourcesContent":["import { requireOptions } from '../utils';\n\nconst commands = {};\n\n\n/**\n * @typedef {Object} StartServiceOptions\n * @property {!string} intent - The name of the service intent to start, for example\n * `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.\n * !!! Only services in the app's under test scope could be started.\n * @property {boolean} foreground [false] - Set it to `true` if your service must be\n * started as foreground service.\n */\n\n/**\n * Starts the given service intent.\n *\n * @param {StartServiceOptions} opts\n * @returns {string} The full component name\n * @throws {Error} If there was a failure while starting the service\n * or required options are missing\n */\ncommands.mobileStartService = async function mobileStartService (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/start_service', 'POST',\n requireOptions(opts, ['intent']));\n};\n\n/**\n * @typedef {Object} StopServiceOptions\n * @property {!string} intent - The name of the service intent to stop, for example\n * `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.\n * !!! Only services in the app's under test scope could be stopped.\n */\n\n/**\n * Stops the given service intent.\n *\n * @param {StopServiceOptions} opts\n * @returns {string} `true` if the service has been successfully stopped\n * @throws {Error} If there was a failure while stopping the service\n * or required options are missing\n */\ncommands.mobileStopService = async function mobileStopService (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/stop_service', 'POST',\n requireOptions(opts, ['intent']));\n};\n\n\nexport { commands };\nexport default commands;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,MAAMA,QAAQ,GAAG,EAAjB;;;AAoBAA,QAAQ,CAACC,kBAAT,GAA8B,eAAeA,kBAAf,CAAmCC,IAAI,GAAG,EAA1C,EAA8C;EAC1E,OAAO,MAAM,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,OAAtB,CAA8B,sCAA9B,EAAsE,MAAtE,EACX,IAAAC,qBAAA,EAAeJ,IAAf,EAAqB,CAAC,QAAD,CAArB,CADW,CAAb;AAED,CAHD;;AAoBAF,QAAQ,CAACO,iBAAT,GAA6B,eAAeA,iBAAf,CAAkCL,IAAI,GAAG,EAAzC,EAA6C;EACxE,OAAO,MAAM,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,OAAtB,CAA8B,qCAA9B,EAAqE,MAArE,EACX,IAAAC,qBAAA,EAAeJ,IAAf,EAAqB,CAAC,QAAD,CAArB,CADW,CAAb;AAED,CAHD;;eAOeF,Q"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desired-caps.js","names":["espressoCapConstraints","app","isString","automationName","systemPort","isNumber","browserName","launchTimeout","skipUnlock","isBoolean","forceEspressoRebuild","espressoServerLaunchTimeout","espressoBuildConfig","showGradleLog","skipServerInstallation","intentOptions","isObject","disableSuppressAccessibilityService","activityOptions","appLocale","desiredCapConstraints","Object","assign","commonCapConstraints"],"sources":["../../lib/desired-caps.js"],"sourcesContent":["import { commonCapConstraints } from 'appium-android-driver';\n\nlet espressoCapConstraints = {\n app: {\n isString: true,\n },\n automationName: {\n isString: true,\n },\n systemPort: {\n isNumber: true\n },\n browserName: {\n isString: true\n },\n launchTimeout: {\n isNumber: true\n },\n skipUnlock: {\n isBoolean: true\n },\n forceEspressoRebuild: {\n isBoolean: true\n },\n espressoServerLaunchTimeout: {\n isNumber: true\n },\n espressoBuildConfig: {\n isString: true\n },\n showGradleLog: {\n isBoolean: true\n },\n skipServerInstallation: {\n isBoolean: true\n },\n intentOptions: {\n isObject: true\n },\n disableSuppressAccessibilityService: {\n isBoolean: true\n },\n activityOptions: {\n isObject: true\n },\n appLocale: {\n isObject: true,\n }\n};\n\nlet desiredCapConstraints = {};\nObject.assign(desiredCapConstraints, espressoCapConstraints,\n commonCapConstraints);\n\nexport default desiredCapConstraints;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,IAAIA,sBAAsB,GAAG;EAC3BC,GAAG,EAAE;IACHC,QAAQ,EAAE;EADP,CADsB;EAI3BC,cAAc,EAAE;IACdD,QAAQ,EAAE;EADI,CAJW;EAO3BE,UAAU,EAAE;IACVC,QAAQ,EAAE;EADA,CAPe;EAU3BC,WAAW,EAAE;IACXJ,QAAQ,EAAE;EADC,CAVc;EAa3BK,aAAa,EAAE;IACbF,QAAQ,EAAE;EADG,CAbY;EAgB3BG,UAAU,EAAE;IACVC,SAAS,EAAE;EADD,CAhBe;EAmB3BC,oBAAoB,EAAE;IACpBD,SAAS,EAAE;EADS,CAnBK;EAsB3BE,2BAA2B,EAAE;IAC3BN,QAAQ,EAAE;EADiB,CAtBF;EAyB3BO,mBAAmB,EAAE;IACnBV,QAAQ,EAAE;EADS,CAzBM;EA4B3BW,aAAa,EAAE;IACbJ,SAAS,EAAE;EADE,CA5BY;EA+B3BK,sBAAsB,EAAE;IACtBL,SAAS,EAAE;EADW,CA/BG;EAkC3BM,aAAa,EAAE;IACbC,QAAQ,EAAE;EADG,CAlCY;EAqC3BC,mCAAmC,EAAE;IACnCR,SAAS,EAAE;EADwB,CArCV;EAwC3BS,eAAe,EAAE;IACfF,QAAQ,EAAE;EADK,CAxCU;EA2C3BG,SAAS,EAAE;IACTH,QAAQ,EAAE;EADD;AA3CgB,CAA7B;AAgDA,IAAII,qBAAqB,GAAG,EAA5B;AACAC,MAAM,CAACC,MAAP,CAAcF,qBAAd,EAAqCpB,sBAArC,EACcuB,yCADd;eAGeH,qB"}
|