mirror of
https://github.com/appium/appium.git
synced 2026-10-31 22:32:24 +08:00
Compare commits
121
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6344d14665 | ||
|
|
2c2141c8c3 | ||
|
|
9d8d43c89a | ||
|
|
9ad20ff1c2 | ||
|
|
de7e10187c | ||
|
|
77d2ef74bb | ||
|
|
2350c4cd2a | ||
|
|
77a27ab16c | ||
|
|
8cf3efdbed | ||
|
|
80542b1046 | ||
|
|
270fd42a20 | ||
|
|
2205d1d41e | ||
|
|
6738e3d9ee | ||
|
|
732cc586c2 | ||
|
|
407706cf5e | ||
|
|
72f32848b6 | ||
|
|
572037a0e2 | ||
|
|
d7cf013401 | ||
|
|
eb5ec8940a | ||
|
|
9f655f6f85 | ||
|
|
38ef95fe09 | ||
|
|
4d48010a30 | ||
|
|
b4b20e05fd | ||
|
|
5be7f5d319 | ||
|
|
d44e66977c | ||
|
|
1f368828e6 | ||
|
|
b8368bb666 | ||
|
|
d55f13b2ed | ||
|
|
5899c2db93 | ||
|
|
1be08eca81 | ||
|
|
d5af68ecdd | ||
|
|
59ef09d955 | ||
|
|
ee8425a001 | ||
|
|
3936cb43dc | ||
|
|
f88bd3cb88 | ||
|
|
665219b7e0 | ||
|
|
b8f2dd8508 | ||
|
|
b139a2d313 | ||
|
|
26ab0ef759 | ||
|
|
85d06086dd | ||
|
|
a6d49c1ac8 | ||
|
|
dde504d501 | ||
|
|
9a0c059c3a | ||
|
|
c928a75f4a | ||
|
|
b4369473ee | ||
|
|
66626d26e5 | ||
|
|
7cb1621e80 | ||
|
|
03f8dc9b18 | ||
|
|
63d7550d02 | ||
|
|
a74132cc96 | ||
|
|
5f9aa955f1 | ||
|
|
de057fa8b0 | ||
|
|
cf792279b1 | ||
|
|
2687fa47a0 | ||
|
|
984e54a7ae | ||
|
|
cf17ec7a80 | ||
|
|
17e0dc03f4 | ||
|
|
caa4e586b1 | ||
|
|
7fc7446612 | ||
|
|
111b05c922 | ||
|
|
bd6ab81c94 | ||
|
|
3ce4f96e0b | ||
|
|
471e95504c | ||
|
|
47765747b6 | ||
|
|
2448fa0145 | ||
|
|
e7df8823e8 | ||
|
|
b126df6234 | ||
|
|
0e6c3eede2 | ||
|
|
3da17b6ecd | ||
|
|
636d6b3802 | ||
|
|
97c8ab5384 | ||
|
|
79378e4c20 | ||
|
|
df07665509 | ||
|
|
68456b8aea | ||
|
|
8529e360be | ||
|
|
91bb539420 | ||
|
|
3f6c61a084 | ||
|
|
82b024c77e | ||
|
|
7f7939dc62 | ||
|
|
8eb4e888f6 | ||
|
|
7516d4135a | ||
|
|
c4ef218006 | ||
|
|
917084ccca | ||
|
|
c905be032f | ||
|
|
e1ccdd2d48 | ||
|
|
dcf58168d6 | ||
|
|
7bee9ccc89 | ||
|
|
e4ae2772ac | ||
|
|
ef673786f4 | ||
|
|
98017937f7 | ||
|
|
26ded7a4cc | ||
|
|
d1705e2818 | ||
|
|
32677efe87 | ||
|
|
1fd29c7012 | ||
|
|
0d5a0a5727 | ||
|
|
f59e84e24c | ||
|
|
39cb9069a6 | ||
|
|
e808f14bf6 | ||
|
|
f837a6a9ea | ||
|
|
1c6b3216ab | ||
|
|
d49289b0ae | ||
|
|
7a23f11aab | ||
|
|
f4055bced2 | ||
|
|
ed8a91e721 | ||
|
|
f890d15de9 | ||
|
|
e04e4e902a | ||
|
|
b25e0fd576 | ||
|
|
6c034aa84a | ||
|
|
e21785a5e4 | ||
|
|
bd7b42007d | ||
|
|
28f0926bf8 | ||
|
|
d722ecc292 | ||
|
|
670a77b021 | ||
|
|
0755246be7 | ||
|
|
41cb869453 | ||
|
|
ea8c74b372 | ||
|
|
50d6181187 | ||
|
|
a059b12cb4 | ||
|
|
d25a0fca9b | ||
|
|
0db8dc7790 | ||
|
|
f92640a824 |
Generated
+1592
-1070
File diff suppressed because it is too large
Load Diff
+15
-15
@@ -81,44 +81,44 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@colors/colors": "1.6.0",
|
||||
"@tsconfig/node14": "14.1.0",
|
||||
"@types/chai": "4.3.11",
|
||||
"@tsconfig/node14": "14.1.2",
|
||||
"@types/chai": "4.3.14",
|
||||
"@types/chai-as-promised": "7.1.8",
|
||||
"@types/diff": "5.0.9",
|
||||
"@types/diff": "5.2.0",
|
||||
"@types/mocha": "10.0.6",
|
||||
"@types/node": "20.11.17",
|
||||
"@types/semver": "7.5.7",
|
||||
"@types/node": "20.12.7",
|
||||
"@types/semver": "7.5.8",
|
||||
"@types/sinon": "17.0.3",
|
||||
"@types/sinon-chai": "3.2.12",
|
||||
"@types/source-map-support": "0.5.10",
|
||||
"@types/teen_process": "2.0.4",
|
||||
"@types/ws": "8.5.10",
|
||||
"@types/yargs": "17.0.32",
|
||||
"@typescript-eslint/eslint-plugin": "6.21.0",
|
||||
"@typescript-eslint/parser": "6.21.0",
|
||||
"@typescript-eslint/eslint-plugin": "7.7.0",
|
||||
"@typescript-eslint/parser": "7.7.0",
|
||||
"asyncbox": "3.0.0",
|
||||
"chai": "4.4.1",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-webdriverio-async": "2.8.0",
|
||||
"chai-webdriverio-async": "3.0.0",
|
||||
"conventional-changelog-conventionalcommits": "7.0.2",
|
||||
"cpy-cli": "5.0.0",
|
||||
"eslint": "8.56.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-find-rules": "4.1.0",
|
||||
"eslint-import-resolver-typescript": "3.6.1",
|
||||
"eslint-plugin-import": "2.29.1",
|
||||
"eslint-plugin-mocha": "10.2.0",
|
||||
"eslint-plugin-mocha": "10.4.3",
|
||||
"eslint-plugin-promise": "6.1.1",
|
||||
"fancy-log": "2.0.0",
|
||||
"finalhandler": "1.2.0",
|
||||
"get-port": "5.1.1",
|
||||
"json-schema-to-typescript": "13.1.2",
|
||||
"json-schema-to-typescript": "14.0.0",
|
||||
"lerna": "8.1.2",
|
||||
"log-symbols": "4.1.0",
|
||||
"midnight-smoker": "8.0.0",
|
||||
"mjpeg-consumer": "2.0.0",
|
||||
"mjpeg-server": "0.3.1",
|
||||
"mocha": "10.3.0",
|
||||
"mocha": "10.4.0",
|
||||
"mocha-chai-jest-snapshot": "1.1.4",
|
||||
"npm-run-all2": "6.1.2",
|
||||
"prettier": "3.2.5",
|
||||
@@ -130,10 +130,10 @@
|
||||
"sync-monorepo-packages": "1.0.2",
|
||||
"through2": "4.0.2",
|
||||
"ts-node": "10.9.2",
|
||||
"tsd": "0.30.4",
|
||||
"typescript": "5.2.2",
|
||||
"tsd": "0.31.0",
|
||||
"typescript": "5.4.5",
|
||||
"validate.js": "0.13.1",
|
||||
"webdriverio": "8.31.1",
|
||||
"webdriverio": "8.36.1",
|
||||
"ws": "8.16.0",
|
||||
"yaml-js": "0.3.1"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,53 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.5.4](https://github.com/appium/appium/compare/appium@2.5.3...appium@2.5.4) (2024-04-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.36.1 ([9ad20ff](https://github.com/appium/appium/commit/9ad20ff1c266923f3efe50bfe2ae4b1ab8ecb20a))
|
||||
|
||||
|
||||
|
||||
## [2.5.3](https://github.com/appium/appium/compare/appium@2.5.2...appium@2.5.3) (2024-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.36.0 ([#19998](https://github.com/appium/appium/issues/19998)) ([72f3284](https://github.com/appium/appium/commit/72f32848b68e6ef8c047f700ffd0be7d68c49aba))
|
||||
|
||||
|
||||
|
||||
## [2.5.2](https://github.com/appium/appium/compare/appium@2.5.1...appium@2.5.2) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** make --log-filters work ([#19825](https://github.com/appium/appium/issues/19825)) ([0d5a0a5](https://github.com/appium/appium/commit/0d5a0a572787d913412bbfd70835e5ba8f94334c))
|
||||
* **appium:** update definitelytyped ([2687fa4](https://github.com/appium/appium/commit/2687fa47a0c2f11983e5ccb2ee17eaae9279469d))
|
||||
* **appium:** update definitelytyped ([68456b8](https://github.com/appium/appium/commit/68456b8aea3c6ae7225814748fb36d9d4117cc9f))
|
||||
* **appium:** update dependency ajv-formats to v3 ([#19957](https://github.com/appium/appium/issues/19957)) ([59ef09d](https://github.com/appium/appium/commit/59ef09d9558f1a6a9f4ee3d81d4cb0b7218706b4))
|
||||
* **appium:** update dependency winston to v3.12.0 ([8eb4e88](https://github.com/appium/appium/commit/8eb4e888f624acfc1d42977eeda2d4c1ae139efc))
|
||||
* **appium:** update dependency winston to v3.13.0 ([03f8dc9](https://github.com/appium/appium/commit/03f8dc9b18f226975f025ceda7e1d907de8b45d5))
|
||||
* **docutils:** update dependency lilconfig to v3.1.0 ([f92640a](https://github.com/appium/appium/commit/f92640a824644545b680e23c7f3ec7f51de9df98))
|
||||
* **docutils:** update dependency lilconfig to v3.1.1 ([e04e4e9](https://github.com/appium/appium/commit/e04e4e902a212cf17ca79b3edc0b7545a1af507b))
|
||||
* **docutils:** update dependency typescript to v5.4.2 ([#19876](https://github.com/appium/appium/issues/19876)) ([2448fa0](https://github.com/appium/appium/commit/2448fa0145620657ccc72b5637f1b7737fe52580))
|
||||
* **docutils:** update dependency yaml to v2.4.0 ([26ded7a](https://github.com/appium/appium/commit/26ded7a4cce1fa9bca28521e4b60cad0edacbe96))
|
||||
* **docutils:** update dependency yaml to v2.4.1 ([636d6b3](https://github.com/appium/appium/commit/636d6b3802268ec6532f9f3a958f304c6760d172))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.0 ([d25a0fc](https://github.com/appium/appium/commit/d25a0fca9b3a94880525fd956068f59427a40b26))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.1 ([ea8c74b](https://github.com/appium/appium/commit/ea8c74b372e73e88cf0303aa17db943014416e64))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.2 ([#19807](https://github.com/appium/appium/issues/19807)) ([6c034aa](https://github.com/appium/appium/commit/6c034aa84af573d36fa934c71d3d4ff328772553))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.3 ([f837a6a](https://github.com/appium/appium/commit/f837a6a9eaf34914ffdbfddcc3cb2f7e7427bc63))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.4 ([7516d41](https://github.com/appium/appium/commit/7516d4135a1eec37ba298f407254d825961795af))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.33.1 ([#19877](https://github.com/appium/appium/issues/19877)) ([0e6c3ee](https://github.com/appium/appium/commit/0e6c3eede250193fad390387ec494918367176d9))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.34.1 ([7fc7446](https://github.com/appium/appium/commit/7fc7446612f3257fa421dfec006d02730df10f59))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.35.1 ([63d7550](https://github.com/appium/appium/commit/63d7550d02f049a5c3bea5d27e7e8385d7698a4f))
|
||||
* **support:** update dependency @types/semver to v7.5.8 ([d1705e2](https://github.com/appium/appium/commit/d1705e2818d435b4c37cb70753af1de5427378e2))
|
||||
* **support:** update dependency axios to v1.6.8 ([bd6ab81](https://github.com/appium/appium/commit/bd6ab81c9408ab0f90fc25fc112f9257ec2973ad))
|
||||
|
||||
|
||||
|
||||
## [2.5.1](https://github.com/appium/appium/compare/appium@2.5.0...appium@2.5.1) (2024-02-13)
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ theme:
|
||||
favicon: assets/images/appium-logo.png
|
||||
|
||||
plugins:
|
||||
blog:
|
||||
enabled: true
|
||||
post_excerpt: required
|
||||
redirects:
|
||||
redirect_maps:
|
||||
'intro/requirements.md': 'quickstart/requirements.md'
|
||||
@@ -34,7 +37,7 @@ extra:
|
||||
link: https://twitter.com/AppiumDevs
|
||||
alternate:
|
||||
- name: English
|
||||
link: /docs/en/
|
||||
link: /docs/en/
|
||||
lang: en
|
||||
- name: 日本
|
||||
link: /docs/ja/
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
authors:
|
||||
jlipps:
|
||||
name: "Jonathan Lipps"
|
||||
description: "Appium project lead. Learn more about Jonathan at https://jlipps.com"
|
||||
avatar: "https://gravatar.com/avatar/fdaadd825d92709bcf7fe76dffa12c40681c6108c67bcddf19478b2d00e3794b.jpg"
|
||||
slug: "jlipps"
|
||||
url: "https://jlipps.com"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Appium Blog
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
authors:
|
||||
- jlipps
|
||||
date: 2024-03-07
|
||||
---
|
||||
|
||||
# Hello World!
|
||||
|
||||
This is the first post in the Appium blog. There's not much to see here yet. We're creating this
|
||||
space so we can make announcements or post other news, or information about events, that don't
|
||||
really fit inside the documentation itself.
|
||||
|
||||
<!-- more -->
|
||||
|
||||
Stay tuned for more!
|
||||
@@ -217,6 +217,10 @@ A possibly empty list of elements inside the shadow root matching the selector
|
||||
|
||||
Get the log for a given log type.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use the `/session/:sessionId/se/log` endpoint instead
|
||||
|
||||
<!-- comment source: method-signature -->
|
||||
|
||||
#### Parameters
|
||||
@@ -273,6 +277,10 @@ The event history for the session
|
||||
|
||||
Get available log types as a list of strings
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use the `/session/:sessionId/se/log/types` endpoint instead
|
||||
|
||||
<!-- comment source: method-signature -->
|
||||
|
||||
#### Response
|
||||
@@ -319,9 +327,22 @@ Get data for all sessions running on an Appium server
|
||||
|
||||
#### Response
|
||||
|
||||
`MultiSessionData`<`C`\>[]
|
||||
A list of session data objects.
|
||||
Each session data object will be returned with `id` and the session's capabilities as `capabilities` keys like an example below:
|
||||
|
||||
A list of session data objects
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id":"ba30c6da-c266-4734-8ddb-c16f5bb53e16",
|
||||
"capabilities":{ "platformName":"ios","browserName":"safari","automationName":"xcuitest","platformVersion":"17.2","deviceName":"iPhone 15" }
|
||||
},
|
||||
{
|
||||
"id":"1441110c-1ece-4e45-abbf-ebf404f45f0a",
|
||||
"capabilities":{ "platformName":"ios","browserName":"safari","automationName":"xcuitest","platformVersion":"17.0","deviceName":"iPhone 14" }
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
### `getSettings`
|
||||
|
||||
@@ -465,7 +486,9 @@ Set the various timeouts associated with a session
|
||||
|
||||
Set the implicit wait timeout
|
||||
|
||||
**`Deprecated`**
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use the `/session/:sessionId/timeouts` endpoint instead
|
||||
|
||||
Use `timeouts` instead
|
||||
|
||||
@@ -506,7 +529,9 @@ Add a custom-named event to the Appium event log
|
||||
|
||||
Reset the current session (run the delete session and create session subroutines)
|
||||
|
||||
**`Deprecated`**
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use each driver's launch, activate, terminate or cleanup method.
|
||||
|
||||
Use explicit session management commands instead
|
||||
|
||||
|
||||
@@ -58,20 +58,20 @@ work with certain versions of Appium). For Appium 2, for example, this would loo
|
||||
Your `package.json` must contain an `appium` field, like this (we call this the 'Appium extension
|
||||
metadata'):
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"appium": {
|
||||
"driverName": "fake",
|
||||
"automationName": "Fake",
|
||||
"platformNames": [
|
||||
"Fake"
|
||||
],
|
||||
"mainClass": "FakeDriver"
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"appium": {
|
||||
"driverName": "fake",
|
||||
"automationName": "Fake",
|
||||
"platformNames": [
|
||||
"Fake"
|
||||
],
|
||||
"mainClass": "FakeDriver"
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
The required subfields are:
|
||||
|
||||
@@ -130,12 +130,12 @@ like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"devDependencies": {
|
||||
...,
|
||||
"appium": "^2.0.0",
|
||||
"your-driver": "file:.",
|
||||
...
|
||||
}
|
||||
"devDependencies": {
|
||||
...,
|
||||
"appium": "^2.0.0",
|
||||
"your-driver": "file:.",
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: Local Validation Of Extension PRs
|
||||
---
|
||||
|
||||
Sometimes it might be necessary to validate if a remote driver or a plugin PR works for the particular local
|
||||
environment before it is merged or published. This tutorial describes how to achieve that.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Recent LTS version of NodeJS. Check [Node.js main page](https://nodejs.org) for the download link.
|
||||
- Recent version of the Appium server. Use the following commands to ensure you have
|
||||
the latest version installed: `npm uninstall appium` and `npm install -g appium`.
|
||||
- [Git](https://git-scm.com/) should be available locally.
|
||||
|
||||
## Installation
|
||||
|
||||
- [Check out]((https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally)) the PR locally.
|
||||
There is also an option (although it is less flexible, because you won't be able to easily fetch
|
||||
any changes to this PR later) to simply [download](https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives) and unzip the sources
|
||||
locally. If you choose the later option then no `git` tool would be necessary.
|
||||
- Navigate to the local driver or plugin folder and run `npm i` from that folder.
|
||||
- Make sure you don't have the given driver or plugin already installed. Use the `appium driver uninstall <driver_name>`
|
||||
or `appium plugin uninstall <plugin_name>` CLI in order to delete any leftovers. The value of
|
||||
`<driver_name>`/`<plugin_name>` depends on the actual driver or plugin name the PR has been prepared for.
|
||||
If you are not sure which name you need to use then check the content of the `package.json` manifest,
|
||||
which must be always located under the root folder of the fetched sources. You should be looking for
|
||||
the `"appium" -> "driverName"` entry value there.
|
||||
- Change the current folder to the one, which is NOT the driver/plugin folder root or its subfolder.
|
||||
Also, make sure your current working folder does not contain any extra `package.json` file. If
|
||||
it does then simply navigate to any other folder that does not.
|
||||
- Run the following command in order to link the driver/plugin sources to the Appium server:
|
||||
`appium driver install --source=local <full_path_to_driver_folder_with_fetched_sources>` or
|
||||
`appium plugin install --source=local <full_path_to_plugin_folder_with_fetched_sources>`.
|
||||
- Stop the Appium server if it is running and start it again (`appium server --use-drivers=<driver_name>`)
|
||||
to check the list of loaded drivers. If the linking succeeded then you must see the driver name and the path to its
|
||||
parent folder in the server logs. In case of a plugin it is required to explicitly request
|
||||
this plugin to be loaded upon server startup: `appium server --use-plugins=<plugin_name>`.
|
||||
|
||||
## Update
|
||||
|
||||
After you have tested the PR and there are issues it might be necessary to update the local branch with
|
||||
the recent changes from Git. Follow the next steps for that:
|
||||
|
||||
- Navigate to the parent folder of your local driver/plugin and run `git pull`.
|
||||
- Stop Appium server if it is running.
|
||||
- Run `npm i` in the parent folder of your local driver/plugin to rebuild it and update any dependencies if necessary.
|
||||
- Start Appium server again similarly to how this is done in the corresponding [Installation](#installation) step above.
|
||||
|
||||
## Switching Back To a Stable Release
|
||||
|
||||
After the PR is merged there is no need to use the local plugin/driver deployment anymore, and it makes sense
|
||||
to switch back to the package managed by NPM. Follow the next steps for that:
|
||||
|
||||
- Unlink the installed driver/plugin from the server by running `appium driver uninstall <driver_name>` or
|
||||
`appium plugin uninstall <driver_name>`.
|
||||
- Delete the local source folder (`rm -rf <full_path_to_plugin_or_driver_folder_with_fetched_sources>`).
|
||||
- Install the driver or the plugin from NPM. Check the component README in order to find a proper command for that.
|
||||
@@ -32,7 +32,7 @@ driver install`.
|
||||
So, from a technical perspective, an Appium driver is just a bit of code that inherits from some
|
||||
other Appium code. That's it! Now, inheriting from `BaseDriver` actually gives us a lot, because
|
||||
`BaseDriver` is essentially an encapsulation of the entire WebDriver protocol. So all a driver
|
||||
needs to do to do something useful is to *implement* Node.js methods with names corresponding to
|
||||
needs to do something useful is to *implement* Node.js methods with names corresponding to
|
||||
their WebDriver protocol equivalents.
|
||||
|
||||
So let's say I wanted to do something with this empty driver; first I have to decide which
|
||||
|
||||
@@ -9,6 +9,7 @@ The basic requirements for the Appium server are:
|
||||
|
||||
* A macOS, Linux, or Windows operating system
|
||||
* [Node.js](https://nodejs.org) version in the [SemVer](https://semver.org) range `^14.17.0 || ^16.13.0 || >=18.0.0`
|
||||
* LTS is recommended
|
||||
* [`npm`](https://npmjs.com) version `>=8` (`npm` is usually bundled with Node.js, but can be upgraded
|
||||
independently)
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Blog
|
||||
|
||||
@@ -8,6 +8,7 @@ theme:
|
||||
language: en
|
||||
nav:
|
||||
- Welcome: index.md
|
||||
- Blog: blog/index.md
|
||||
- Introduction:
|
||||
- intro/index.md
|
||||
- Background:
|
||||
@@ -50,6 +51,7 @@ nav:
|
||||
- guides/migrating-1-to-2.md
|
||||
- Server/Driver Configuration:
|
||||
- guides/managing-exts.md
|
||||
- guides/branch-testing.md
|
||||
- guides/config.md
|
||||
- guides/security.md
|
||||
- guides/log-filters.md
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Blog
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
---
|
||||
title: Write a Test (Java)
|
||||
hide:
|
||||
- toc
|
||||
|
||||
title: 编写一个测试(Java)
|
||||
---
|
||||
|
||||
TODO
|
||||
Appium 团队为 Java 编程语言维护一个官方[客户端](https://github.com/appium/java-client).
|
||||
它是建立在 [Selenium](https://github.com/SeleniumHQ/selenium)上的.
|
||||
您也可以在 Kotlin 项目中使用该客户端.
|
||||
|
||||
遵循[在测试框架中添加 Appium Java 客户端](https://github.com/appium/java-client#add-appium-java-client-to-your-test-framework)
|
||||
教程,以便将该库连接到测试框架源。
|
||||
|
||||
Appium Java 客户端有专门的类来支持大多数官方 Appium 驱动程序。对于其他驱动程序
|
||||
您只需使用 [AppiumDriver](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/AppiumDriver.java)类
|
||||
或在此基础上创建您的自定义衍生工具. 请查看 [驱动支持](https://github.com/appium/java-client#drivers-support)
|
||||
文章,了解有关当前驱动程序类实现的更多信息.
|
||||
|
||||
请参阅 [使用实例](https://github.com/appium/java-client#usage-examples) 一文,以了解
|
||||
如何从测试框架调用 Java 客户端功能。
|
||||
|
||||
成功运行测试后,您可以继续阅读以下内容 [下一步骤](./next-steps.md) 继续探索
|
||||
|
||||
@@ -1,6 +1,73 @@
|
||||
---
|
||||
title: Write a Test (JS)
|
||||
hide:
|
||||
- toc
|
||||
|
||||
title: 编写一个测试 (JS)
|
||||
---
|
||||
|
||||
要在 JavaScript(Node.js)中编写 Appium 测试,我们需要选择一个与 Appium 兼容的客户端
|
||||
库。维护最好的库和 Appium 团队推荐使用的库是
|
||||
[WebdriverIO](https://webdriver.io), 所有就让我们使用它吧。既然我们已经安装了 Appium,我们
|
||||
已经满足了 Node 和 NPM 的要求。因此,只需在计算机上创建一个新的项目目录
|
||||
然后在其中初始化一个新的 Node.js 项目:
|
||||
|
||||
TODO
|
||||
```bash
|
||||
npm init
|
||||
```
|
||||
|
||||
您在提示中输入什么内容并不重要,只要您最终得到一个有效的
|
||||
`package.json`.
|
||||
|
||||
|
||||
现在,通过 NPM 安装 `webdriverio` 软件包:
|
||||
|
||||
```bash
|
||||
npm i --save-dev webdriverio
|
||||
```
|
||||
|
||||
完成上述操作后,您的 `package.json` 文件应包含类似以下内容的部分:
|
||||
|
||||
```json title="package.json"
|
||||
--8<-- "./sample-code/quickstarts/js/package.json"
|
||||
```
|
||||
|
||||
现在是编写测试本身的时候了。创建一个名为 `test.js` 的新文件,内容如下:
|
||||
|
||||
```js title="test.js"
|
||||
--8<-- "./sample-code/quickstarts/js/test.js"
|
||||
```
|
||||
|
||||
!!! 注意
|
||||
|
||||
本指南的范围不包括完整介绍 WebdriverIO 客户端
|
||||
库或这里发生的一切,因此我们暂且不对代码本身进行详细解释。
|
||||
所以目前我们暂时不对代码本身进行详细解释。您可能需要特别阅读 Appium
|
||||
[能力](../guides/caps.md), 除了熟悉优秀的
|
||||
[WebdriverIO 文档](https://webdriver.io/docs/gettingstarted) 来获得更全面的解释,
|
||||
你还可以看到的各种 API 命令以及用途。
|
||||
|
||||
!!! 注意
|
||||
|
||||
示例代码可从 [GitHub Appium repository](https://github.com/appium/appium/tree/master/packages/appium/sample-code/quickstarts/js).
|
||||
|
||||
|
||||
基本上,这段代码正在执行以下操作:
|
||||
|
||||
1. 定义一组 "Capabilities" 能力值(参数),以便 Appium 知道您想自动执行哪种任务。
|
||||
要自动执行的任务。
|
||||
1. 在内置的 Android 设置应用程序上启动 Appium 会话。
|
||||
1. 找到 "Battery"列表项并点击它。
|
||||
1. 停顿片刻,纯粹是为了观察自动化视觉效果。
|
||||
1. 结束 Appium 会话。
|
||||
|
||||
就是这样!让我们试一试吧。运行测试前,请确保您的 Appium 服务器
|
||||
在另一个终端会话中运行,否则会出现一个有关无法连接到 Appium 服务器的错误。
|
||||
然后,你就可以执行脚本了:
|
||||
|
||||
```bash
|
||||
node test.js
|
||||
```
|
||||
|
||||
如果一切顺利,在应用再次关闭之前,你会看到 "设置 "应用打开并导航到 "Battery "视图
|
||||
|
||||
恭喜您,您已经开始了 Appium 之旅!请继续阅读一些 [下一步骤](./next-steps.md) 继续探索.
|
||||
|
||||
@@ -1,6 +1,50 @@
|
||||
---
|
||||
title: Write a Test (Python)
|
||||
hide:
|
||||
- toc
|
||||
|
||||
title: 编写一个测试 (Python)
|
||||
---
|
||||
[Appium Python Client](https://github.com/appium/python-client) 是官方的Appium Python客户端,可通过pypi里包名为[Appium-Python-Client](https://pypi.org/project/Appium-Python-Client/)进行安装。
|
||||
它继承自 [Selenium Python Binding](https://pypi.org/project/selenium/),
|
||||
因此安装Appium Python客户端时会包含selenium绑定。
|
||||
|
||||
```bash
|
||||
pip install Appium-Python-Client
|
||||
```
|
||||
|
||||
TODO
|
||||
这个示例使用Python内置的`unittest`模块,尽管你可以使用任何你想要的Python测试框架。
|
||||
Appium Python客户端自动添加`appium:`供应商前缀。
|
||||
通常你不需要担心前缀。
|
||||
|
||||
```python title="test.py"
|
||||
--8<-- "./sample-code/quickstarts/py/test.py"
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
在本指南中,我们不会详细解释Python客户端库或这里发生的所有事情,因此现在不对代码本身进行详细说明。
|
||||
|
||||
- 你可能想要特别了解一下Appium [Capabilities](../guides/caps.md)。
|
||||
- Python客户端GitHub仓库中的[功能测试代码](https://github.com/appium/python-client/tree/master/test/functional)应该有助于找到更多的工作示例。
|
||||
- [文档](https://appium.github.io/python-client-sphinx/)也有助于找到在Appium Python客户端中定义的方法。
|
||||
|
||||
!!! note
|
||||
|
||||
示例代码可从 [GitHub Appium仓库](https://github.com/appium/appium/tree/master/packages/appium/sample-code/quickstarts/py) 获取。
|
||||
|
||||
基本上,这段代码正在做以下事情:
|
||||
|
||||
1. 定义一组“Capabilities”(参数),发送到Appium服务器,以便Appium知道你想要自动化的事物类型。
|
||||
2. 在内置的 Android 设置应用程序上启动 Appium 会话。
|
||||
3. 查找“Battery”列表项并点击它。
|
||||
4. 停顿片刻,纯粹是为了观察自动化视觉效果。。
|
||||
5. 结束Appium会话。
|
||||
|
||||
就这些!让我们试一试。在运行测试之前,请确保你有一个Appium服务器在另一个终端会话中运行,否则你将收到无法连接到服务器的错误。然后,你可以执行脚本:
|
||||
|
||||
```bash
|
||||
python test.py
|
||||
```
|
||||
|
||||
如果一切顺利,在应用再次关闭之前,你会看到 "设置 "应用打开并导航到 "Battery "视图。
|
||||
恭喜您,您已经开始了您的Appium之旅了!继续阅读一些[下一步骤](./next-steps.md)来探索它吧。
|
||||
|
||||
@@ -1,6 +1,86 @@
|
||||
---
|
||||
title: Install the UiAutomator2 Driver
|
||||
---
|
||||
|
||||
title: 安装 UiAutomator2 驱动
|
||||
|
||||
TODO
|
||||
---
|
||||
|
||||
如果没有[驱动](../intro/drivers.md),你几乎无法使用 Appium,驱动是允许 Appium 自动化特定平台的接口。
|
||||
|
||||
!!! info
|
||||
|
||||
在本快速入门指南中,我们将自动化一个 Android 平台的应用,因为通过 Appium 进行 Android 自动化的系统要求与 Appium 本身相同(而 iOS 驱动例如,需要你使用 macOS)。
|
||||
|
||||
我们将使用的驱动称为 [UiAutomator2 驱动](https://github.com/appium/appium-uiautomator2-driver)。值得访问该驱动的文档并将其加入书签,因为这将是今后不可或缺的参考资料。
|
||||
|
||||
## 设置 Android 自动化要求
|
||||
|
||||
根据驱动的要求,除了一个运行中的 Appium 服务器,我们还需要设置以下内容:
|
||||
|
||||
### Android SDK
|
||||
|
||||
- 设置 Android SDK 要求的最简单方法是下载 [Android Studio](https://developer.android.com/studio)。
|
||||
我们需要使用其 SDK 管理器 (_设置 -> 外观和行为 -> 系统设置 -> Android SDK_) 来下载以下项目:
|
||||
- Android SDK 平台(选择我们想要自动化的任何 Android 平台,例如,API 级别 30)
|
||||
- Android SDK 平台工具
|
||||
- 如果愿意,你也可以不通过 Android Studio 下载这些项目:
|
||||
- 可以使用 [Android 命令行工具](https://developer.android.com/studio#command-line-tools-only) 中包含的 `sdkmanager` 下载 Android SDK 平台
|
||||
- [Android SDK 平台工具](https://developer.android.com/tools/releases/platform-tools)
|
||||
- 设置 `ANDROID_HOME` 环境变量,指向安装 Android SDK 的目录。通常可以在 Android Studio 的 SDK 管理器中找到这个目录的路径。它将包含 `platform-tools` 和其他目录。
|
||||
|
||||
### Java JDK
|
||||
|
||||
- 安装 Java JDK(对于最新的 Android API 级别,需要 JDK 9,否则需要 JDK 8)。你可以从 [Oracle](https://jdk.java.net/) 或 [Adoptium](https://adoptium.net/en-GB/temurin/releases/) 下载。
|
||||
确保下载的是 JDK 而不是 JRE。
|
||||
- 设置 `JAVA_HOME` 环境变量,指向 JDK 的安装目录。它将包含 `bin`、`include` 和其他目录。
|
||||
|
||||
### 准备设备
|
||||
|
||||
- 如果使用模拟器,使用 Android Studio 创建并启动一个 Android 虚拟设备 (AVD)。
|
||||
你可能需要下载你想要创建的模拟器的 API 级别的系统镜像。使用 Android Studio 中的 AVD 创建向导通常是完成所有这些操作的最简单方式。
|
||||
- 如果使用真实设备,应该[为开发设置并启用 USB 调试](https://developer.android.com/studio/debug/dev-options)。
|
||||
- 连接模拟器或设备后,你可以运行 `adb devices`(通过位于 `$ANDROID_HOME/platform-tools/adb` 的二进制文件)来验证你的设备是否显示为已连接。
|
||||
|
||||
一旦你的设备在 `adb` 中显示为已连接,并且你已验证环境变量设置正确,你就可以开始了!如果在这些步骤中遇到任何问题,请参考驱动文档,或必要时查看各种 Android 或 Java 文档网站。
|
||||
|
||||
此外,恭喜你:不管你是否打算,你现在已经在你的系统上设置了 Android 开发者工具链,所以你可以开始制作 Android 应用了!
|
||||
|
||||
## 安装驱动本身
|
||||
|
||||
由于 UiAutomator2 驱动是由核心 Appium 团队维护的,它有一个官方的驱动名称,你可以通过 [Appium 扩展 CLI](../cli/extensions.md) 轻松安装:
|
||||
|
||||
```bash
|
||||
appium driver install uiautomator2
|
||||
```
|
||||
|
||||
它应该产生类似下面的输出:
|
||||
|
||||
```
|
||||
Attempting to find and install driver 'uiautomator2'
|
||||
✔ Installing 'uiautomator2' using NPM install spec 'appium-uiautomator2-driver'
|
||||
Driver uiautomator2@2.0.5 successfully installed
|
||||
- automationName: UiAutomator2
|
||||
- platformNames: ["Android"]
|
||||
```
|
||||
|
||||
运行此命令将定位并安装 UiAutomator2 驱动的最新版本,使其可用于自动化。请注意,当安装时,它会告诉你哪些平台它适用(在这种情况下是 `Android`),以及在 Appium 会话中使用此驱动时必须使用的自动化名称(在这种情况下是 `UiAutomator2` 的 `appium:automationName` [capability](../guides/caps.md))。
|
||||
|
||||
!!! note
|
||||
|
||||
在这个快速入门中,我们使用了 [扩展 CLI](../cli/extensions.md) 来安装 UiAutomator2 驱动,但如果你将 Appium 集成到一个 Node.js 项目中,你可能更喜欢使用 `npm` 来管理 Appium 及其相关驱动。要了解更多关于这种技术的信息,请访问关于[管理 Appium 扩展](../guides/managing-exts.md)的指南。
|
||||
|
||||
现在,再次启动 Appium 服务器(运行 `appium`),你应该看到新安装的驱动被列为可用:
|
||||
|
||||
```
|
||||
[Appium] Available drivers:
|
||||
[Appium] - uiautomator2@2.0.5 (automationName 'UiAutomator2')
|
||||
```
|
||||
|
||||
Android 设置完成并且 UiAutomator2 驱动已安装后,你就可以编写你的第一个测试了!现在选择你喜欢的语言并试一试:
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-language-javascript: [__JavaScript__](./test-js.md)
|
||||
- :material-language-java: [__Java__](./test-java.md)
|
||||
- :material-language-python: [__Python__](./test-py.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1085,7 +1085,7 @@ class AppiumDriver extends DriverCore {
|
||||
// is to do the proxy and retrieve the result internally so it can be passed to the plugin
|
||||
// in case it calls 'await next()'. This requires that the driver have defined
|
||||
// 'proxyCommand' and not just 'proxyReqRes'.
|
||||
if (!dstSession.proxyCommand) {
|
||||
if (!dstSession?.proxyCommand) {
|
||||
throw new NoDriverProxyCommandError();
|
||||
}
|
||||
return await dstSession.proxyCommand(
|
||||
@@ -1106,7 +1106,7 @@ class AppiumDriver extends DriverCore {
|
||||
}
|
||||
|
||||
// here we know that we are executing a session command, and have a valid session driver
|
||||
return await dstSession.executeCommand(cmd, ...args);
|
||||
return await (/** @type {any} */ (dstSession)).executeCommand(cmd, ...args);
|
||||
};
|
||||
|
||||
// now take our default behavior, wrap it with any number of plugin behaviors, and run it
|
||||
|
||||
@@ -248,10 +248,10 @@ async function init(args) {
|
||||
`Found no log filtering rules in '${serverArgs.logFilters}'. Is that expected?`,
|
||||
);
|
||||
} else {
|
||||
// Filtering aims to "hide" these values from the log,
|
||||
// so it would be nice to not show them in the log as well.
|
||||
logger.info(
|
||||
`Loaded ${util.pluralize('filtering rule', rules.length, true)} from '${
|
||||
serverArgs.logFilters
|
||||
}'`,
|
||||
`Loaded ${util.pluralize('filtering rule', rules.length, true)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import {ArgumentTypeError} from 'argparse';
|
||||
import _ from 'lodash';
|
||||
import {formatErrors as formatErrors} from '../config-file';
|
||||
import {flattenSchema, validate} from './schema';
|
||||
import {transformers} from './cli-transformers';
|
||||
import {transformers, parseCsvLine} from './cli-transformers';
|
||||
|
||||
/**
|
||||
* This module concerns functions which convert schema definitions to
|
||||
@@ -136,13 +136,19 @@ function subSchemaToArgDef(subSchema, argSpec) {
|
||||
}
|
||||
|
||||
case TYPENAMES.OBJECT: {
|
||||
argTypeFunction = transformers.json;
|
||||
argTypeFunction = _.flow(transformers.json, (o) => {
|
||||
// Arrays and plain strings are also valid JSON
|
||||
if (!_.isPlainObject(o)) {
|
||||
throw new ArgumentTypeError(`'${_.truncate(o, {length: 100})}' must be a plain object`);;
|
||||
}
|
||||
return o;
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
// arrays are treated as CSVs, because `argparse` doesn't handle array data.
|
||||
case TYPENAMES.ARRAY: {
|
||||
argTypeFunction = transformers.csv;
|
||||
argTypeFunction = parseCsvLine;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -182,12 +188,13 @@ function subSchemaToArgDef(subSchema, argSpec) {
|
||||
argOpts.metavar = screamingSnakeCase(name);
|
||||
}
|
||||
|
||||
// the validity of "appiumCliTransformer" should already have been determined
|
||||
// by ajv during schema validation in `finalizeSchema()`. the `array` &
|
||||
// `object` types have already added a formatter (see above, so we don't do it
|
||||
// twice).
|
||||
if (type !== TYPENAMES.ARRAY && type !== TYPENAMES.OBJECT && appiumCliTransformer) {
|
||||
argTypeFunction = _.flow(argTypeFunction ?? _.identity, transformers[appiumCliTransformer]);
|
||||
if (appiumCliTransformer && transformers[appiumCliTransformer]) {
|
||||
if (type === TYPENAMES.ARRAY) {
|
||||
const csvTransformer = /** @type {(x: string) => string[]} */ (argTypeFunction);
|
||||
argTypeFunction = (val) => _.flatMap(csvTransformer(val).map(transformers[appiumCliTransformer]));
|
||||
} else {
|
||||
argTypeFunction = _.flow(argTypeFunction ?? _.identity, transformers[appiumCliTransformer]);
|
||||
}
|
||||
}
|
||||
|
||||
if (argTypeFunction) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {ArgumentTypeError} from 'argparse';
|
||||
import {readFileSync, existsSync} from 'fs';
|
||||
import _ from 'lodash';
|
||||
|
||||
/**
|
||||
* This module provides custom keywords for Appium schemas, as well as
|
||||
@@ -16,7 +15,7 @@ import _ from 'lodash';
|
||||
* @param {string} value
|
||||
* @returns {string[]}
|
||||
*/
|
||||
function parseCsvLine(value) {
|
||||
export function parseCsvLine(value) {
|
||||
return value
|
||||
.split(',')
|
||||
.map((v) => v.trim())
|
||||
@@ -71,7 +70,6 @@ export const transformers = {
|
||||
}
|
||||
loadedFromFile = true;
|
||||
}
|
||||
|
||||
try {
|
||||
return loadedFromFile ? parseCsvFile(csv) : parseCsvLine(csv);
|
||||
} catch (err) {
|
||||
@@ -104,14 +102,10 @@ export const transformers = {
|
||||
loadedFromFile = true;
|
||||
}
|
||||
try {
|
||||
const result = JSON.parse(json);
|
||||
if (!_.isPlainObject(result)) {
|
||||
throw new Error(`'${_.truncate(result, {length: 100})}' is not an object`);
|
||||
}
|
||||
return result;
|
||||
return JSON.parse(json);
|
||||
} catch (e) {
|
||||
const msg = loadedFromFile
|
||||
? `The provided value of '${jsonOrPath}' must be a valid JSON`
|
||||
? `'${jsonOrPath}' must be a valid JSON`
|
||||
: `The provided value must be a valid JSON`;
|
||||
throw new TypeError(`${msg}. Original error: ${e.message}`);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "appium",
|
||||
"version": "2.5.1",
|
||||
"version": "2.5.4",
|
||||
"description": "Automation for Apps.",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -60,28 +60,28 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/base-driver": "^9.5.2",
|
||||
"@appium/base-plugin": "^2.2.28",
|
||||
"@appium/docutils": "^1.0.4",
|
||||
"@appium/base-driver": "^9.6.0",
|
||||
"@appium/base-plugin": "^2.2.31",
|
||||
"@appium/docutils": "^1.0.7",
|
||||
"@appium/schema": "~0.5.0",
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/types": "^0.16.1",
|
||||
"@appium/support": "^4.2.5",
|
||||
"@appium/types": "^0.17.0",
|
||||
"@sidvind/better-ajv-errors": "2.1.3",
|
||||
"@types/argparse": "2.0.14",
|
||||
"@types/argparse": "2.0.16",
|
||||
"@types/bluebird": "3.5.42",
|
||||
"@types/fancy-log": "2.0.2",
|
||||
"@types/semver": "7.5.7",
|
||||
"@types/semver": "7.5.8",
|
||||
"@types/teen_process": "2.0.4",
|
||||
"@types/wrap-ansi": "3.0.0",
|
||||
"ajv": "8.12.0",
|
||||
"ajv-formats": "2.1.1",
|
||||
"ajv-formats": "3.0.1",
|
||||
"argparse": "2.0.1",
|
||||
"async-lock": "1.4.1",
|
||||
"asyncbox": "3.0.0",
|
||||
"axios": "1.6.7",
|
||||
"axios": "1.6.8",
|
||||
"bluebird": "3.7.2",
|
||||
"cross-env": "7.0.3",
|
||||
"lilconfig": "3.0.0",
|
||||
"lilconfig": "3.1.1",
|
||||
"lodash": "4.17.21",
|
||||
"npmlog": "7.0.1",
|
||||
"ora": "5.4.1",
|
||||
@@ -91,10 +91,10 @@
|
||||
"source-map-support": "0.5.21",
|
||||
"teen_process": "2.1.1",
|
||||
"type-fest": "4.10.1",
|
||||
"winston": "3.11.0",
|
||||
"winston": "3.13.0",
|
||||
"wrap-ansi": "7.0.0",
|
||||
"ws": "8.16.0",
|
||||
"yaml": "2.3.4"
|
||||
"yaml": "2.4.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"webdriverio": "8.31.1"
|
||||
"webdriverio": "8.36.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import _ from 'lodash';
|
||||
import {PLUGIN_TYPE} from '../../../lib/constants';
|
||||
import {finalizeSchema, registerSchema, resetSchema} from '../../../lib/schema';
|
||||
import {toParserArgs} from '../../../lib/schema/cli-args';
|
||||
import {transformers} from '../../../lib/schema/cli-transformers';
|
||||
|
||||
const {expect} = chai;
|
||||
|
||||
@@ -63,7 +62,7 @@ describe('cli-args', function () {
|
||||
});
|
||||
|
||||
it('should use the `json` transformer', function () {
|
||||
expect(result['--plugin-blob-foo']).to.have.property('type', transformers.json);
|
||||
expect(result['--plugin-blob-foo']).to.have.property('type');
|
||||
});
|
||||
|
||||
it('should contain a SCREAMING_SNAKE_CASE `metavar` prop', function () {
|
||||
@@ -78,7 +77,7 @@ describe('cli-args', function () {
|
||||
});
|
||||
|
||||
it('should use the `csv` transformer', function () {
|
||||
expect(result['--plugin-blob-foo']).to.have.property('type', transformers.csv);
|
||||
expect(result['--plugin-blob-foo']).to.have.property('type');
|
||||
});
|
||||
|
||||
it('should contain a SCREAMING_SNAKE_CASE `metavar` prop', function () {
|
||||
@@ -211,11 +210,11 @@ describe('cli-args', function () {
|
||||
|
||||
it('should error if the value is not valid for the transformer', function () {
|
||||
const schema = {
|
||||
properties: {foo: {type: 'string', appiumCliTransformer: 'json'}},
|
||||
properties: {foo: {type: 'object'}},
|
||||
type: 'object',
|
||||
};
|
||||
result = getArgs({schema, extName, extType});
|
||||
expect(() => result['--plugin-blob-foo'].type('123')).to.throw(/must be a valid json/i);
|
||||
expect(() => result['--plugin-blob-foo'].type('123')).to.throw(/must be a plain object/i);
|
||||
});
|
||||
|
||||
// this is unlikely to happen, but I want to establish the behavior as defined.
|
||||
|
||||
@@ -82,12 +82,10 @@ describe('utils', function () {
|
||||
'appium:foo2': 'bar2',
|
||||
}
|
||||
);
|
||||
res.error.should.eql({
|
||||
jsonwpCode: 61,
|
||||
error: 'invalid argument',
|
||||
w3cStatus: 400,
|
||||
_stacktrace: null,
|
||||
});
|
||||
res.error.jsonwpCode.should.eql(61);
|
||||
res.error.error.should.eql('invalid argument');
|
||||
res.error.w3cStatus.should.eql(400);
|
||||
_.isNull(res.error._stacktrace).should.be.true;
|
||||
});
|
||||
it('should reject if W3C caps are not passing constraints', function () {
|
||||
const err = parseCapsForInnerDriver(undefined, W3C_CAPS, {
|
||||
@@ -101,14 +99,13 @@ describe('utils', function () {
|
||||
...W3C_CAPS,
|
||||
firstMatch: [{foo: 'bar'}, {'appium:hello': 'world'}],
|
||||
};
|
||||
parseCapsForInnerDriver(BASE_CAPS, w3cCaps, {
|
||||
const error = parseCapsForInnerDriver(BASE_CAPS, w3cCaps, {
|
||||
hello: {presence: true},
|
||||
}).error.should.eql({
|
||||
jsonwpCode: 61,
|
||||
error: 'invalid argument',
|
||||
w3cStatus: 400,
|
||||
_stacktrace: null,
|
||||
});
|
||||
}).error;
|
||||
error.jsonwpCode.should.eql(61);
|
||||
error.error.should.eql('invalid argument');
|
||||
error.w3cStatus.should.eql(400);
|
||||
_.isNull(error._stacktrace).should.be.true;
|
||||
});
|
||||
it('should add appium prefixes to W3C caps that are not standard in W3C', function () {
|
||||
parseCapsForInnerDriver(undefined, {
|
||||
|
||||
@@ -3,6 +3,39 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [9.6.0](https://github.com/appium/appium/compare/@appium/base-driver@9.5.4...@appium/base-driver@9.6.0) (2024-04-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **base-driver:** Add onDownload handler to the configureApp helper ([#20015](https://github.com/appium/appium/issues/20015)) ([8cf3efd](https://github.com/appium/appium/commit/8cf3efdbed6c0868f2d7838e249a3d2478f186d4))
|
||||
|
||||
|
||||
|
||||
## [9.5.4](https://github.com/appium/appium/compare/@appium/base-driver@9.5.3...@appium/base-driver@9.5.4) (2024-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* do not print deprecation errors for non-provided caps ([#19986](https://github.com/appium/appium/issues/19986)) ([9f655f6](https://github.com/appium/appium/commit/9f655f6f852bc10ca1f51529183c7c44eb4c79ea))
|
||||
|
||||
|
||||
|
||||
## [9.5.3](https://github.com/appium/appium/compare/@appium/base-driver@9.5.2...@appium/base-driver@9.5.3) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **base-driver:** update dependency express to v4.18.3 ([917084c](https://github.com/appium/appium/commit/917084ccca23c5483e7d83ce97721061dd2fe345))
|
||||
* **base-driver:** update dependency express to v4.19.1 ([a74132c](https://github.com/appium/appium/commit/a74132cc96d201bb5c7b7f11a7e3b1b79e7d2424))
|
||||
* **base-driver:** update dependency express to v4.19.2 ([7cb1621](https://github.com/appium/appium/commit/7cb1621e80bc4225c48833cc2bd02fe80dccd382))
|
||||
* **base-driver:** update dependency path-to-regexp to v6.2.2 ([#19979](https://github.com/appium/appium/issues/19979)) ([b8368bb](https://github.com/appium/appium/commit/b8368bb666fda44e3b0c45cc7307bff69fe40202))
|
||||
* **docutils:** update dependency typescript to v5.4.2 ([#19876](https://github.com/appium/appium/issues/19876)) ([2448fa0](https://github.com/appium/appium/commit/2448fa0145620657ccc72b5637f1b7737fe52580))
|
||||
* **driver-test-support:** update definitelytyped ([4776574](https://github.com/appium/appium/commit/47765747b66c5e0076f6ffe4619d6b98a42aee29))
|
||||
* **support:** update dependency axios to v1.6.8 ([bd6ab81](https://github.com/appium/appium/commit/bd6ab81c9408ab0f90fc25fc112f9257ec2973ad))
|
||||
|
||||
|
||||
|
||||
## [9.5.2](https://github.com/appium/appium/compare/@appium/base-driver@9.5.1...@appium/base-driver@9.5.2) (2024-02-13)
|
||||
|
||||
**Note:** Version bump only for package @appium/base-driver
|
||||
|
||||
+98
-169
@@ -1,34 +1,54 @@
|
||||
// @ts-check
|
||||
|
||||
import type {
|
||||
Constraints,
|
||||
NSCapabilities,
|
||||
Capabilities,
|
||||
W3CCapabilities,
|
||||
StandardCapabilities,
|
||||
} from '@appium/types';
|
||||
import type {
|
||||
StringKeyOf,
|
||||
MergeExclusive,
|
||||
} from 'type-fest';
|
||||
import _ from 'lodash';
|
||||
import {validator} from './desired-caps';
|
||||
import {util} from '@appium/support';
|
||||
import log from './logger';
|
||||
import {errors} from '../protocol/errors';
|
||||
|
||||
const APPIUM_VENDOR_PREFIX = 'appium:';
|
||||
const PREFIXED_APPIUM_OPTS_CAP = `${APPIUM_VENDOR_PREFIX}options`;
|
||||
export const APPIUM_VENDOR_PREFIX = 'appium:';
|
||||
export const PREFIXED_APPIUM_OPTS_CAP = `${APPIUM_VENDOR_PREFIX}options`;
|
||||
|
||||
export type ParsedCaps<C extends Constraints> = {
|
||||
allFirstMatchCaps: NSCapabilities<C>[];
|
||||
validatedFirstMatchCaps: Capabilities<C>[];
|
||||
requiredCaps: NSCapabilities<C>;
|
||||
matchedCaps: Capabilities<C> | null;
|
||||
validationErrors: string[];
|
||||
};
|
||||
export type ValidateCapsOpts = {
|
||||
/** if true, skip the presence constraint */
|
||||
skipPresenceConstraint?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes primary caps object and merges it into a secondary caps object.
|
||||
* @template {Constraints} T
|
||||
* @template {Constraints} U
|
||||
* @template {Capabilities<T>} Primary
|
||||
* @template {Capabilities<U>} Secondary
|
||||
* @param {Primary} [primary]
|
||||
* @param {Secondary} [secondary]
|
||||
* @returns {MergeExclusive<Primary, Secondary>}
|
||||
*
|
||||
* @see https://www.w3.org/TR/webdriver/#dfn-merging-capabilities)
|
||||
*/
|
||||
function mergeCaps(
|
||||
primary = /** @type {Primary} */ ({}),
|
||||
secondary = /** @type {Secondary} */ ({})
|
||||
) {
|
||||
let result = /** @type {MergeExclusive<Primary, Secondary>} */ ({
|
||||
export function mergeCaps<
|
||||
T extends Constraints,
|
||||
U extends Constraints,
|
||||
Primary extends Capabilities<T>,
|
||||
Secondary extends Capabilities<U>
|
||||
>(
|
||||
primary: Primary | undefined = {} as Primary,
|
||||
secondary: Secondary | undefined = {} as Secondary
|
||||
): MergeExclusive<Primary, Secondary> {
|
||||
const result = ({
|
||||
...primary,
|
||||
});
|
||||
}) as MergeExclusive<Primary, Secondary>;
|
||||
|
||||
for (let [name, value] of Object.entries(secondary)) {
|
||||
for (const [name, value] of Object.entries(secondary)) {
|
||||
// Overwriting is not allowed. Primary and secondary must have different properties (w3c rule 4.4)
|
||||
if (!_.isUndefined(primary[name])) {
|
||||
throw new errors.InvalidArgumentError(
|
||||
@@ -37,7 +57,7 @@ function mergeCaps(
|
||||
)}) and secondary (${JSON.stringify(secondary)}) object`
|
||||
);
|
||||
}
|
||||
result[/** @type {keyof typeof result} */ (name)] = value;
|
||||
result[name as keyof typeof result] = value;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -45,21 +65,20 @@ function mergeCaps(
|
||||
|
||||
/**
|
||||
* Validates caps against a set of constraints
|
||||
* @template {Constraints} C
|
||||
* @param {Capabilities<C>} caps
|
||||
* @param {C} [constraints]
|
||||
* @param {ValidateCapsOpts} [opts]
|
||||
* @returns {Capabilities<C>}
|
||||
*/
|
||||
function validateCaps(caps, constraints = /** @type {C} */ ({}), opts = {}) {
|
||||
let {skipPresenceConstraint} = opts;
|
||||
export function validateCaps<C extends Constraints>(
|
||||
caps: Capabilities<C>,
|
||||
constraints: C | undefined = {} as C,
|
||||
opts: ValidateCapsOpts | undefined = {}
|
||||
): Capabilities<C> {
|
||||
const {skipPresenceConstraint} = opts;
|
||||
|
||||
if (!_.isPlainObject(caps)) {
|
||||
throw new errors.InvalidArgumentError(`must be a JSON object`);
|
||||
}
|
||||
|
||||
// Remove the 'presence' constraint if we're not checking for it
|
||||
constraints = /** @type {C} */ (
|
||||
constraints = (
|
||||
_.mapValues(
|
||||
constraints,
|
||||
skipPresenceConstraint
|
||||
@@ -73,16 +92,16 @@ function validateCaps(caps, constraints = /** @type {C} */ ({}), opts = {}) {
|
||||
return constraint;
|
||||
}
|
||||
)
|
||||
);
|
||||
) as C;
|
||||
|
||||
const validationErrors = validator.validate(_.pickBy(caps, util.hasValue), constraints, {
|
||||
fullMessages: false,
|
||||
});
|
||||
|
||||
if (validationErrors) {
|
||||
let message = [];
|
||||
for (let [attribute, reasons] of _.toPairs(validationErrors)) {
|
||||
for (let reason of reasons) {
|
||||
const message: string[] = [];
|
||||
for (const [attribute, reasons] of _.toPairs(validationErrors)) {
|
||||
for (const reason of (reasons as string[])) {
|
||||
message.push(`'${attribute}' ${reason}`);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +118,7 @@ function validateCaps(caps, constraints = /** @type {C} */ ({}), opts = {}) {
|
||||
*/
|
||||
export const STANDARD_CAPS = Object.freeze(
|
||||
new Set(
|
||||
/** @type {StringKeyOf<import('@appium/types').StandardCapabilities>[]} */ ([
|
||||
([
|
||||
'browserName',
|
||||
'browserVersion',
|
||||
'platformName',
|
||||
@@ -110,29 +129,22 @@ export const STANDARD_CAPS = Object.freeze(
|
||||
'timeouts',
|
||||
'unhandledPromptBehavior',
|
||||
'webSocketUrl',
|
||||
])
|
||||
]) as StringKeyOf<StandardCapabilities>[]
|
||||
)
|
||||
);
|
||||
|
||||
const STANDARD_CAPS_LOWER = new Set([...STANDARD_CAPS].map((cap) => cap.toLowerCase()));
|
||||
|
||||
/**
|
||||
* @param {string} cap
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isStandardCap(cap) {
|
||||
export function isStandardCap(cap: string): boolean {
|
||||
return STANDARD_CAPS_LOWER.has(cap.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* If the 'appium:' prefix was provided and it's a valid capability, strip out the prefix
|
||||
* @template {Constraints} C
|
||||
* @param {NSCapabilities<C>} caps
|
||||
* @see https://www.w3.org/TR/webdriver/#dfn-extension-capabilities
|
||||
* @internal
|
||||
* @returns {Capabilities<C>}
|
||||
*/
|
||||
function stripAppiumPrefixes(caps) {
|
||||
export function stripAppiumPrefixes<C extends Constraints>(caps: NSCapabilities<C>): Capabilities<C> {
|
||||
// split into prefixed and non-prefixed.
|
||||
// non-prefixed should be standard caps at this point
|
||||
const [prefixedCaps, nonPrefixedCaps] = _.partition(_.keys(caps), (cap) =>
|
||||
@@ -140,14 +152,12 @@ function stripAppiumPrefixes(caps) {
|
||||
);
|
||||
|
||||
// initialize this with the k/v pairs of the non-prefixed caps
|
||||
let strippedCaps = /** @type {Capabilities<C>} */ (_.pick(caps, nonPrefixedCaps));
|
||||
const badPrefixedCaps = [];
|
||||
const strippedCaps = (_.pick(caps, nonPrefixedCaps)) as Capabilities<C>;
|
||||
const badPrefixedCaps: string[] = [];
|
||||
|
||||
// Strip out the 'appium:' prefix
|
||||
for (let prefixedCap of prefixedCaps) {
|
||||
const strippedCapName = /** @type {StringKeyOf<Capabilities<C>>} */ (
|
||||
prefixedCap.substring(APPIUM_VENDOR_PREFIX.length)
|
||||
);
|
||||
for (const prefixedCap of prefixedCaps) {
|
||||
const strippedCapName = prefixedCap.substring(APPIUM_VENDOR_PREFIX.length) as StringKeyOf<Capabilities<C>>;
|
||||
|
||||
// If it's standard capability that was prefixed, add it to an array of incorrectly prefixed capabilities
|
||||
if (isStandardCap(strippedCapName)) {
|
||||
@@ -178,10 +188,13 @@ function stripAppiumPrefixes(caps) {
|
||||
|
||||
/**
|
||||
* Get an array of all the unprefixed caps that are being used in 'alwaysMatch' and all of the 'firstMatch' object
|
||||
* @template {Constraints} C
|
||||
* @param {W3CCapabilities<C>} caps A capabilities object
|
||||
*/
|
||||
function findNonPrefixedCaps({alwaysMatch = {}, firstMatch = []}) {
|
||||
export function findNonPrefixedCaps<C extends Constraints>(
|
||||
{
|
||||
alwaysMatch = {},
|
||||
firstMatch = []
|
||||
}: W3CCapabilities<C>
|
||||
): string[] {
|
||||
return _.chain([alwaysMatch, ...firstMatch])
|
||||
.reduce(
|
||||
(unprefixedCaps, caps) => [
|
||||
@@ -194,27 +207,15 @@ function findNonPrefixedCaps({alwaysMatch = {}, firstMatch = []}) {
|
||||
.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returned by {@linkcode parseCaps}
|
||||
* @template {Constraints} C
|
||||
* @typedef ParsedCaps
|
||||
* @property {NSCapabilities<C>[]} allFirstMatchCaps
|
||||
* @property {Capabilities<C>[]} validatedFirstMatchCaps
|
||||
* @property {NSCapabilities<C>} requiredCaps
|
||||
* @property {Capabilities<C>|null} matchedCaps
|
||||
* @property {string[]} validationErrors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parse capabilities
|
||||
* @template {Constraints} C
|
||||
* @param {W3CCapabilities<C>} caps
|
||||
* @param {C} [constraints]
|
||||
* @param {boolean} [shouldValidateCaps]
|
||||
* @see https://www.w3.org/TR/webdriver/#processing-capabilities
|
||||
* @returns {ParsedCaps<C>}
|
||||
*/
|
||||
function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps = true) {
|
||||
export function parseCaps<C extends Constraints>(
|
||||
caps: W3CCapabilities<C>,
|
||||
constraints: C | undefined = {} as C,
|
||||
shouldValidateCaps: boolean | undefined = true
|
||||
): ParsedCaps<C> {
|
||||
// If capabilities request is not an object, return error (#1.1)
|
||||
if (!_.isPlainObject(caps)) {
|
||||
throw new errors.InvalidArgumentError(
|
||||
@@ -224,9 +225,9 @@ function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps
|
||||
|
||||
// Let 'requiredCaps' be property named 'alwaysMatch' from capabilities request (#2)
|
||||
// and 'allFirstMatchCaps' be property named 'firstMatch' from capabilities request (#3)
|
||||
let {
|
||||
alwaysMatch: requiredCaps = /** @type {NSCapabilities<C>} */ ({}), // If 'requiredCaps' is undefined, set it to an empty JSON object (#2.1)
|
||||
firstMatch: allFirstMatchCaps = /** @type {NSCapabilities<C>[]} */ ([{}]), // If 'firstMatch' is undefined set it to a singleton list with one empty object (#3.1)
|
||||
const {
|
||||
alwaysMatch: requiredCaps = {} as NSCapabilities<C>, // If 'requiredCaps' is undefined, set it to an empty JSON object (#2.1)
|
||||
firstMatch: allFirstMatchCaps = [{}] as NSCapabilities<C>[], // If 'firstMatch' is undefined set it to a singleton list with one empty object (#3.1)
|
||||
} = caps;
|
||||
|
||||
// Reject 'firstMatch' argument if it's not an array (#3.2)
|
||||
@@ -247,7 +248,7 @@ function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps
|
||||
}
|
||||
|
||||
// Check for non-prefixed, non-standard capabilities and log warnings if they are found
|
||||
let nonPrefixedCaps = findNonPrefixedCaps(caps);
|
||||
const nonPrefixedCaps = findNonPrefixedCaps(caps);
|
||||
if (!_.isEmpty(nonPrefixedCaps)) {
|
||||
throw new errors.InvalidArgumentError(
|
||||
`All non-standard capabilities should have a vendor prefix. The following capabilities did not have one: ${nonPrefixedCaps}`
|
||||
@@ -256,8 +257,7 @@ function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps
|
||||
|
||||
// Strip out the 'appium:' prefix from all
|
||||
let strippedRequiredCaps = stripAppiumPrefixes(requiredCaps);
|
||||
/** @type {Capabilities<C>[]} */
|
||||
let strippedAllFirstMatchCaps = allFirstMatchCaps.map(stripAppiumPrefixes);
|
||||
const strippedAllFirstMatchCaps: Capabilities<C>[] = allFirstMatchCaps.map(stripAppiumPrefixes);
|
||||
|
||||
// Validate the requiredCaps. But don't validate 'presence' because if that constraint fails on 'alwaysMatch' it could still pass on one of the 'firstMatch' keys
|
||||
if (shouldValidateCaps) {
|
||||
@@ -267,14 +267,11 @@ function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps
|
||||
}
|
||||
// Remove the 'presence' constraint for any keys that are already present in 'requiredCaps'
|
||||
// since we know that this constraint has already passed
|
||||
const filteredConstraints = /** @type {C} */ (
|
||||
_.omitBy(constraints, (_, key) => key in strippedRequiredCaps)
|
||||
);
|
||||
const filteredConstraints = _.omitBy(constraints, (_, key) => key in strippedRequiredCaps) as C;
|
||||
|
||||
// Validate all of the first match capabilities and return an array with only the valid caps (see spec #5)
|
||||
/** @type {string[]} */
|
||||
let validationErrors = [];
|
||||
let validatedFirstMatchCaps = _.compact(
|
||||
const validationErrors: string[] = [];
|
||||
const validatedFirstMatchCaps = _.compact(
|
||||
strippedAllFirstMatchCaps.map((firstMatchCaps) => {
|
||||
try {
|
||||
// Validate firstMatch caps
|
||||
@@ -285,17 +282,16 @@ function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps
|
||||
validationErrors.push(e.message);
|
||||
}
|
||||
})
|
||||
);
|
||||
) as Capabilities<C>[];
|
||||
|
||||
/**
|
||||
* Try to merge requiredCaps with first match capabilities, break once it finds its first match
|
||||
* (see spec #6)
|
||||
* @type {ParsedCaps<C>['matchedCaps']}
|
||||
*/
|
||||
let matchedCaps = null;
|
||||
for (let firstMatchCaps of validatedFirstMatchCaps) {
|
||||
let matchedCaps: ParsedCaps<C>['matchedCaps'] = null;
|
||||
for (const firstMatchCaps of validatedFirstMatchCaps) {
|
||||
try {
|
||||
matchedCaps = mergeCaps(strippedRequiredCaps, firstMatchCaps);
|
||||
matchedCaps = mergeCaps(strippedRequiredCaps, firstMatchCaps) as ParsedCaps<C>['matchedCaps'];
|
||||
if (matchedCaps) {
|
||||
break;
|
||||
}
|
||||
@@ -317,18 +313,15 @@ function parseCaps(caps, constraints = /** @type {C} */ ({}), shouldValidateCaps
|
||||
|
||||
/**
|
||||
* Calls parseCaps and just returns the matchedCaps variable
|
||||
* @template {Constraints} C
|
||||
* @template {W3CCapabilities<C>} W3CCaps
|
||||
* @param {W3CCaps} w3cCaps
|
||||
* @param {C} [constraints]
|
||||
* @param {boolean} [shouldValidateCaps]
|
||||
* @returns {Capabilities<C>}
|
||||
*/
|
||||
function processCapabilities(
|
||||
w3cCaps,
|
||||
constraints = /** @type {C} */ ({}),
|
||||
shouldValidateCaps = true
|
||||
) {
|
||||
export function processCapabilities<
|
||||
C extends Constraints,
|
||||
W3CCaps extends W3CCapabilities<C>
|
||||
>(
|
||||
w3cCaps: W3CCaps,
|
||||
constraints: C | undefined = {} as C,
|
||||
shouldValidateCaps: boolean | undefined = true
|
||||
): Capabilities<C> {
|
||||
const {matchedCaps, validationErrors} = parseCaps(w3cCaps, constraints, shouldValidateCaps);
|
||||
|
||||
// If we found an error throw an exception
|
||||
@@ -346,18 +339,14 @@ function processCapabilities(
|
||||
}
|
||||
}
|
||||
|
||||
return /** @type {Capabilities<C>} */ (matchedCaps ?? {});
|
||||
return (matchedCaps ?? {}) as Capabilities<C>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a copy of a "bare" (single-level, non-W3C) capabilities object which has taken everything
|
||||
* within the 'appium:options' capability and promoted it to the top level.
|
||||
*
|
||||
* @template {Constraints} C
|
||||
* @param {NSCapabilities<C>} obj
|
||||
* @return {NSCapabilities<C>} the capabilities with 'options' promoted if necessary
|
||||
*/
|
||||
function promoteAppiumOptionsForObject(obj) {
|
||||
export function promoteAppiumOptionsForObject<C extends Constraints>(obj: NSCapabilities<C>): NSCapabilities<C> {
|
||||
const appiumOptions = obj[PREFIXED_APPIUM_OPTS_CAP];
|
||||
if (!appiumOptions) {
|
||||
return obj;
|
||||
@@ -379,8 +368,8 @@ function promoteAppiumOptionsForObject(obj) {
|
||||
/**
|
||||
* @param {string} capName
|
||||
*/
|
||||
const shouldAddVendorPrefix = (capName) => !capName.startsWith(APPIUM_VENDOR_PREFIX);
|
||||
const verifyIfAcceptable = (/** @type {string} */ capName) => {
|
||||
const shouldAddVendorPrefix = (capName: string) => !capName.startsWith(APPIUM_VENDOR_PREFIX);
|
||||
const verifyIfAcceptable = (capName: string) => {
|
||||
if (!_.isString(capName)) {
|
||||
throw new errors.SessionNotCreatedError(
|
||||
`Capability names in ${PREFIXED_APPIUM_OPTS_CAP} must be strings. '${capName}' is unexpected`
|
||||
@@ -394,8 +383,8 @@ function promoteAppiumOptionsForObject(obj) {
|
||||
return capName;
|
||||
};
|
||||
const preprocessedOptions = _(appiumOptions)
|
||||
.mapKeys((value, /** @type {string} */ key) => verifyIfAcceptable(key))
|
||||
.mapKeys((value, key) => (shouldAddVendorPrefix(key) ? `${APPIUM_VENDOR_PREFIX}${key}` : key))
|
||||
.mapKeys((value, key: string) => verifyIfAcceptable(key))
|
||||
.mapKeys((value, key: string) => (shouldAddVendorPrefix(key) ? `${APPIUM_VENDOR_PREFIX}${key}` : key))
|
||||
.value();
|
||||
// warn if we are going to overwrite any keys on the base caps object
|
||||
const overwrittenKeys = _.intersection(Object.keys(obj), Object.keys(preprocessedOptions));
|
||||
@@ -406,7 +395,7 @@ function promoteAppiumOptionsForObject(obj) {
|
||||
);
|
||||
}
|
||||
return _.cloneDeep({
|
||||
.../** @type {NSCapabilities<C>} */ (_.omit(obj, PREFIXED_APPIUM_OPTS_CAP)),
|
||||
..._.omit(obj, PREFIXED_APPIUM_OPTS_CAP) as NSCapabilities<C>,
|
||||
...preprocessedOptions,
|
||||
});
|
||||
}
|
||||
@@ -414,13 +403,9 @@ function promoteAppiumOptionsForObject(obj) {
|
||||
/**
|
||||
* Return a copy of a capabilities object which has taken everything within the 'options'
|
||||
* capability and promoted it to the top level.
|
||||
*
|
||||
* @template {Constraints} C
|
||||
* @param {W3CCapabilities<C>} originalCaps
|
||||
* @return {W3CCapabilities<C>} the capabilities with 'options' promoted if necessary
|
||||
*/
|
||||
function promoteAppiumOptions(originalCaps) {
|
||||
const result = {};
|
||||
export function promoteAppiumOptions<C extends Constraints>(originalCaps: W3CCapabilities<C>): W3CCapabilities<C> {
|
||||
const result = {} as W3CCapabilities<C>;
|
||||
const {alwaysMatch, firstMatch} = originalCaps;
|
||||
if (_.isPlainObject(alwaysMatch)) {
|
||||
result.alwaysMatch = promoteAppiumOptionsForObject(alwaysMatch);
|
||||
@@ -434,59 +419,3 @@ function promoteAppiumOptions(originalCaps) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export {
|
||||
parseCaps,
|
||||
processCapabilities,
|
||||
validateCaps,
|
||||
mergeCaps,
|
||||
APPIUM_VENDOR_PREFIX,
|
||||
findNonPrefixedCaps,
|
||||
isStandardCap,
|
||||
stripAppiumPrefixes,
|
||||
promoteAppiumOptions,
|
||||
promoteAppiumOptionsForObject,
|
||||
PREFIXED_APPIUM_OPTS_CAP,
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {import('@appium/types').Constraints} Constraints
|
||||
* @typedef {import('@appium/types').Constraint} Constraint
|
||||
* @typedef {import('@appium/types').StringRecord} StringRecord
|
||||
* @typedef {import('@appium/types').BaseDriverCapConstraints} BaseDriverCapConstraints
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {Constraints} C
|
||||
* @typedef {import('@appium/types').ConstraintsToCaps<C>} ConstraintsToCaps
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef ValidateCapsOpts
|
||||
* @property {boolean} [skipPresenceConstraint] - if true, skip the presence constraint
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {Constraints} C
|
||||
* @typedef {import('@appium/types').NSCapabilities<C>} NSCapabilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {Constraints} C
|
||||
* @typedef {import('@appium/types').Capabilities<C>} Capabilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {Constraints} C
|
||||
* @typedef {import('@appium/types').W3CCapabilities<C>} W3CCapabilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import('type-fest').StringKeyOf<T>} StringKeyOf
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template T,U
|
||||
* @typedef {import('type-fest').MergeExclusive<T, U>} MergeExclusive<T,U>
|
||||
*/
|
||||
@@ -74,8 +74,12 @@ validator.validators.isArray = function isArray(value) {
|
||||
return 'must be of type array';
|
||||
};
|
||||
validator.validators.deprecated = function deprecated(value, options, key) {
|
||||
if (options) {
|
||||
log.warn(`${key} is a deprecated capability`);
|
||||
// do not print caps that hasn't been provided.
|
||||
if (typeof value !== 'undefined' && options) {
|
||||
log.warn(
|
||||
`The '${key}' capability has been deprecated and must not be used anymore. ` +
|
||||
`Please check the driver documentation for possible alternatives.`
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ import axios from 'axios';
|
||||
import B from 'bluebird';
|
||||
|
||||
// for compat with running tests transpiled and in-place
|
||||
const {version: BASEDRIVER_VER} = fs.readPackageJsonFrom(__dirname);
|
||||
export const {version: BASEDRIVER_VER} = fs.readPackageJsonFrom(__dirname);
|
||||
const IPA_EXT = '.ipa';
|
||||
const ZIP_EXTS = new Set(['.zip', IPA_EXT]);
|
||||
const ZIP_MIME_TYPES = ['application/zip', 'application/x-zip-compressed', 'multipart/x-zip'];
|
||||
@@ -20,11 +20,11 @@ const DEFAULT_REQ_HEADERS = Object.freeze({
|
||||
'user-agent': `Appium (BaseDriver v${BASEDRIVER_VER})`,
|
||||
});
|
||||
const AVG_DOWNLOAD_SPEED_MEASUREMENT_THRESHOLD_SEC = 2;
|
||||
/** @type {LRUCache<string, import('@appium/types').CachedAppInfo>} */
|
||||
const APPLICATIONS_CACHE = new LRUCache({
|
||||
max: MAX_CACHED_APPS,
|
||||
ttl: CACHED_APPS_MAX_AGE, // expire after 24 hours
|
||||
updateAgeOnGet: true,
|
||||
// @ts-ignore The fullPath property exists
|
||||
dispose: ({fullPath}, app) => {
|
||||
logger.info(
|
||||
`The application '${app}' cached at '${fullPath}' has ` +
|
||||
@@ -46,16 +46,14 @@ process.on('exit', () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const appPaths = [...APPLICATIONS_CACHE.values()]
|
||||
// @ts-ignore The fullPath property exists
|
||||
.map(({fullPath}) => fullPath);
|
||||
const appPaths = [...APPLICATIONS_CACHE.values()].map(({fullPath}) => fullPath);
|
||||
logger.debug(
|
||||
`Performing cleanup of ${appPaths.length} cached ` +
|
||||
util.pluralize('application', appPaths.length)
|
||||
);
|
||||
for (const appPath of appPaths) {
|
||||
try {
|
||||
// Asynchronous calls are not supported in onExit handler
|
||||
// @ts-ignore it's defined
|
||||
fs.rimrafSync(appPath);
|
||||
} catch (e) {
|
||||
logger.warn(e.message);
|
||||
@@ -63,6 +61,11 @@ process.on('exit', () => {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {string} app
|
||||
* @param {string[]} supportedAppExtensions
|
||||
* @returns {string}
|
||||
*/
|
||||
function verifyAppExtension(app, supportedAppExtensions) {
|
||||
if (supportedAppExtensions.map(_.toLower).includes(_.toLower(path.extname(app)))) {
|
||||
return app;
|
||||
@@ -74,14 +77,27 @@ function verifyAppExtension(app, supportedAppExtensions) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} folderPath
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
async function calculateFolderIntegrity(folderPath) {
|
||||
return (await fs.glob('**/*', {cwd: folderPath})).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} filePath
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
async function calculateFileIntegrity(filePath) {
|
||||
return await fs.hash(filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} currentPath
|
||||
* @param {import('@appium/types').StringRecord} expectedIntegrity
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async function isAppIntegrityOk(currentPath, expectedIntegrity = {}) {
|
||||
if (!(await fs.exists(currentPath))) {
|
||||
return false;
|
||||
@@ -104,7 +120,7 @@ async function isAppIntegrityOk(currentPath, expectedIntegrity = {}) {
|
||||
* @param {string} app
|
||||
* @param {string|string[]|import('@appium/types').ConfigureAppOptions} options
|
||||
*/
|
||||
async function configureApp(
|
||||
export async function configureApp(
|
||||
app,
|
||||
options = /** @type {import('@appium/types').ConfigureAppOptions} */ ({})
|
||||
) {
|
||||
@@ -114,8 +130,8 @@ async function configureApp(
|
||||
}
|
||||
|
||||
let supportedAppExtensions;
|
||||
const onPostProcess =
|
||||
!_.isString(options) && !_.isArray(options) ? options.onPostProcess : undefined;
|
||||
const onPostProcess = !_.isString(options) && !_.isArray(options) ? options.onPostProcess : undefined;
|
||||
const onDownload = !_.isString(options) && !_.isArray(options) ? options.onDownload : undefined;
|
||||
|
||||
if (_.isString(options)) {
|
||||
supportedAppExtensions = [options];
|
||||
@@ -143,8 +159,6 @@ async function configureApp(
|
||||
const {protocol, pathname} = url.parse(newApp);
|
||||
const isUrl = protocol === null ? false : ['http:', 'https:'].includes(protocol);
|
||||
|
||||
/** @type {import('@appium/types').CachedAppInfo|undefined} */
|
||||
// @ts-ignore We know the returned type
|
||||
const cachedAppInfo = APPLICATIONS_CACHE.get(app);
|
||||
if (cachedAppInfo) {
|
||||
logger.debug(`Cached app data: ${JSON.stringify(cachedAppInfo, null, 2)}`);
|
||||
@@ -162,20 +176,22 @@ async function configureApp(
|
||||
} else if (cachedAppInfo?.lastModified) {
|
||||
reqHeaders['if-modified-since'] = cachedAppInfo.lastModified.toUTCString();
|
||||
}
|
||||
logger.debug(`Request headers: ${JSON.stringify(reqHeaders)}`);
|
||||
|
||||
let {headers, stream, status} = await queryAppLink(newApp, reqHeaders);
|
||||
logger.debug(`Response status: ${status}`);
|
||||
try {
|
||||
if (!_.isEmpty(headers)) {
|
||||
logger.debug(`Etag: ${headers.etag}`);
|
||||
if (headers.etag) {
|
||||
logger.debug(`Etag: ${headers.etag}`);
|
||||
remoteAppProps.etag = headers.etag;
|
||||
}
|
||||
logger.debug(`Last-Modified: ${headers['last-modified']}`);
|
||||
if (headers['last-modified']) {
|
||||
logger.debug(`Last-Modified: ${headers['last-modified']}`);
|
||||
remoteAppProps.lastModified = new Date(headers['last-modified']);
|
||||
}
|
||||
logger.debug(`Cache-Control: ${headers['cache-control']}`);
|
||||
if (headers['cache-control']) {
|
||||
logger.debug(`Cache-Control: ${headers['cache-control']}`);
|
||||
remoteAppProps.immutable = /\bimmutable\b/i.test(headers['cache-control']);
|
||||
const maxAgeMatch = /\bmax-age=(\d+)\b/i.exec(headers['cache-control']);
|
||||
if (maxAgeMatch) {
|
||||
@@ -184,9 +200,9 @@ async function configureApp(
|
||||
}
|
||||
}
|
||||
if (cachedAppInfo && status === HTTP_STATUS_NOT_MODIFIED) {
|
||||
if (await isAppIntegrityOk(cachedAppInfo.fullPath, cachedAppInfo.integrity)) {
|
||||
if (await isAppIntegrityOk(/** @type {string} */ (cachedAppInfo.fullPath), cachedAppInfo.integrity)) {
|
||||
logger.info(`Reusing previously downloaded application at '${cachedAppInfo.fullPath}'`);
|
||||
return verifyAppExtension(cachedAppInfo.fullPath, supportedAppExtensions);
|
||||
return verifyAppExtension(/** @type {string} */ (cachedAppInfo.fullPath), supportedAppExtensions);
|
||||
}
|
||||
logger.info(
|
||||
`The application at '${cachedAppInfo.fullPath}' does not exist anymore ` +
|
||||
@@ -251,11 +267,15 @@ async function configureApp(
|
||||
}
|
||||
fileName = `${resultingName}${resultingExt}`;
|
||||
}
|
||||
const targetPath = await tempDir.path({
|
||||
prefix: fileName,
|
||||
suffix: '',
|
||||
});
|
||||
newApp = await fetchApp(stream, targetPath);
|
||||
newApp = onDownload
|
||||
? await onDownload({
|
||||
headers: /** @type {import('@appium/types').HTTPHeaders} */ (_.clone(headers)),
|
||||
stream,
|
||||
})
|
||||
: await fetchApp(stream, await tempDir.path({
|
||||
prefix: fileName,
|
||||
suffix: '',
|
||||
}));
|
||||
} finally {
|
||||
if (!stream.closed) {
|
||||
stream.destroy();
|
||||
@@ -285,12 +305,12 @@ async function configureApp(
|
||||
const archivePath = newApp;
|
||||
if (packageHash === cachedAppInfo?.packageHash) {
|
||||
const fullPath = cachedAppInfo?.fullPath;
|
||||
if (await isAppIntegrityOk(fullPath, cachedAppInfo?.integrity)) {
|
||||
if (await isAppIntegrityOk(/** @type {string} */ (fullPath), cachedAppInfo?.integrity)) {
|
||||
if (archivePath !== app) {
|
||||
await fs.rimraf(archivePath);
|
||||
}
|
||||
logger.info(`Will reuse previously cached application at '${fullPath}'`);
|
||||
return verifyAppExtension(fullPath, supportedAppExtensions);
|
||||
return verifyAppExtension(/** @type {string} */ (fullPath), supportedAppExtensions);
|
||||
}
|
||||
logger.info(
|
||||
`The application at '${fullPath}' does not exist anymore ` +
|
||||
@@ -518,7 +538,11 @@ async function unzipApp(zipPath, dstRoot, supportedAppExtensions) {
|
||||
}
|
||||
}
|
||||
|
||||
function isPackageOrBundle(app) {
|
||||
/**
|
||||
* @param {string} app
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isPackageOrBundle(app) {
|
||||
return /^([a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+)+$/.test(app);
|
||||
}
|
||||
|
||||
@@ -532,7 +556,7 @@ function isPackageOrBundle(app) {
|
||||
* @param {String} firstKey The first key to duplicate
|
||||
* @param {String} secondKey The second key to duplicate
|
||||
*/
|
||||
function duplicateKeys(input, firstKey, secondKey) {
|
||||
export function duplicateKeys(input, firstKey, secondKey) {
|
||||
// If array provided, recursively call on all elements
|
||||
if (_.isArray(input)) {
|
||||
return input.map((item) => duplicateKeys(item, firstKey, secondKey));
|
||||
@@ -563,7 +587,7 @@ function duplicateKeys(input, firstKey, secondKey) {
|
||||
*
|
||||
* @param {string|Array<String>} cap A desired capability
|
||||
*/
|
||||
function parseCapsArray(cap) {
|
||||
export function parseCapsArray(cap) {
|
||||
if (_.isArray(cap)) {
|
||||
return cap;
|
||||
}
|
||||
@@ -590,7 +614,7 @@ function parseCapsArray(cap) {
|
||||
* @param {string?} sessionId session identifier (if exists)
|
||||
* @returns {string}
|
||||
*/
|
||||
function generateDriverLogPrefix(obj, sessionId = null) {
|
||||
export function generateDriverLogPrefix(obj, sessionId = null) {
|
||||
const instanceName = `${obj.constructor.name}@${node.getObjectId(obj).substring(0, 4)}`;
|
||||
return sessionId ? `${instanceName} (${sessionId.substring(0, 8)})` : instanceName;
|
||||
}
|
||||
@@ -603,14 +627,6 @@ export default {
|
||||
parseCapsArray,
|
||||
generateDriverLogPrefix,
|
||||
};
|
||||
export {
|
||||
configureApp,
|
||||
isPackageOrBundle,
|
||||
duplicateKeys,
|
||||
parseCapsArray,
|
||||
generateDriverLogPrefix,
|
||||
BASEDRIVER_VER,
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef RemoteAppProps
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import ES6Error from 'es6-error';
|
||||
import _ from 'lodash';
|
||||
import {util, logger} from '@appium/support';
|
||||
import {StatusCodes as HTTPStatusCodes} from 'http-status-codes';
|
||||
@@ -8,8 +7,36 @@ const w3cLog = logger.getLogger('W3C');
|
||||
|
||||
const W3C_UNKNOWN_ERROR = 'unknown error';
|
||||
|
||||
class BaseError extends Error {
|
||||
constructor(message = '') {
|
||||
super(message);
|
||||
/** @type {[string, () => any][]} */
|
||||
const propsMap = [
|
||||
['message', () => message],
|
||||
['name', () => this.constructor.name],
|
||||
['stack', () => (new Error(message)).stack],
|
||||
];
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
const shouldSkipStack = Error.hasOwnProperty('captureStackTrace');
|
||||
for (const [propName, valueGetter] of propsMap) {
|
||||
if (propName === 'stack' && shouldSkipStack) {
|
||||
continue;
|
||||
}
|
||||
Object.defineProperty(this, propName, {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: valueGetter(),
|
||||
writable: true,
|
||||
});
|
||||
}
|
||||
if (shouldSkipStack) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// base error class for all of our errors
|
||||
export class ProtocolError extends ES6Error {
|
||||
export class ProtocolError extends BaseError {
|
||||
constructor(msg, jsonwpCode, w3cStatus, error) {
|
||||
super(msg);
|
||||
this.jsonwpCode = jsonwpCode;
|
||||
@@ -896,7 +923,7 @@ function generateBadParametersMessage(requiredParams, actualParams) {
|
||||
}
|
||||
|
||||
// Equivalent to W3C InvalidArgumentError
|
||||
export class BadParametersError extends ES6Error {
|
||||
export class BadParametersError extends BaseError {
|
||||
static error() {
|
||||
return 'invalid argument';
|
||||
}
|
||||
@@ -916,7 +943,7 @@ export class BadParametersError extends ES6Error {
|
||||
* In case of ProxyRequestError should fetch the actual error by calling `getActualError()`
|
||||
* for proxy failure to generate the client response.
|
||||
*/
|
||||
export class ProxyRequestError extends ES6Error {
|
||||
export class ProxyRequestError extends BaseError {
|
||||
constructor(err, responseError, httpStatus) {
|
||||
let responseErrorObj = util.safeJsonParse(responseError);
|
||||
if (!_.isPlainObject(responseErrorObj)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/base-driver",
|
||||
"version": "9.5.2",
|
||||
"version": "9.6.0",
|
||||
"description": "Base driver class for Appium drivers",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -44,28 +44,27 @@
|
||||
"test:types": "tsd"
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/types": "^0.16.1",
|
||||
"@appium/support": "^4.2.5",
|
||||
"@appium/types": "^0.17.0",
|
||||
"@colors/colors": "1.6.0",
|
||||
"@types/async-lock": "1.4.2",
|
||||
"@types/bluebird": "3.5.42",
|
||||
"@types/express": "4.17.21",
|
||||
"@types/lodash": "4.14.202",
|
||||
"@types/lodash": "4.17.0",
|
||||
"@types/method-override": "0.0.35",
|
||||
"@types/serve-favicon": "2.5.7",
|
||||
"async-lock": "1.4.1",
|
||||
"asyncbox": "3.0.0",
|
||||
"axios": "1.6.7",
|
||||
"axios": "1.6.8",
|
||||
"bluebird": "3.7.2",
|
||||
"body-parser": "1.20.2",
|
||||
"es6-error": "4.1.1",
|
||||
"express": "4.18.2",
|
||||
"express": "4.19.2",
|
||||
"http-status-codes": "2.3.0",
|
||||
"lodash": "4.17.21",
|
||||
"lru-cache": "10.2.0",
|
||||
"method-override": "3.0.0",
|
||||
"morgan": "1.10.0",
|
||||
"path-to-regexp": "6.2.1",
|
||||
"path-to-regexp": "6.2.2",
|
||||
"serve-favicon": "2.5.0",
|
||||
"source-map-support": "0.5.21",
|
||||
"type-fest": "4.10.1",
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.2.31](https://github.com/appium/appium/compare/@appium/base-plugin@2.2.30...@appium/base-plugin@2.2.31) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/base-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.2.30](https://github.com/appium/appium/compare/@appium/base-plugin@2.2.29...@appium/base-plugin@2.2.30) (2024-04-16)
|
||||
|
||||
**Note:** Version bump only for package @appium/base-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.2.29](https://github.com/appium/appium/compare/@appium/base-plugin@2.2.28...@appium/base-plugin@2.2.29) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/base-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.2.28](https://github.com/appium/appium/compare/@appium/base-plugin@2.2.27...@appium/base-plugin@2.2.28) (2024-02-13)
|
||||
|
||||
**Note:** Version bump only for package @appium/base-plugin
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/base-plugin",
|
||||
"version": "2.2.28",
|
||||
"version": "2.2.31",
|
||||
"description": "The base plugin used to create Appium 2.0 plugins",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -40,8 +40,8 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/base-driver": "^9.5.2",
|
||||
"@appium/support": "^4.2.2"
|
||||
"@appium/base-driver": "^9.6.0",
|
||||
"@appium/support": "^4.2.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
||||
|
||||
@@ -3,6 +3,35 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.0.36](https://github.com/appium/appium/compare/@appium/doctor@2.0.35...@appium/doctor@2.0.36) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/doctor
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.35](https://github.com/appium/appium/compare/@appium/doctor@2.0.34...@appium/doctor@2.0.35) (2024-04-16)
|
||||
|
||||
**Note:** Version bump only for package @appium/doctor
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.34](https://github.com/appium/appium/compare/@appium/doctor@2.0.33...@appium/doctor@2.0.34) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **doctor:** update dependency appium-adb to v12.0.4 ([df07665](https://github.com/appium/appium/commit/df076655098db68c986079037a794ce3477314bd))
|
||||
* **doctor:** update dependency appium-adb to v12.0.5 ([a6d49c1](https://github.com/appium/appium/commit/a6d49c1ac84c98ebe085abf32161d2f39c172d5a))
|
||||
* **doctor:** update dependency appium-adb to v12.0.6 ([26ab0ef](https://github.com/appium/appium/commit/26ab0ef7595580722f9a63a1c1e5c3bbef3b18f1))
|
||||
* **doctor:** update dependency appium-adb to v12.0.7 ([3936cb4](https://github.com/appium/appium/commit/3936cb43dceb45e1386c9418453a0dd734e32215))
|
||||
* **doctor:** update dependency appium-adb to v12.0.8 ([1f36882](https://github.com/appium/appium/commit/1f368828e6b3093a7317853e94437bb79955c399))
|
||||
|
||||
|
||||
|
||||
## [2.0.33](https://github.com/appium/appium/compare/@appium/doctor@2.0.32...@appium/doctor@2.0.33) (2024-02-13)
|
||||
|
||||
**Note:** Version bump only for package @appium/doctor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/doctor",
|
||||
"version": "2.0.33",
|
||||
"version": "2.0.36",
|
||||
"description": "Test environment for fitness to run Appium",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -44,11 +44,11 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/support": "^4.2.5",
|
||||
"@colors/colors": "1.6.0",
|
||||
"@types/bluebird": "3.5.42",
|
||||
"@types/teen_process": "2.0.4",
|
||||
"appium-adb": "12.0.3",
|
||||
"appium-adb": "12.0.8",
|
||||
"bluebird": "3.7.2",
|
||||
"inquirer": "9.2.12",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.0.7](https://github.com/appium/appium/compare/@appium/docutils@1.0.6...@appium/docutils@1.0.7) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/docutils
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.0.6](https://github.com/appium/appium/compare/@appium/docutils@1.0.5...@appium/docutils@1.0.6) (2024-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docutils:** update dependency typescript to v5.4.5 ([#19993](https://github.com/appium/appium/issues/19993)) ([d7cf013](https://github.com/appium/appium/commit/d7cf01340199edc30cf7befe351865e7c9124d1a))
|
||||
|
||||
|
||||
|
||||
## [1.0.5](https://github.com/appium/appium/compare/@appium/docutils@1.0.4...@appium/docutils@1.0.5) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docutils:** update dependency lilconfig to v3.1.0 ([f92640a](https://github.com/appium/appium/commit/f92640a824644545b680e23c7f3ec7f51de9df98))
|
||||
* **docutils:** update dependency lilconfig to v3.1.1 ([e04e4e9](https://github.com/appium/appium/commit/e04e4e902a212cf17ca79b3edc0b7545a1af507b))
|
||||
* **docutils:** update dependency typescript to v5.4.2 ([#19876](https://github.com/appium/appium/issues/19876)) ([2448fa0](https://github.com/appium/appium/commit/2448fa0145620657ccc72b5637f1b7737fe52580))
|
||||
* **docutils:** update dependency typescript to v5.4.3 ([cf79227](https://github.com/appium/appium/commit/cf792279b1df40f67fef0913b6f3e00a5a1a097d))
|
||||
* **docutils:** update dependency typescript to v5.4.4 ([5899c2d](https://github.com/appium/appium/commit/5899c2db93be1a72799f5c9d9cf9b0e731b5b1a1))
|
||||
* **docutils:** update dependency yaml to v2.4.0 ([26ded7a](https://github.com/appium/appium/commit/26ded7a4cce1fa9bca28521e4b60cad0edacbe96))
|
||||
* **docutils:** update dependency yaml to v2.4.1 ([636d6b3](https://github.com/appium/appium/commit/636d6b3802268ec6532f9f3a958f304c6760d172))
|
||||
|
||||
|
||||
|
||||
## [1.0.4](https://github.com/appium/appium/compare/@appium/docutils@1.0.3...@appium/docutils@1.0.4) (2024-02-13)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/docutils",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.7",
|
||||
"description": "Documentation generation utilities for Appium and related projects",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -48,15 +48,15 @@
|
||||
"start": "node ./build/lib/cli/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/tsconfig": "^0.x",
|
||||
"@appium/support": "^4.2.5",
|
||||
"@appium/tsconfig": "^0.3.3",
|
||||
"@sliphua/lilconfig-ts-loader": "3.2.2",
|
||||
"@types/which": "3.0.3",
|
||||
"chalk": "4.1.2",
|
||||
"consola": "3.2.3",
|
||||
"diff": "5.2.0",
|
||||
"json5": "2.2.3",
|
||||
"lilconfig": "3.0.0",
|
||||
"lilconfig": "3.1.1",
|
||||
"lodash": "4.17.21",
|
||||
"pkg-dir": "5.0.0",
|
||||
"read-pkg": "5.2.0",
|
||||
@@ -64,8 +64,8 @@
|
||||
"source-map-support": "0.5.21",
|
||||
"teen_process": "2.1.1",
|
||||
"type-fest": "4.10.1",
|
||||
"typescript": "5.2.2",
|
||||
"yaml": "2.3.4",
|
||||
"typescript": "5.4.5",
|
||||
"yaml": "2.4.1",
|
||||
"yargs": "17.7.2",
|
||||
"yargs-parser": "21.1.1"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mkdocs==1.5.3
|
||||
mkdocs-git-revision-date-localized-plugin==1.2.4
|
||||
mkdocs-material==9.5.9
|
||||
mkdocs-material==9.5.18
|
||||
mkdocs-redirects==1.2.1
|
||||
mike==2.0.0
|
||||
|
||||
@@ -3,6 +3,24 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.4.23](https://github.com/appium/appium/compare/@appium/driver-test-support@0.4.22...@appium/driver-test-support@0.4.23) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/driver-test-support
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [0.4.22](https://github.com/appium/appium/compare/@appium/driver-test-support@0.4.21...@appium/driver-test-support@0.4.22) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **driver-test-support:** update definitelytyped ([4776574](https://github.com/appium/appium/commit/47765747b66c5e0076f6ffe4619d6b98a42aee29))
|
||||
* **support:** update dependency axios to v1.6.8 ([bd6ab81](https://github.com/appium/appium/commit/bd6ab81c9408ab0f90fc25fc112f9257ec2973ad))
|
||||
|
||||
|
||||
|
||||
## [0.4.21](https://github.com/appium/appium/compare/@appium/driver-test-support@0.4.20...@appium/driver-test-support@0.4.21) (2024-02-06)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/driver-test-support",
|
||||
"version": "0.4.21",
|
||||
"version": "0.4.23",
|
||||
"description": "Test utilities for Appium drivers",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -41,10 +41,10 @@
|
||||
},
|
||||
"types": "./build/lib/index.d.ts",
|
||||
"dependencies": {
|
||||
"@appium/types": "^0.16.1",
|
||||
"@types/lodash": "4.14.202",
|
||||
"@appium/types": "^0.17.0",
|
||||
"@types/lodash": "4.17.0",
|
||||
"@types/stoppable": "1.1.3",
|
||||
"axios": "1.6.7",
|
||||
"axios": "1.6.8",
|
||||
"bluebird": "3.7.2",
|
||||
"chai": "4.4.1",
|
||||
"get-port": "5.1.1",
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.3.3](https://github.com/appium/appium/compare/@appium/eslint-config-appium-ts@0.3.2...@appium/eslint-config-appium-ts@0.3.3) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/eslint-config-appium-ts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [0.3.2](https://github.com/appium/appium/compare/@appium/eslint-config-appium-ts@0.3.1...@appium/eslint-config-appium-ts@0.3.2) (2023-10-18)
|
||||
|
||||
**Note:** Version bump only for package @appium/eslint-config-appium-ts
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/eslint-config-appium-ts",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"description": "Shared ESLint config for Appium projects (TypeScript version)",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
@@ -29,10 +29,10 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@appium/eslint-config-appium": "^8.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.5.0 || ^6.0.0",
|
||||
"@typescript-eslint/parser": "^5.5.0 || ^6.0.0",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.5.0 || ^9.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
||||
"@typescript-eslint/parser": "^7.0.0",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-import-resolver-typescript": "^3.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-mocha": "^10.1.0",
|
||||
|
||||
@@ -3,6 +3,40 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.0.28](https://github.com/appium/appium/compare/@appium/execute-driver-plugin@3.0.27...@appium/execute-driver-plugin@3.0.28) (2024-04-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.36.1 ([9ad20ff](https://github.com/appium/appium/commit/9ad20ff1c266923f3efe50bfe2ae4b1ab8ecb20a))
|
||||
|
||||
|
||||
|
||||
## [3.0.27](https://github.com/appium/appium/compare/@appium/execute-driver-plugin@3.0.26...@appium/execute-driver-plugin@3.0.27) (2024-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.36.0 ([#19998](https://github.com/appium/appium/issues/19998)) ([72f3284](https://github.com/appium/appium/commit/72f32848b68e6ef8c047f700ffd0be7d68c49aba))
|
||||
|
||||
|
||||
|
||||
## [3.0.26](https://github.com/appium/appium/compare/@appium/execute-driver-plugin@3.0.25...@appium/execute-driver-plugin@3.0.26) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.0 ([d25a0fc](https://github.com/appium/appium/commit/d25a0fca9b3a94880525fd956068f59427a40b26))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.1 ([ea8c74b](https://github.com/appium/appium/commit/ea8c74b372e73e88cf0303aa17db943014416e64))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.2 ([#19807](https://github.com/appium/appium/issues/19807)) ([6c034aa](https://github.com/appium/appium/commit/6c034aa84af573d36fa934c71d3d4ff328772553))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.3 ([f837a6a](https://github.com/appium/appium/commit/f837a6a9eaf34914ffdbfddcc3cb2f7e7427bc63))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.32.4 ([7516d41](https://github.com/appium/appium/commit/7516d4135a1eec37ba298f407254d825961795af))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.33.1 ([#19877](https://github.com/appium/appium/issues/19877)) ([0e6c3ee](https://github.com/appium/appium/commit/0e6c3eede250193fad390387ec494918367176d9))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.34.1 ([7fc7446](https://github.com/appium/appium/commit/7fc7446612f3257fa421dfec006d02730df10f59))
|
||||
* **execute-driver-plugin:** update dependency webdriverio to v8.35.1 ([63d7550](https://github.com/appium/appium/commit/63d7550d02f049a5c3bea5d27e7e8385d7698a4f))
|
||||
|
||||
|
||||
|
||||
## [3.0.25](https://github.com/appium/appium/compare/@appium/execute-driver-plugin@3.0.24...@appium/execute-driver-plugin@3.0.25) (2024-02-13)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/execute-driver-plugin",
|
||||
"version": "3.0.25",
|
||||
"version": "3.0.28",
|
||||
"description": "Plugin for batching and executing driver commands with Appiums",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -43,7 +43,7 @@
|
||||
"lodash": "4.17.21",
|
||||
"source-map-support": "0.5.21",
|
||||
"vm2": "3.9.19",
|
||||
"webdriverio": "8.31.1"
|
||||
"webdriverio": "8.36.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"appium": "^2.0.0-beta.35"
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.1.35](https://github.com/appium/appium/compare/@appium/fake-plugin@3.1.34...@appium/fake-plugin@3.1.35) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/fake-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.1.34](https://github.com/appium/appium/compare/@appium/fake-plugin@3.1.33...@appium/fake-plugin@3.1.34) (2024-04-16)
|
||||
|
||||
**Note:** Version bump only for package @appium/fake-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.1.33](https://github.com/appium/appium/compare/@appium/fake-plugin@3.1.32...@appium/fake-plugin@3.1.33) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/fake-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.1.32](https://github.com/appium/appium/compare/@appium/fake-plugin@3.1.31...@appium/fake-plugin@3.1.32) (2024-02-13)
|
||||
|
||||
**Note:** Version bump only for package @appium/fake-plugin
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/fake-plugin",
|
||||
"version": "3.1.32",
|
||||
"version": "3.1.35",
|
||||
"description": "A fake Appium 2.0 plugin",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -39,8 +39,8 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/base-plugin": "^2.2.28",
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/base-plugin": "^2.2.31",
|
||||
"@appium/support": "^4.2.5",
|
||||
"@types/bluebird": "3.5.42",
|
||||
"bluebird": "3.7.2",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.0.6](https://github.com/appium/appium/compare/@appium/images-plugin@3.0.5...@appium/images-plugin@3.0.6) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/images-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.5](https://github.com/appium/appium/compare/@appium/images-plugin@3.0.4...@appium/images-plugin@3.0.5) (2024-04-16)
|
||||
|
||||
**Note:** Version bump only for package @appium/images-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.4](https://github.com/appium/appium/compare/@appium/images-plugin@3.0.3...@appium/images-plugin@3.0.4) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/images-plugin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.3](https://github.com/appium/appium/compare/@appium/images-plugin@3.0.2...@appium/images-plugin@3.0.3) (2024-02-13)
|
||||
|
||||
**Note:** Version bump only for package @appium/images-plugin
|
||||
|
||||
@@ -38,7 +38,7 @@ To access these settings, you should use the Appium [Settings API](https://githu
|
||||
|fixImageFindScreenshotDims|Appium knows the screen dimensions, and ultimately these are the dimensions which are relevant for deciding where to tap on the screen. If the screenshot retrieved (via Appium's native methods, or an external source) does not match the screen dimensions, this setting dictates that Appium will adjust the size of the screenshot to match, ensuring that matched elements are found at the correct coordinates. Turn this setting off if you know it's not necessary, and Appium will forego the check, potentially speeding things up a bit.|`true` or `false`|`true`|
|
||||
|fixImageTemplateSize|OpenCV will not allow the matching of a reference image / template if that image is larger than the base image to match against. It can happen that the reference image you send in has dimensions which are larger than the screenshot Appium retrieves. In this case the match will automatically fail. If you set this setting to `true`, Appium will resize the template to ensure it is at least smaller than the size of the screenshot.|`true` or `false`|`false`|
|
||||
|fixImageTemplateScale| Appium resizes a base image to fit its window size before matching them with OpenCV. If you set this setting to `true`, Appium scales a reference image you send in as the same scale Appium scales the base image to fit the window size. e.g. iOS screenshot is `750 × 1334` pixels base image. The window size is `375 x 667`. Appium rescale the base image to window size scaling it with `0.5`. A reference image is based on the screenshot size, never the image matches with the window size scale. This settings allow Appium to scale the reference image with `0.5`. [appium-base-driver#306](https://github.com/appium/appium-base-driver/pull/306)| `true` or `false` | `false` |
|
||||
|defaultImageTemplateScale| Appium does not resize template images by default (the value of 1.0). Although, storing scaled template images might help to save size of the storage. E.g. One has could represent 1080 × 126 pixels area by 270 × 32 pixels template image (the value of defaultImageTemplateScale is expected to be set to 4.0). Check [appium-base-driver#307](https://github.com/appium/appium-base-driver/pull/307) for more details. |e.g., `0.5`, `10.0`, `100`| `1.0` |
|
||||
|defaultImageTemplateScale| Appium does not resize template images by default (the value of 1.0). Although, storing scaled template images might help to save size of the storage. E.g. One could represent 1080 × 126 pixels area by 270 × 32 pixels template image (the value of defaultImageTemplateScale is expected to be set to 4.0). Check [appium-base-driver#307](https://github.com/appium/appium-base-driver/pull/307) for more details. |e.g., `0.5`, `10.0`, `100`| `1.0` |
|
||||
|checkForImageElementStaleness|It can happen that, in between the time you have matched an image element and the time you choose to tap on it, the element is no longer present. The only way for Appium to determine this is to attempt to re-match the template immediately before tapping. If that re-match fails, you will get a `StaleElementException`, as you would expect. Turn this to `false` to skip the check, potentially speeding things up, but potentially running into stale element issues without the benefit of an exception to let you know you did.|`true` or `false`|`true`|
|
||||
|autoUpdateImageElementPosition|It can happen that a matched image changes position in between the time it is found and the time you tap on it. As with the previous setting, Appium can automatically adjust its position if it determines in a re-match that the position changed.|`true` or `false`|`false`|
|
||||
|imageElementTapStrategy|In order to tap on a found image element, Appium has to use one of its touch action strategies. The available strategies are the W3C Actions API, or the older MJSONWP TouchActions API. Stick to the default unless the driver you are using does not support the W3C Actions API for some reason.|`"w3cActions"` or `"touchActions"`|`"w3cActions"`|
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/images-plugin",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.6",
|
||||
"description": "Plugin for working with images and image elements in Appium",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -39,11 +39,11 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/opencv": "^3.0.2",
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/opencv": "^3.0.3",
|
||||
"@appium/support": "^4.2.5",
|
||||
"lodash": "4.17.21",
|
||||
"lru-cache": "10.2.0",
|
||||
"sharp": "0.33.2",
|
||||
"sharp": "0.33.3",
|
||||
"source-map-support": "0.5.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.0.3](https://github.com/appium/appium/compare/@appium/opencv@3.0.2...@appium/opencv@3.0.3) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/opencv
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.2](https://github.com/appium/appium/compare/@appium/opencv@3.0.1...@appium/opencv@3.0.2) (2024-02-06)
|
||||
|
||||
**Note:** Version bump only for package @appium/opencv
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/opencv",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.3",
|
||||
"description": "OpenCV-related helper library",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -45,7 +45,7 @@
|
||||
"bluebird": "3.7.2",
|
||||
"lodash": "4.17.21",
|
||||
"opencv-bindings": "4.5.5",
|
||||
"sharp": "0.33.2",
|
||||
"sharp": "0.33.3",
|
||||
"source-map-support": "0.5.21"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -3,6 +3,23 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.3.30](https://github.com/appium/appium/compare/@appium/plugin-test-support@0.3.29...@appium/plugin-test-support@0.3.30) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/plugin-test-support
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [0.3.29](https://github.com/appium/appium/compare/@appium/plugin-test-support@0.3.28...@appium/plugin-test-support@0.3.29) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docutils:** update dependency typescript to v5.4.2 ([#19876](https://github.com/appium/appium/issues/19876)) ([2448fa0](https://github.com/appium/appium/commit/2448fa0145620657ccc72b5637f1b7737fe52580))
|
||||
|
||||
|
||||
|
||||
## [0.3.28](https://github.com/appium/appium/compare/@appium/plugin-test-support@0.3.27...@appium/plugin-test-support@0.3.28) (2024-02-06)
|
||||
|
||||
**Note:** Version bump only for package @appium/plugin-test-support
|
||||
|
||||
@@ -111,7 +111,7 @@ export function pluginE2EHarness(opts) {
|
||||
console.log(`${info} Will use port ${port} for Appium server`);
|
||||
this.port = port;
|
||||
|
||||
/** @type {import('appium').Args} */
|
||||
/** @type {import('appium/types').Args} */
|
||||
const args = {
|
||||
port,
|
||||
address: host,
|
||||
@@ -141,7 +141,7 @@ export function pluginE2EHarness(opts) {
|
||||
* @property {string} [appiumHome] - Path to Appium home directory
|
||||
* @property {Mocha.before} before - Mocha "before all" hook function
|
||||
* @property {Mocha.after} after - Mocha "after all" hook function
|
||||
* @property {Partial<import('appium').Args>} [serverArgs] - Arguments to pass to Appium server
|
||||
* @property {Partial<import('appium/types').Args>} [serverArgs] - Arguments to pass to Appium server
|
||||
* @property {import('appium/types').InstallType & string} driverSource - Source of driver to install
|
||||
* @property {string} [driverPackage] - Package name of driver to install
|
||||
* @property {string} driverName - Name of driver to install
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/plugin-test-support",
|
||||
"version": "0.3.28",
|
||||
"version": "0.3.30",
|
||||
"description": "Testing utilities for Appium plugins",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -41,7 +41,7 @@
|
||||
"test:unit": "exit 0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/types": "^0.16.1",
|
||||
"@appium/types": "^0.17.0",
|
||||
"get-port": "5.1.1",
|
||||
"log-symbols": "4.1.0",
|
||||
"source-map-support": "0.5.21",
|
||||
|
||||
@@ -3,6 +3,44 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [4.2.5](https://github.com/appium/appium/compare/@appium/support@4.2.4...@appium/support@4.2.5) (2024-04-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **support:** Enable shell option for all npm-related commands on Windows ([#20010](https://github.com/appium/appium/issues/20010)) ([270fd42](https://github.com/appium/appium/commit/270fd42a2086e68d061e4bad5cb504125e22a493))
|
||||
* **support:** update dependency yauzl to v3.1.3 ([#20017](https://github.com/appium/appium/issues/20017)) ([77a27ab](https://github.com/appium/appium/commit/77a27ab16cb9ec6038f9b88762fe7f08c7871a48))
|
||||
|
||||
|
||||
|
||||
## [4.2.4](https://github.com/appium/appium/compare/@appium/support@4.2.3...@appium/support@4.2.4) (2024-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **support:** Enable `shell` option on Windows ([#19996](https://github.com/appium/appium/issues/19996)) ([572037a](https://github.com/appium/appium/commit/572037a0e256ea1ac0d7b0551463b79e07f9e56f))
|
||||
|
||||
|
||||
|
||||
## [4.2.3](https://github.com/appium/appium/compare/@appium/support@4.2.2...@appium/support@4.2.3) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** make --log-filters work ([#19825](https://github.com/appium/appium/issues/19825)) ([0d5a0a5](https://github.com/appium/appium/commit/0d5a0a572787d913412bbfd70835e5ba8f94334c))
|
||||
* **support:** update dependency @types/semver to v7.5.8 ([d1705e2](https://github.com/appium/appium/commit/d1705e2818d435b4c37cb70753af1de5427378e2))
|
||||
* **support:** update dependency archiver to v6.0.2 ([e4ae277](https://github.com/appium/appium/commit/e4ae2772acf6cd1c2119dd7f8c1f7804e3a2394f))
|
||||
* **support:** update dependency archiver to v7 ([#19844](https://github.com/appium/appium/issues/19844)) ([c905be0](https://github.com/appium/appium/commit/c905be032fd97fcce726097e4f861b142a355f0d))
|
||||
* **support:** update dependency archiver to v7.0.1 ([b126df6](https://github.com/appium/appium/commit/b126df6234625a5c90a1b171e2844ed666120b8d))
|
||||
* **support:** update dependency axios to v1.6.8 ([bd6ab81](https://github.com/appium/appium/commit/bd6ab81c9408ab0f90fc25fc112f9257ec2973ad))
|
||||
* **support:** update dependency glob to v10.3.12 ([#19937](https://github.com/appium/appium/issues/19937)) ([9a0c059](https://github.com/appium/appium/commit/9a0c059c3ae3f762fa31b91eb903fd76e827f96d))
|
||||
* **support:** update dependency yauzl to v3 ([#19790](https://github.com/appium/appium/issues/19790)) ([41cb869](https://github.com/appium/appium/commit/41cb86945314869b8c5165d62b9790403fc07985))
|
||||
* **support:** update dependency yauzl to v3 ([#19809](https://github.com/appium/appium/issues/19809)) ([bd7b420](https://github.com/appium/appium/commit/bd7b42007d4b02a798344e722840975e7e975624))
|
||||
* **support:** update dependency yauzl to v3 ([#19878](https://github.com/appium/appium/issues/19878)) ([3da17b6](https://github.com/appium/appium/commit/3da17b6ecdfe9d55300b7e7b13605352a24ab347))
|
||||
* **support:** update dependency yauzl to v3.1.1 ([#19845](https://github.com/appium/appium/issues/19845)) ([e1ccdd2](https://github.com/appium/appium/commit/e1ccdd2d483e78e2e8f55508d80b712bd6a33b38))
|
||||
|
||||
|
||||
|
||||
## [4.2.2](https://github.com/appium/appium/compare/@appium/support@4.2.1...@appium/support@4.2.2) (2024-02-13)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import fs from './fs';
|
||||
import _ from 'lodash';
|
||||
|
||||
const DEFAULT_REPLACER = '**SECURE**';
|
||||
@@ -28,8 +27,8 @@ class SecureValuesPreprocessor {
|
||||
/**
|
||||
* Parses single rule from the given JSON file
|
||||
*
|
||||
* @param {string|import('@appium/types').LogFilter} rule The rule might either be represented as a single string
|
||||
* or a configuration object
|
||||
* @param {string|import('@appium/types').LogFilter} rule The rule might
|
||||
* either be represented as a single string or a configuration object
|
||||
* @throws {Error} If there was an error while parsing the rule
|
||||
* @returns {SecureValuePreprocessingRule} The parsed rule
|
||||
*/
|
||||
@@ -90,36 +89,31 @@ class SecureValuesPreprocessor {
|
||||
/**
|
||||
* Loads rules from the given JSON file
|
||||
*
|
||||
* @param {string|string[]|import('@appium/types').LogFiltersConfig} source The full path to the JSON file containing secure
|
||||
* values replacement rules or the rules themselves represented as an array
|
||||
* @param {string|string[]|import('@appium/types').LogFiltersConfig} filters
|
||||
* One or more log parsing rules
|
||||
* @throws {Error} If the format of the source file is invalid or
|
||||
* it does not exist
|
||||
* @returns {Promise<string[]>} The list of issues found while parsing each rule.
|
||||
* An empty list is returned if no rule parsing issues were found
|
||||
*/
|
||||
async loadRules(source) {
|
||||
let rules;
|
||||
if (_.isArray(source)) {
|
||||
rules = source;
|
||||
} else {
|
||||
if (!(await fs.exists(source))) {
|
||||
throw new Error(`'${source}' does not exist or is not accessible`);
|
||||
}
|
||||
try {
|
||||
rules = JSON.parse(await fs.readFile(source, 'utf8'));
|
||||
} catch (e) {
|
||||
throw new Error(`'${source}' must be a valid JSON file. Original error: ${e.message}`);
|
||||
}
|
||||
if (!_.isArray(rules)) {
|
||||
throw new Error(`'${source}' must contain a valid JSON array`);
|
||||
async loadRules(filters) {
|
||||
/** @type {string[]} */
|
||||
const issues = [];
|
||||
/** @type {(import('@appium/types').LogFilter|string)[]} */
|
||||
const rawRules = [];
|
||||
for (const source of (_.isArray(filters) ? filters : [filters])) {
|
||||
if (_.isPlainObject(source)) {
|
||||
rawRules.push(/** @type {import('@appium/types').LogFilter} */ (source));
|
||||
} else if (_.isString(source)) {
|
||||
rawRules.push(source);
|
||||
} else {
|
||||
issues.push(`'${source}' must be a valid log filtering rule`);
|
||||
}
|
||||
}
|
||||
|
||||
const issues = [];
|
||||
this._rules = [];
|
||||
for (const rule of rules) {
|
||||
for (const rawRule of rawRules) {
|
||||
try {
|
||||
this._rules.push(this.parseRule(rule));
|
||||
this._rules.push(this.parseRule(rawRule));
|
||||
} catch (e) {
|
||||
issues.push(e.message);
|
||||
}
|
||||
|
||||
@@ -44,11 +44,16 @@ export class NPM {
|
||||
* @param {Omit<TeenProcessExecOptions, 'cwd'>} [execOpts]
|
||||
*/
|
||||
async exec(cmd, args, opts, execOpts = {}) {
|
||||
let {cwd, json, lockFile} = opts;
|
||||
const {cwd, json, lockFile} = opts;
|
||||
|
||||
// make sure we perform the current operation in cwd
|
||||
/** @type {TeenProcessExecOptions} */
|
||||
const teenProcessExecOpts = {...execOpts, cwd};
|
||||
const teenProcessExecOpts = {
|
||||
...execOpts,
|
||||
// https://github.com/nodejs/node/issues/52572
|
||||
shell: system.isWindows() || execOpts.shell,
|
||||
cwd,
|
||||
};
|
||||
|
||||
args.unshift(cmd);
|
||||
if (json) {
|
||||
@@ -272,7 +277,7 @@ export class NPM {
|
||||
async getPackageInfo(pkg, entries = []) {
|
||||
return (await this.exec('info', [pkg, ...entries], {
|
||||
cwd: process.cwd(),
|
||||
json: true
|
||||
json: true,
|
||||
})).json;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/support",
|
||||
"version": "4.2.2",
|
||||
"version": "4.2.5",
|
||||
"description": "Support libs used across appium packages",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -41,8 +41,8 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/tsconfig": "^0.x",
|
||||
"@appium/types": "^0.16.1",
|
||||
"@appium/tsconfig": "^0.3.3",
|
||||
"@appium/types": "^0.17.0",
|
||||
"@colors/colors": "1.6.0",
|
||||
"@types/archiver": "6.0.2",
|
||||
"@types/base64-stream": "1.0.5",
|
||||
@@ -54,21 +54,21 @@
|
||||
"@types/ncp": "2.0.8",
|
||||
"@types/npmlog": "7.0.0",
|
||||
"@types/pluralize": "0.0.33",
|
||||
"@types/semver": "7.5.7",
|
||||
"@types/semver": "7.5.8",
|
||||
"@types/shell-quote": "1.7.5",
|
||||
"@types/supports-color": "8.1.3",
|
||||
"@types/teen_process": "2.0.4",
|
||||
"@types/uuid": "9.0.8",
|
||||
"@types/which": "3.0.3",
|
||||
"archiver": "6.0.1",
|
||||
"axios": "1.6.7",
|
||||
"archiver": "7.0.1",
|
||||
"axios": "1.6.8",
|
||||
"base64-stream": "1.0.0",
|
||||
"bluebird": "3.7.2",
|
||||
"bplist-creator": "0.1.1",
|
||||
"bplist-parser": "0.3.2",
|
||||
"form-data": "4.0.0",
|
||||
"get-stream": "6.0.1",
|
||||
"glob": "10.3.10",
|
||||
"glob": "10.3.12",
|
||||
"jsftp": "2.1.3",
|
||||
"klaw": "4.1.0",
|
||||
"lockfile": "1.0.4",
|
||||
@@ -93,10 +93,10 @@
|
||||
"type-fest": "4.10.1",
|
||||
"uuid": "9.0.1",
|
||||
"which": "4.0.0",
|
||||
"yauzl": "2.10.0"
|
||||
"yauzl": "3.1.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"sharp": "0.33.2"
|
||||
"sharp": "0.33.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import {fs} from '../../lib/index';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import {SecureValuesPreprocessor} from '../../lib/log-internal';
|
||||
|
||||
const CONFIG_PATH = path.resolve(os.tmpdir(), 'rules.json');
|
||||
|
||||
describe('Log Internals', function () {
|
||||
/** @type {import('../../lib/log-internal').SecureValuesPreprocessor} */
|
||||
let preprocessor;
|
||||
@@ -79,13 +74,4 @@ describe('Log Internals', function () {
|
||||
preprocessor.rules.length.should.eql(0);
|
||||
preprocessor.preprocess(':yolo" yo Yolo yyolo').should.eql(':yolo" yo Yolo yyolo');
|
||||
});
|
||||
|
||||
it('should fail if rules cannot be accessed', async function () {
|
||||
await preprocessor.loadRules('bla').should.eventually.be.rejected;
|
||||
});
|
||||
|
||||
it('should fail if rules JSON cannot be parsed', async function () {
|
||||
await fs.writeFile(CONFIG_PATH, 'blabla', 'utf8');
|
||||
await preprocessor.loadRules(CONFIG_PATH).should.eventually.be.rejected;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.0.35](https://github.com/appium/appium/compare/@appium/test-support@3.0.34...@appium/test-support@3.0.35) (2024-04-21)
|
||||
|
||||
**Note:** Version bump only for package @appium/test-support
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.34](https://github.com/appium/appium/compare/@appium/test-support@3.0.33...@appium/test-support@3.0.34) (2024-04-16)
|
||||
|
||||
**Note:** Version bump only for package @appium/test-support
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.33](https://github.com/appium/appium/compare/@appium/test-support@3.0.32...@appium/test-support@3.0.33) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/test-support
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.32](https://github.com/appium/appium/compare/@appium/test-support@3.0.31...@appium/test-support@3.0.32) (2024-02-13)
|
||||
|
||||
**Note:** Version bump only for package @appium/test-support
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/test-support",
|
||||
"version": "3.0.32",
|
||||
"version": "3.0.35",
|
||||
"description": "A collection of test utilities used across Appium packages",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -45,7 +45,7 @@
|
||||
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/support": "^4.2.2",
|
||||
"@appium/support": "^4.2.5",
|
||||
"@colors/colors": "1.6.0",
|
||||
"bluebird": "3.7.2",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.3.3](https://github.com/appium/appium/compare/@appium/tsconfig@0.3.2...@appium/tsconfig@0.3.3) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **tsconfig:** update dependency @tsconfig/node14 to v14.1.1 ([de057fa](https://github.com/appium/appium/commit/de057fa8b043a26f4854c930df5a560d89808ca6))
|
||||
* **tsconfig:** update dependency @tsconfig/node14 to v14.1.2 ([66626d2](https://github.com/appium/appium/commit/66626d26e52b6241b5618dc1052c86d48230d15e))
|
||||
|
||||
|
||||
|
||||
## [0.3.2](https://github.com/appium/appium/compare/@appium/tsconfig@0.3.1...@appium/tsconfig@0.3.2) (2023-10-18)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/tsconfig",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"description": "Shared TypeScript Config for Appium",
|
||||
"main": "tsconfig.json",
|
||||
"keywords": [
|
||||
@@ -27,7 +27,7 @@
|
||||
"npm": ">=8"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tsconfig/node14": "14.1.0"
|
||||
"@tsconfig/node14": "14.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test:smoke": "node tsconfig.json && node tsconfig.plugin.json"
|
||||
|
||||
@@ -3,6 +3,23 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [0.17.0](https://github.com/appium/appium/compare/@appium/types@0.16.2...@appium/types@0.17.0) (2024-04-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **base-driver:** Add onDownload handler to the configureApp helper ([#20015](https://github.com/appium/appium/issues/20015)) ([8cf3efd](https://github.com/appium/appium/commit/8cf3efdbed6c0868f2d7838e249a3d2478f186d4))
|
||||
|
||||
|
||||
|
||||
## [0.16.2](https://github.com/appium/appium/compare/@appium/types@0.16.1...@appium/types@0.16.2) (2024-04-08)
|
||||
|
||||
**Note:** Version bump only for package @appium/types
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [0.16.1](https://github.com/appium/appium/compare/@appium/types@0.16.0...@appium/types@0.16.1) (2024-02-06)
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,19 @@ export type PointerDownAction = {
|
||||
button: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* @group Actions
|
||||
*/
|
||||
export type ScrollAction = {
|
||||
type: 'scroll';
|
||||
x: number;
|
||||
y: number;
|
||||
deltaX: number;
|
||||
deltaY: number;
|
||||
duration?: number;
|
||||
origin?: 'viewport' | Element;
|
||||
};
|
||||
|
||||
/**
|
||||
* @group Actions
|
||||
*/
|
||||
@@ -72,6 +85,11 @@ export type KeyAction = PauseAction | KeyDownAction | KeyUpAction;
|
||||
*/
|
||||
export type PointerAction = PauseAction | PointerMoveAction | PointerUpAction | PointerDownAction;
|
||||
|
||||
/**
|
||||
* @group Actions
|
||||
*/
|
||||
export type WheelAction = PauseAction | ScrollAction;
|
||||
|
||||
/**
|
||||
* @group Actions
|
||||
*/
|
||||
@@ -110,7 +128,20 @@ export type PointerActionSequence = {
|
||||
/**
|
||||
* @group Actions
|
||||
*/
|
||||
export type ActionSequence = NullActionSequence | KeyActionSequence | PointerActionSequence;
|
||||
export type WheelActionSequence = {
|
||||
type: 'wheel';
|
||||
id: string;
|
||||
actions: WheelAction[];
|
||||
};
|
||||
|
||||
/**
|
||||
* @group Actions
|
||||
*/
|
||||
export type ActionSequence =
|
||||
| NullActionSequence
|
||||
| KeyActionSequence
|
||||
| PointerActionSequence
|
||||
| WheelActionSequence;
|
||||
|
||||
/**
|
||||
* @group Actions
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {HTTPHeaders, HTTPMethod} from './http';
|
||||
import type {AppiumLogger} from './logger';
|
||||
import type {AppiumServer, UpdateServerCallback} from './server';
|
||||
import type {Class, Element, StringRecord} from './util';
|
||||
import type internal from 'node:stream';
|
||||
|
||||
/**
|
||||
* Interface implemented by the `DeviceSettings` class in `@appium/base-driver`
|
||||
@@ -2055,11 +2056,11 @@ export interface CachedAppInfo {
|
||||
/**
|
||||
* Date instance; the value of the file's `Last-Modified` header
|
||||
*/
|
||||
lastModified?: Date;
|
||||
lastModified?: Date|null;
|
||||
/**
|
||||
* The value of the file's `Etag` header
|
||||
*/
|
||||
etag?: string;
|
||||
etag?: string|null;
|
||||
/**
|
||||
* `true` if the file contains an `immutable` mark in `Cache-control` header
|
||||
*/
|
||||
@@ -2067,7 +2068,7 @@ export interface CachedAppInfo {
|
||||
/**
|
||||
* Integer representation of `maxAge` parameter in `Cache-control` header
|
||||
*/
|
||||
maxAge?: number;
|
||||
maxAge?: number|null;
|
||||
/**
|
||||
* The timestamp this item has been added to the cache (measured in Unix epoch milliseconds)
|
||||
*/
|
||||
@@ -2109,6 +2110,18 @@ export interface PostProcessOptions<Headers = HTTPHeaders> {
|
||||
appPath?: string;
|
||||
}
|
||||
|
||||
export interface DownloadAppOptions<Headers = HTTPHeaders> {
|
||||
/**
|
||||
* Response headers from the download url.
|
||||
*/
|
||||
headers: Headers;
|
||||
|
||||
/**
|
||||
* Response stream.
|
||||
*/
|
||||
stream: internal.Readable;
|
||||
}
|
||||
|
||||
export interface ConfigureAppOptions {
|
||||
/**
|
||||
*
|
||||
@@ -2124,5 +2137,17 @@ export interface ConfigureAppOptions {
|
||||
onPostProcess?: (
|
||||
obj: PostProcessOptions,
|
||||
) => Promise<PostProcessResult | undefined> | PostProcessResult | undefined;
|
||||
/**
|
||||
* Optional function, which should be applied to the application upon download
|
||||
* progress initialization instead of the standard download handler.
|
||||
* The callback does not get invoked if the original application is not a URL.
|
||||
* It is expected that `onPostProcess` is also provided if this callback is defined.
|
||||
* Otherwise, there is a possibility the app configuration flow could be broken.
|
||||
*
|
||||
* @returns The full path to the downloaded app
|
||||
*/
|
||||
onDownload?: (
|
||||
obj: DownloadAppOptions,
|
||||
) => Promise<string>;
|
||||
supportedExtensions: string[];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/types",
|
||||
"version": "0.16.1",
|
||||
"version": "0.17.0",
|
||||
"description": "Various type declarations used across Appium",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -39,7 +39,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@appium/schema": "^0.5.0",
|
||||
"@appium/tsconfig": "^0.x",
|
||||
"@appium/tsconfig": "^0.3.3",
|
||||
"@types/express": "4.17.21",
|
||||
"@types/npmlog": "7.0.0",
|
||||
"@types/ws": "8.5.10",
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.0.18](https://github.com/appium/appium-plugins/compare/@appium/universal-xml-plugin@1.0.17...@appium/universal-xml-plugin@1.0.18) (2024-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **universal-xml-plugin:** update dependency fast-xml-parser to v4.3.5 ([f59e84e](https://github.com/appium/appium-plugins/commit/f59e84e24c3f4a47df891ea369d010a05fab59dd))
|
||||
* **universal-xml-plugin:** update dependency fast-xml-parser to v4.3.6 ([111b05c](https://github.com/appium/appium-plugins/commit/111b05c922de668be2f3332298e49f13c0a41b9c))
|
||||
|
||||
|
||||
|
||||
## [1.0.17](https://github.com/appium/appium-plugins/compare/@appium/universal-xml-plugin@1.0.16...@appium/universal-xml-plugin@1.0.17) (2024-02-06)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@appium/universal-xml-plugin",
|
||||
"version": "1.0.17",
|
||||
"version": "1.0.18",
|
||||
"description": "Appium plugin for making XML source and XPath queries the same across iOS and Android",
|
||||
"keywords": [
|
||||
"automation",
|
||||
@@ -38,7 +38,7 @@
|
||||
"dependencies": {
|
||||
"@types/xmldom": "0.1.34",
|
||||
"@xmldom/xmldom": "0.8.10",
|
||||
"fast-xml-parser": "4.3.4",
|
||||
"fast-xml-parser": "4.3.6",
|
||||
"lodash": "4.17.21",
|
||||
"source-map-support": "0.5.21",
|
||||
"xpath": "0.0.34"
|
||||
|
||||
Reference in New Issue
Block a user