mirror of
https://github.com/appium/appium.git
synced 2026-11-11 04:23:55 +08:00
Compare commits
68
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3110461750 | ||
|
|
79127eee19 | ||
|
|
af3063b5ac | ||
|
|
db4c057cf8 | ||
|
|
1f8a7981d5 | ||
|
|
1e30207ec4 | ||
|
|
6040817982 | ||
|
|
f7f6e72ca7 | ||
|
|
0c9171a073 | ||
|
|
015fe98c04 | ||
|
|
c77a01cccf | ||
|
|
fcfa7151e3 | ||
|
|
f5d0045014 | ||
|
|
bae236aae5 | ||
|
|
1905b2ac85 | ||
|
|
29f7f9e741 | ||
|
|
5dbb9a403b | ||
|
|
10373683d9 | ||
|
|
7d0832ed59 | ||
|
|
bfe01b344b | ||
|
|
eb2c7aaf1b | ||
|
|
ae4b1fa917 | ||
|
|
12dc5cf652 | ||
|
|
562e1d52c4 | ||
|
|
78bd23abcb | ||
|
|
0b9e80f9ac | ||
|
|
48726516d0 | ||
|
|
92bf2ca065 | ||
|
|
f40a2070ba | ||
|
|
ac3059b662 | ||
|
|
ef966aa862 | ||
|
|
024aab3f45 | ||
|
|
1e8b1e361c | ||
|
|
a539a56130 | ||
|
|
f25bb663a2 | ||
|
|
8667777b01 | ||
|
|
2835b953be | ||
|
|
974a8c3891 | ||
|
|
d37090e67e | ||
|
|
297d70f70a | ||
|
|
ca001513ab | ||
|
|
5b72c1e6ff | ||
|
|
05466e45a7 | ||
|
|
ea8ac8a57c | ||
|
|
f1a56274fe | ||
|
|
f1dadc4c98 | ||
|
|
3d7d9802ab | ||
|
|
84aaf5eae6 | ||
|
|
b4b4c3cc89 | ||
|
|
628dc1aef2 | ||
|
|
793e9e17e0 | ||
|
|
87b64b9a18 | ||
|
|
7a7d0ced10 | ||
|
|
a776456ed5 | ||
|
|
d9bb604fb6 | ||
|
|
9d8779a224 | ||
|
|
a1ef920af1 | ||
|
|
149ce03b84 | ||
|
|
09437412c8 | ||
|
|
0256991162 | ||
|
|
604170a7ad | ||
|
|
509ab16612 | ||
|
|
6184bf96b6 | ||
|
|
12e28c9e08 | ||
|
|
090640e348 | ||
|
|
a5c6f1c80e | ||
|
|
8d181dd19f | ||
|
|
eb189d4588 |
@@ -0,0 +1,37 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm run clean
|
||||
- run: npm run test
|
||||
- run: npm run e2e-test
|
||||
|
||||
generate_docs:
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js 12.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
- run: npm run clean
|
||||
- run: npm run generate-docs
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
language: node_js
|
||||
node_js: "10"
|
||||
os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
- build-essential
|
||||
env:
|
||||
global:
|
||||
- CXX=g++-4.8
|
||||
cache:
|
||||
npm: false
|
||||
jobs:
|
||||
include:
|
||||
- stage: Tests
|
||||
name: node 10
|
||||
before_script: npm outdated || true
|
||||
script: npm run test && npm run e2e-test
|
||||
after_script: npm run coverage
|
||||
- stage:
|
||||
name: node 12
|
||||
before_script: npm outdated || true
|
||||
script: npm run test && npm run e2e-test
|
||||
node_js: "12"
|
||||
- stage:
|
||||
name: test documentation generation
|
||||
script: npm run generate-docs
|
||||
+92
-1
@@ -1,3 +1,94 @@
|
||||
CHANGES IN VERSION 1.20.2 (FROM 1.20.1)
|
||||
===================================
|
||||
|
||||
Appium 1.20.2 is a patch release
|
||||
|
||||
### Android(UIAutomator2)
|
||||
* Fix element caching performance [appium-uiautomator2-server#406](https://github.com/appium/appium-uiautomator2-server/pull/406)
|
||||
|
||||
CHANGES IN VERSION 1.20.1 (FROM 1.20.0)
|
||||
===================================
|
||||
|
||||
Appium 1.20.1 is a patch release
|
||||
|
||||
### Android(UIAutomator2)
|
||||
* Fix setting the session capabilities [appium-uiautomator2-server#404](https://github.com/appium/appium-uiautomator2-server/pull/404)
|
||||
|
||||
CHANGES IN VERSION 1.20.0 (FROM 1.19.1)
|
||||
===================================
|
||||
|
||||
Appium 1.20.0 is a minor release
|
||||
|
||||
### General
|
||||
* Does not destory sockets explicitly against a client [appium-base-driver#437](https://github.com/appium/appium-base-driver/pull/437)
|
||||
* Connection timeout to each driver respects `--keep-alive-timeout` configuration [appium-base-driver#443](https://github.com/appium/appium-base-driver/pull/443). Default to 10 minutes
|
||||
|
||||
### Android General
|
||||
* `InvalidContextError` error is thrown if running instrumentation process was dead
|
||||
* Fix Android emulator config paths on Windows [appium-adb#558](https://github.com/appium/appium-adb/pull/558)
|
||||
|
||||
### Android(UIAutomator2)
|
||||
* Appium adds `io.appium.settings`, `io.appium.uiautomator2.server` and `io.appium.uiautomator2.server.test` as the device's Doze whitelist to keep working [appium-uiautomator2-driver#420](https://github.com/appium/appium-uiautomator2-driver/pull/420)
|
||||
* Add settings:
|
||||
* `useResourcesForOrientationDetection` to use application resource propertires to determine the current device orientation [appium-uiautomator2-server#389](https://github.com/appium/appium-uiautomator2-server/pull/389)
|
||||
|
||||
### Android(Espresso)
|
||||
* Appium adds `io.appium.settings` and `io.appium.espressoserver.test` as the device's Doze whitelist to keep working [appium-espresso-driver#627](https://github.com/appium/appium-espresso-driver/pull/627)
|
||||
* Add `mobile:` extensions:
|
||||
* `uiautomatorPageSource` returns the page source dump by UIAutomator [appium-espresso-driver#628](https://github.com/appium/appium-espresso-driver/pull/628)
|
||||
* Improves XPath lookup performance [appium-espresso-driver#637](https://github.com/appium/appium-espresso-driver/pull/637)
|
||||
|
||||
### iOS General
|
||||
* Fix updating simulator preference method [appium-ios-simulator#298](https://github.com/appium/appium-ios-simulator/pull/298)
|
||||
|
||||
### iOS(XCUITest)
|
||||
* Support M1 chip based Mac, Xcode 12.3
|
||||
* Snapshots caching logic has been rewritten to improve lookup performance e.g. [WebDriverAgent#404](https://github.com/appium/WebDriverAgent/pull/404), [WebDriverAgent#407](https://github.com/appium/WebDriverAgent/pull/407)
|
||||
* Breaking changes
|
||||
* Support over Xcode 10.2, iOS 12.2 (Drop supporting Xcode 10.0 and 10.1)
|
||||
* `accessibility id`, `name` and `id` lookup strategies now find elements by `name`(`wdName`) attributes in page source: [WebDriverAgent#414](https://github.com/appium/WebDriverAgent/pull/414)
|
||||
* Previously, they found elements by `name`(`wdName`) and `value`(`wdValue`)
|
||||
* Please use `predicate` strategy to find `value`(`wdValue`) attribute like [this change](https://github.com/appium/ruby_lib_core/pull/282)
|
||||
* Add capabilities:
|
||||
* `resultBundlePath` and `resultBundleVersion` to allow to specify the path to the result bundle of WebDriverAgent xcodebuild [WebDriverAgent#410](https://github.com/appium/WebDriverAgent/pull/410)
|
||||
* `safariIgnoreWebHostnames` to provide a list of hostnames that the Safari automation tools should ignore [appium-xcuitest-driver#1258](https://github.com/appium/appium-xcuitest-driver/pull/
|
||||
1258)
|
||||
* `waitForIdleTimeout` (Please read the below settings section)
|
||||
* Add settings: (Please read [Settings API](http://appium.io/docs/en/advanced-concepts/settings/index.html) for more details)
|
||||
* `customSnapshotTimeout` which was renamed from `snapshotTimeout` sets how much time is allowed to resolve a single accessibility snapshot with custom attributes
|
||||
* `waitForIdleTimeout` to customize the time for waiting until the application under test is idling
|
||||
* The value `zero` (not recommended) is equal to `waitForQuiescence` to `false`
|
||||
* **Important**: this is still a workaround, so there is no guarantee it is going to always work. Please consider rather fixing your application source code, because XCTest uses idle intervals to send commands to the accessibility manager. You may get unexpected testing results or application crashes if such intervals don't exist or are too tiny.
|
||||
* `animationCoolOffTimeout` customize the timeout to wait until the application under test has no animation
|
||||
* Add a possibility to select elements by indexes [WebDriverAgent#417](https://github.com/appium/WebDriverAgent/pull/417)
|
||||
* Fix parsing SSL output from OpenSSL output [appium-xcuitest-driver#1256](https://github.com/appium/appium-xcuitest-driver/pull/1256)
|
||||
|
||||
### iOS(Safari)
|
||||
|
||||
This driver provides you to communicate with Apple's `safaridriver` binary via Appium.
|
||||
It only supports Safari browser automation on macOS and iOS (Simulator/Real Device).
|
||||
|
||||
Read https://github.com/appium/appium-safari-driver for more details.
|
||||
|
||||
### Mac2
|
||||
|
||||
This driver provides you to handle macOS native applications with Apple's `XCTest` framework.
|
||||
Read https://github.com/appium/appium-mac2-driver for more details.
|
||||
|
||||
### Gecko
|
||||
|
||||
This driver provides you to communicate with Firefox browsers on macOS, Windows, Linux and Android with geckodriver binary via Appium.
|
||||
Read https://github.com/appium/appium-geckodriver for more details to set the environment up.
|
||||
|
||||
CHANGES IN VERSION 1.19.1(FROM 1.19.0)
|
||||
===================================
|
||||
|
||||
Appium 1.19.1 is a patch release
|
||||
|
||||
### iOS(XCUITest)
|
||||
|
||||
Patches "missing target for targetId" bug in Safari tests (see [#14867](https://github.com/appium/appium/issues/14867))
|
||||
|
||||
CHANGES IN VERSION 1.19.0 (FROM 1.18.3)
|
||||
===================================
|
||||
|
||||
@@ -58,7 +149,7 @@ Appium 1.19.0 is a minor release
|
||||
|
||||
### Flutter
|
||||
|
||||
The version is `0.0.25`
|
||||
The version is `0.25`
|
||||
|
||||
### You.i Engine Driver
|
||||
|
||||
|
||||
@@ -19,18 +19,9 @@ started](/docs/en/about-appium/getting-started.md) doc.
|
||||
|
||||
Appium supports app automation across a variety of platforms, like iOS,
|
||||
Android, and Windows. Each platform is supported by one or more "drivers",
|
||||
which know how to automate that particular platform. Choose a driver below for
|
||||
specific information about how that driver works and how to set it up:
|
||||
which know how to automate that particular platform.
|
||||
|
||||
* iOS
|
||||
* The [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md)
|
||||
* (DEPRECATED) The [UIAutomation Driver](/docs/en/drivers/ios-uiautomation.md)
|
||||
* Android
|
||||
* The [Espresso Driver](/docs/en/drivers/android-espresso.md)
|
||||
* The [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)
|
||||
* (DEPRECATED) The [UiAutomator Driver](/docs/en/drivers/android-uiautomator.md)
|
||||
* The [Windows Driver](/docs/en/drivers/windows.md) (for Windows Desktop apps)
|
||||
* The [Mac Driver](/docs/en/drivers/mac.md) (for Mac Desktop apps)
|
||||
Please refer to [Appium Platform Support](/docs/en/about-appium/platform-support.md) for more details.
|
||||
|
||||
### Why Appium?
|
||||
|
||||
@@ -67,7 +58,7 @@ Concepts](/docs/en/about-appium/intro.md).
|
||||
Your environment needs to be set up for the particular platforms that you want
|
||||
to run tests on. Each of the drivers above documents the requirements for their
|
||||
particular brand of automation. At a minimum, you will need to be able to run
|
||||
Node.js 10+.
|
||||
Node.js 12+.
|
||||
|
||||
### Get Started
|
||||
|
||||
|
||||
@@ -14,13 +14,6 @@ jobs:
|
||||
versionSpec: '12.x'
|
||||
- script: npm ci || npm install # "npm ci" if shrinkwrap is present
|
||||
displayName: Install NPM Dependencies
|
||||
- script: |
|
||||
pushd node_modules/appium-webdriveragent
|
||||
carthage bootstrap --no-use-binaries
|
||||
cp Cartfile.resolved Carthage
|
||||
mkdir -p ./Resources/WebDriverAgent.bundle
|
||||
popd
|
||||
displayName: Fully build XCUITestDriver
|
||||
- script: npm run build
|
||||
displayName: npm run build
|
||||
- script: npm prune --production
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '10.x'
|
||||
versionSpec: '14.x'
|
||||
- script: |
|
||||
pip install mkdocs==0.16.3
|
||||
git config --global user.email "maintainers@appium.io"
|
||||
@@ -28,4 +28,4 @@ jobs:
|
||||
popd
|
||||
displayName: Make branch with Updated Docs and make PR
|
||||
env:
|
||||
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
||||
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
||||
|
||||
@@ -73,7 +73,7 @@ client_support:
|
||||
# Information about the HTTP endpoints
|
||||
endpoint:
|
||||
url: /session/:session_id/appium/device/app_state
|
||||
method: GET
|
||||
method: POST
|
||||
url_parameters:
|
||||
- name: session_id
|
||||
description: ID of the session to route the command to
|
||||
|
||||
@@ -5,7 +5,7 @@ short_description: Place a file onto the device in a particular place
|
||||
example_usage:
|
||||
java:
|
||||
|
|
||||
driver.pushFile("/path/to/device/foo.bar", new File("/Users/johndoe/files/foo.bar"));
|
||||
driver.pushFile("/data/local/tmp/foo.bar", new File("/Users/johndoe/files/foo.bar"));
|
||||
python:
|
||||
|
|
||||
dest_path = '/data/local/tmp/test_push_file.txt'
|
||||
@@ -13,23 +13,23 @@ example_usage:
|
||||
self.driver.push_file(dest_path, base64.b64encode(data).decode('utf-8'))
|
||||
javascript_wd:
|
||||
|
|
||||
await driver.pushFileToDevice('/path/to/device/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
await driver.pushFileToDevice('/data/local/tmp/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
javascript_wdio:
|
||||
|
|
||||
let data = new Buffer("Hello World").toString('base64');
|
||||
driver.pushFile('/data/local/tmp/file.txt', data);
|
||||
ruby:
|
||||
|
|
||||
push_file('/path/to/device/foo.bar', File.read('path/to/file.png'))
|
||||
push_file('/data/local/tmp/foo.bar', File.read('path/to/file.png'))
|
||||
ruby_core:
|
||||
|
|
||||
@driver.push_file('/path/to/device/foo.bar', File.read('path/to/file.png'))
|
||||
@driver.push_file('/data/local/tmp/foo.bar', File.read('path/to/file.png'))
|
||||
php:
|
||||
|
|
||||
$driver->pushFile('/path/to/device/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
$driver->pushFile('/data/local/tmp/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
csharp:
|
||||
|
|
||||
driver.PushFile("/path/to/device/foo.bar", new FileInfo("/Users/johndoe/files/foo.bar"))
|
||||
driver.PushFile("/data/local/tmp/foo.bar", new FileInfo("/Users/johndoe/files/foo.bar"))
|
||||
|
||||
client_docs:
|
||||
java: "https://appium.github.io/java-client/io/appium/java_client/android/PushesFiles.html#pushFile-java.lang.String-java.io.File-"
|
||||
|
||||
@@ -115,7 +115,7 @@ endpoint:
|
||||
- name: options.videoType
|
||||
type: string
|
||||
description: (iOS Only) The format of the screen capture to be recorded.
|
||||
Available formats are the output of `ffmpeg -codecs` such as `libx264` and `mpeg4`. Defaults to `mpeg4`.
|
||||
Available formats are the output of `ffmpeg -codecs` such as `libx264` and `mpeg4`. Defaults to `mjpeg`.
|
||||
- name: options.videoQuality
|
||||
type: string
|
||||
description: (iOS Only) The video encoding quality (low, medium, high, photo - defaults to medium).
|
||||
|
||||
@@ -65,7 +65,7 @@ client_support:
|
||||
# Information about the HTTP endpoints
|
||||
endpoint:
|
||||
url: /session/:session_id/element/active
|
||||
method: 'POST'
|
||||
method: "'GET'(W3C), 'POST'(JSONWP)"
|
||||
response:
|
||||
- name: ELEMENT
|
||||
type: object
|
||||
|
||||
@@ -42,8 +42,8 @@ example_usage:
|
||||
action.Perform();
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#doubleTap-org.openqa.selenium.WebElement-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.double_tap"
|
||||
java: "https://www.selenium.dev/selenium/docs/api/java/overview-summary.html"
|
||||
python: "https://selenium-python.readthedocs.io/api.html?highlight=tap_and_hold#selenium.webdriver.common.touch_actions.TouchActions.double_tap"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L425"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/jsonwp.html#touchdoubleclick"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:double_tap"
|
||||
|
||||
@@ -38,7 +38,7 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#flick-org.openqa.selenium.WebElement-int-int-int-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.flick_element"
|
||||
python: "https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.flick_element"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/jsonwp.html#touchflick"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1513"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:flick"
|
||||
|
||||
@@ -45,7 +45,7 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#longPress-org.openqa.selenium.WebElement-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.long_press"
|
||||
python: "https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.long_press"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/mjsonwp.html#touchperform"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1531"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:long_press"
|
||||
|
||||
@@ -52,7 +52,7 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#down-int-int-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.move"
|
||||
python: "https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.common.touch_actions"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/mjsonwp.html#multitouchperform"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1531"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:move"
|
||||
|
||||
@@ -39,7 +39,7 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#scroll-int-int-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.scroll"
|
||||
python: "https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.scroll"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/jsonwp.html#touchscroll"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L425"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:scroll"
|
||||
|
||||
@@ -48,7 +48,7 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#down-int-int-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.tap_and_hold"
|
||||
python: "https://selenium-python.readthedocs.io/api.html?highlight=tap_and_hold#selenium.webdriver.common.touch_actions.TouchActions.tap_and_hold"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/jsonwp.html#touchdown"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1546"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/TouchActionBuilder#down-instance_method"
|
||||
|
||||
@@ -48,7 +48,7 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#up-int-int-"
|
||||
python: "https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.release"
|
||||
python: "https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.release"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/jsonwp.html#touchup"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1546"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:up"
|
||||
|
||||
@@ -10,125 +10,19 @@
|
||||
(see [Execute Script](/docs/en/commands/web/execute.md) for more details
|
||||
on syntax).
|
||||
|
||||
List of available commands:
|
||||
## Android
|
||||
### UiAutomator2
|
||||
|
||||
### IOS
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:viewportScreenshot | Like [screenshot](/docs/en/commands/session/screenshot.md) but only includes contents of viewport | <none> | <none> |
|
||||
Please refer to [mobile commands](https://github.com/appium/appium-uiautomator2-driver#platform-specific-extensions) section in UiAutomator2 driver repository.
|
||||
|
||||
### IOS (XCUITest Only)
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:startPerfRecord | Starts performance profiling for the device under test | <none> | |
|
||||
| mobile:stopPerfRecord | Stops performance profiling for the device under test | <none> | |
|
||||
| mobile:startLogsBroadcast | Starts iOS system logs broadcast websocket on the same host and port where Appium server is running at `/ws/session/:sessionId:/appium/device/syslog` endpoint. | <none> | |
|
||||
| mobile:stopLogsBroadcast | Stops the iOS system logs broadcasting websocket server started by `mobile:startLogsBroadcast` | <none> | |
|
||||
| mobile:swipe | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-swipe) | | |
|
||||
| mobile:scroll | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-scroll) | | |
|
||||
| mobile:pinch | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-pinch) | | |
|
||||
| mobile:doubleTap | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-doubleTap) | | |
|
||||
| mobile:touchAndHold | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-touchAndHold) | | |
|
||||
| mobile:twoFingerTap | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-twoFingerTap) | | |
|
||||
| mobile:tapWithNumberOfTaps | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-tapWithNumberOfTaps) | | |
|
||||
| mobile:tap | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-tap) | | |
|
||||
| mobile:dragFromToForDuration | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-dragFromToForDuration) | | |
|
||||
| mobile:selectPickerWheelValue | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-selectPickerWheelValue) | | |
|
||||
| mobile:alert | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-alert) | | |
|
||||
| mobile:installApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-installapp) | | |
|
||||
| mobile:removeApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-removeapp) | | |
|
||||
| mobile:isAppInstalled | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-isappinstalled) | | |
|
||||
| mobile:launchApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-launchapp) | | |
|
||||
| mobile:terminateApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-terminateapp) | | |
|
||||
| mobile:activateApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-activateapp) | | |
|
||||
| mobile:queryAppState | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-queryappstate) | | |
|
||||
| mobile:setPasteboard | refer to [IOS Pasteboard Guide](/docs/en/writing-running-appium/ios/ios-xctest-pasteboard.md#mobile-setpasteboard) | | |
|
||||
| mobile:getPasteboard | refer to [IOS Pasteboard Guide](/docs/en/writing-running-appium/ios/ios-xctest-pasteboard.md#mobile-getpasteboard) | | |
|
||||
| mobile:installCertificate | refer to [IOS Pasteboard Guide](/docs/en/writing-running-appium/ios/ios-xctest-install-certificate.md) | | |
|
||||
| mobile:getContexts | Retrieve available contexts, along with the url and title associated with each webview (see [get contexts](/docs/en/commands/context/get-contexts.md)). If `waitForWebviewMs` is provided, Appium will wait for available WebViews up to the number since Appium 1.17.0. | `{waitForWebviewMs}` | `{waitForWebviewMs: 5000}` |
|
||||
| mobile:batteryInfo | Reads the battery information from the device under test | <none> | <none> |
|
||||
| mobile:pressButton | Press a physical button. The available button options are: _home_, _volumeup_ and _volumedown_. Real devices support all three buttons whereas simulator only supports _home_. | `{name}` | `{name: "home"}` |
|
||||
| mobile:enrollBiometric | Enroll (or unenroll) an iOS Simulator to use [biometrics](https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/authentication/#face-id-and-touch-id) | `{isEnabled}` | `{isEnabled: true}` |
|
||||
| mobile:sendBiometricMatch | Send a matching or non-matching biometric input to an iOS Simulator. 'type' must be `touchId` or `faceId`. Match is a boolean indicating if it's a matching or non-matching input | `{type, match}` | `{type: "touchId", match: true}` |
|
||||
| mobile:isBiometricEnrolled | Check if an iOS Simulator is enrolled or not. Returns `true` if enrolled, `false` if not enrolled. |||
|
||||
| mobile:clearKeychains | Clear the keychains for an iOS Simulator |||
|
||||
| mobile:siriCommand| Sends a command to Siri | `{text}` | `{text: "What time is it?"}` |
|
||||
| mobile:source | This endpoint allows to retrieve the current native page source from WDA as a string (also being in a web context). Possible output formats are: `xml` (same output as for `getPageSource` command, the default value), `json` (the same tree structure as for the `xml` format, but represented as JSON) and `description` (native `debugDescription` output generated by XCTest). An optional `excludedAttributes` array allows to provide attributes names, which are going to be excluded from the resulting xml tree. This might significantly improve the performance of page source retrieval, especially if the `visible` attribute gets excluded. | `{format, excludedAttributes}` | `{format: 'description'}` `{format: 'xml', excludedAttributes: ['visible']}` |
|
||||
| mobile:activeAppInfo | Gets current active application's information such as bundleId and process arguments | <none> | <none> |
|
||||
| mobile:deviceInfo | Gets device information like locale and timezone. The timezone is TZ database format like `America/New_York` by default, fallback to Apple name like `US/New_York` | <none> | <none> |
|
||||
| mobile:rotateElement | Sends a rotation gesture with two touches to the given element. See [rotate:withVelocity:](https://developer.apple.com/documentation/xctest/xcuielement/1618665-rotate) for more details. | `{element, rotation, velocity}` | `{element: 2, rotation: π/2, velocity: 1.5}` |
|
||||
| mobile:deleteFile | Delete a file on the device under test. The remote path value should comply to [Pushing/Pulling Files](/docs/en/writing-running-appium/ios/ios-xctest-file-movement.md) tutorial. | `{remotePath}` | `{remotePath: 'path/to/file'}` |
|
||||
| mobile:deleteFolder | Delete a folder on the device under test. The remote path value should comply to [Pushing/Pulling Files](/docs/en/writing-running-appium/ios/ios-xctest-file-movement.md) tutorial. | `{remotePath}` | `{remotePath: '@io.appium.example:documents/path/to/folder'}` |
|
||||
| mobile:getPermission | Gets application permission state on a simulator. It requires https://github.com/wix/AppleSimulatorUtils |||
|
||||
| mobile:setPermission | Set a permission for the given bundleId via `xcrun simctl privacy` which is available since Xcode 11.4. `key` is 'service' in the list of `xcrun simctl privacy`. `value` is `yes`(grant), `no`(revoke) or `unset`(reset). It works on simulator. | `{bundleId, {key: value}}`| `{bundleId: 'io.appium.example', {'location-always': 'yes', calendar: 'no'}` |
|
||||
| mobile:getAppearance | Get the device's UI appearance style via `xcrun simctl ui`. It returns `light`, `dark`, `unknown` or `unsupported` (below iOS 12). |||
|
||||
| mobile:setAppearance | Set the device's UI appearance style via `xcrun simctl ui` or Siri command. | `{style}` | `{style: 'dark'}` |
|
||||
| mobile:getDeviceTime | Get time of the device under test. https://momentjs.com/docs/ is the full list of supported datetime format specifiers. Defaults to `YYYY-MM-DDTHH:mm:ssZ` which is ISO-8601. | `{format}` | `{format: 'YYYY-MM'}` |
|
||||
| mobile:startAudioRecording | Start recording audio stream. Read [Audio Capture From iOS Simulators and Real Devices](/docs/en/writing-running-appium/ios/audio-capture.md) for more details | | |
|
||||
| mobile:stopAudioRecording | Stop and store the recording audio stream. Read [Audio Capture From iOS Simulators and Real Devices](/docs/en/writing-running-appium/ios/audio-capture.md) for more details | | |
|
||||
### Espresso
|
||||
|
||||
### Android
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:shell | Execute [ADB shell](https://developer.android.com/studio/command-line/adb#shellcommands) commands (requires [insecure feature](/docs/en/writing-running-appium/security.md) `adb_shell` to be enabled) | Read [this page](/docs/en/writing-running-appium/android/android-shell.md) | `{'command': 'echo', 'args': ['arg1', 'arg2']}` |
|
||||
| mobile:startLogsBroadcast | Starts Android logcat broadcast websocket on the same host and port where Appium is running at `/ws/session/:sessionId:/appium/device/logcat` endpoint | <none> | <none> |
|
||||
| mobile:stopLogsBroadcast | Stops the logcat broadcasting websocket server started by `mobile:startLogsBroadcast` | <none> | <none> |
|
||||
| mobile:performEditorAction | Performs the given editor action on the focused input field. The following action names are supported: `normal, unspecified, none, go, search, send, next, done, previous`. | `{action}` | `{action: "previous"}`|
|
||||
| mobile:getPermissions | Gets a list of permissions which are `denied`, `granted` or `requested`. | `{type, appPackage}` | `{type: "granted", appPackage: "io.appium.android.apis"}`|
|
||||
| mobile:changePermissions | Grants or revokes permissions. | `{action, appPackage, permissions}` | `{action: "grant", appPackage: "io.appium.android.apis", permissions: "android.permission.READ_CONTACTS"}`, `{action: "revoke", appPackage: "io.appium.android.apis", permissions: ["android.permission.READ_CONTACTS", "android.permission.CAMERA"]}` |
|
||||
| mobile:getNotifications | Get the list of items as JSON format in the status bar notifications. Please turn 'Notification access' on via _Settings > App & notifications > Special app access_ (the actual path depends on the device model). Please read [Appium Pro](https://appiumpro.com/editions/106-retrieving-status-bar-notifications-for-android-devices) for more details. | <none> | <none> |
|
||||
| mobile: listSms | Get the list of SMS messages as [JSON format](https://github.com/appium/io.appium.settings#sms). | <none> | <none> |
|
||||
| mobile:type | Send Unicode text to a focused element. | `{text}` | `{text: "happy testing"}` |
|
||||
| mobile:getDeviceTime | Get time of the device under test. https://momentjs.com/docs/ is the full list of supported datetime format. Defaults to `YYYY-MM-DDTHH:mm:ssZ` which is ISO-8601. | `{format}` | `{format: 'YYYY-MM'}` |
|
||||
| mobile:deleteFile | Delete a file on the device under test. The remote path value should be the full path or a file inside an application bundle. | `{remotePath}` | `{remotePath: '@io.appium.example/path/in/bundle'}`, `{remotePath: '/tmp/data/file'}` |
|
||||
| mobile:startService | Starts the given service by calling `am start-service` or `am start-foreground-service` under the hood since Appium 1.18.0. The `intent` argument is mandatory. `user` is the ID of the user the service should be started for (the current user ID is used by default). If `foreground` is set to `true` then the service will be started in foreground. | `{intent, user, foreground}` | `{intent: 'my.app/my.activity', foreground: true}` |
|
||||
| mobile:stopService | Stops the given service by calling `am stop-service` under the hood since Appium 1.18.0. The `intent` argument is mandatory. `user` is the ID of the user the service should be stopped for (the current user ID is used by default). | `{intent, user}` | `{intent: 'my.app/my.activity'}` |
|
||||
| mobile:getContexts | Retrieve available contexts, along with details associated with each webview (see [get contexts](/docs/en/commands/context/get-contexts.md)) in JSON structure. The details of each webview includes such as android package name and its window handles details (see [get handles](/docs/en/commands/web/window/get-handles.md)). The details of each window handle (which donated as `pages` in the JSON) contains such as url, title and id. The id is part of a window handle name. Therefore, by concatenating a string like "CDwindow-" + id, you can use the string for switching to window (see [set window](/docs/en/commands/web/window/set-window.md).) | | |
|
||||
Please refer to [mobile commands](https://github.com/appium/appium-espresso-driver#platform-specific-extensions) section in Espresso driver repository.
|
||||
|
||||
### Android (UiAutomator2 only)
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:batteryInfo | Reads the battery information from the device under test | <none> | <none> |
|
||||
| mobile:acceptAlert | Accepts an on-screen alert | Optional button label to click on | <none> |
|
||||
| mobile:dismissAlert | Dismisses an on-screen alert | Optional button label to click on | <none> |
|
||||
| mobile:scrollBackTo | Scroll from one element to another | `{elementId, elementToId}` | `{elementId: 2, elementToId: 1}` |
|
||||
| mobile:scroll | Scroll the given scrollable element until the element identifier by `strategy` and `selector` becomes visible since Appium 1.18.0. An optional `maxSwipes` property can limit the number of scroll actions. It accepts an optional `element` property which should be the element identifier and scrollable. Without this property, Appium will select the first currently available scrollable container. Please read `mobileScroll` section in [appium-uiautomator2-driver](https://github.com/appium/appium-uiautomator2-driver/blob/master/lib/commands/general.js) for more details. | `{element, strategy, selector, maxSwipes}` | `{strategy: 'accessibility id', selector: 'target content description'}` |
|
||||
| mobile:viewportScreenshot | Like [screenshot](/commands/session/screenshot/) but only includes contents of viewport | <none> | <none> |
|
||||
| mobile:viewportRect | Returns the coordinates and size of the viewports since Appium 1.18.0. The return type is Rectangle defined in [general.js](https://github.com/appium/appium-uiautomator2-driver/blob/master/lib/commands/general.js).| <none> | <none> |
|
||||
| mobile:deepLink | Opens a deep-link URL for testing [Instant Apps](https://support.google.com/googleplay/answer/7240211?hl=en) | `{url, package}` | `{url: "https://www.site.com/", package: "com.site.SomeAndroidPackage"}` |
|
||||
| mobile:deviceInfo | Gets device information like manufacturer, model, timezone and locale. Read [GetDeviceInfo](https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java) for more details. | <none> | <none> |
|
||||
| mobile:type | Types the given Unicode string into focused field. The combination of `unicodeKeyboard` capability and the [send keys](https://appium.io/docs/en/commands/element/actions/send-keys/) works as _replacing_ the text field content. The send key in W3C action works only for ASCII. This command helps such cases to append unicode text content against the focused field. | `{text}` | `{text: 'happy testing'}` |
|
||||
| mobile:longClickGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-longclickgesture) since Appium 1.19.0 | | |
|
||||
| mobile:dragGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-draggesture) since Appium 1.19.0 | | |
|
||||
| mobile:flingGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-flinggesture) since Appium 1.19.0 | | |
|
||||
| mobile:pinchOpenGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-pinchopengesture) since Appium 1.19.0 | | |
|
||||
| mobile:pinchCloseGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-pinchclosegesture) since Appium 1.19.0 | | |
|
||||
| mobile:swipeGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-swipegesture) since Appium 1.19.0 | | |
|
||||
| mobile:scrollGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-scrollgesture) since Appium 1.19.0 | | |
|
||||
|
||||
### Android (Espresso only)
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:swipe | Perform the ["swipe" view action](https://developer.android.com/reference/android/support/test/espresso/action/ViewActions.html#swipeDown()) | `{element, direction}` | `{element: 2, direction: "down|up|left|right"}` |
|
||||
| mobile:swipe | Perform ["GeneralSwipeAction"](https://developer.android.com/reference/androidx/test/espresso/action/GeneralSwipeAction) | `{element, swiper, startCoordinates, endCoordinates, precisionDescriber}` | `{element: 3, swiper: "FAST|SLOW", startCoordinates: 'BOTTOM_RIGHT', endCoordinates: 'TOP_RIGHT', precisionDescriber: 'FINGER'}` |
|
||||
| mobile:clickAction | Perform ["ClickAction"](https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction) | `{element, tapper, coordinatesProvider, precisionDescriber, inputDevice, buttonState}` | `{element: 2, tapper: 'Long', coordinatesProvider: 'BOTTOM_RIGHT', precisionDescriber: 'Thumb', inputDevice: 0, buttonState: 0}` |
|
||||
| mobile:isToastVisible | Check whether a toast message is visible. `text` is the mandatory argument. `isRegexp` is optional. `text` will be parsed as a regular expression pattern if `isRegexp` is `true`. `isRegexp` is `false` by default. It returns `true` if the `text` exists, or `false` otherwise. | `{text, isRegexp}` | `{ text: 'A toast' }`, `{ text: '^regex$', isRegexp: true } `|
|
||||
| mobile:openDrawer | Open drawer by [DrawerAction](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions) with [gravity](https://developer.android.com/reference/android/view/Gravity). `gravity` is option. The default is [GravityCompat.START](https://developer.android.com/reference/android/support/v4/view/GravityCompat.html#START). This method blocks until the drawer is fully open. No operation if the drawer is already open. | `{element, gravity}` | `{ element: element_id }`, `{ element: element_id, gravity: 3 }` |
|
||||
| mobile:closeDrawer | Close drawer by [DrawerAction](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions) with [gravity](https://developer.android.com/reference/android/view/Gravity). `gravity` is option. The default is [GravityCompat.START](https://developer.android.com/reference/android/support/v4/view/GravityCompat.html#START). This method blocks until the drawer is fully closed. No operation if the drawer is already closed. | `{element, gravity}` | `{ element: element_id }`, `{ element: elementId, gravity: 3 }` |
|
||||
| mobile:setDate | Set date by [PickerActions#setDate](https://developer.android.com/reference/android/support/test/espresso/contrib/PickerActions.html#setDate(int,%20int,%20int)) for [DataPicker](https://developer.android.com/reference/android/widget/DatePicker). | `{element, year, monthOfYear, dayOfMonth}` | `{element: elementId, year: 2018, monthOfYear: 12, dayOfMonth: 1}` |
|
||||
| mobile:setTime | Set time by [PickerActions#setTime](https://developer.android.com/reference/android/support/test/espresso/contrib/PickerActions.html#setTime(int,%20int)) for [TimePicker](https://developer.android.com/reference/android/widget/TimePicker). | `{element, hours, minutes}` | `{element: elementId, hours: 12, minutes: 10}` |
|
||||
| mobile:navigateTo | Action to [NavigationView](https://developer.android.com/reference/android/support/design/widget/NavigationView) by [NavigationViewActions#navigateTo](https://developer.android.com/reference/android/support/test/espresso/contrib/NavigationViewActions.html#navigateTo(int)). The view must be a child of a DrawerLayout, of type NavigationView, visible on screen and displayed on screen. `com.google.android.material:material` as `additionalAndroidTestDependencies` capability is necessary. | `{element, menuItemId}` | `{element: elementId, menuItemId: 1}` |
|
||||
| mobile:scrollToPage | Action to [ViewPager](https://developer.android.com/reference/android/support/v4/view/ViewPager) by [ViewPagerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/ViewPagerActions). `scrollTo` must be one of `first`, `last`, `left`, `right`. `scrollTo` is used by default if `scrollTo` and `scrollToPage` are provided. | `{scrollTo, scrollToPage, smoothScroll}` | `{element: elementId, scrollTo: 'left', smoothScroll: true}`, `{element: elementId, scrollToPage: 2}`|
|
||||
| mobile:backdoor | Invoke arbitrary methods defined in Android app. The methods must be `public` in Java and must be `open` in Kotlin. `target` is `activity`, `application` or `element`. `methods` are methods you would like to invoke. `element` is mandatory if `target` is `element`. Read docstring of _mobileBackdoor_ method [here](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/general.js) for more details | `{target, methods, element}` | `{target: 'activity', methods: [{name: 'method1'}, {name: 'method2', args: [{value: 'hello appium', type: 'java.lang.String'}] }] }`, `{target: 'element', element: elementId, [{name: 'getTypeface'}, {name: 'isItalic'}]}` |
|
||||
| mobile:flashElement | Flashes an element on the screen to visually confirm you are operating on the correct element. Can optionally set `durationMillis` (in ms) and `repeatCount` of animation| `{element, durationMillis, repeatCount}` | `{element: "1234-abcd-5678", durationMillis: 1000, repeatCount: 10}` |
|
||||
| mobile:uiautomator | Drive areas which are not part of App Under Test, using uiautomator2 APIs. `strategy` can be one of: "clazz", "res", "text", "textContains", "textEndsWith", "textStartsWith","desc", "descContains", "descEndsWith", "descStartsWith" and "pkg", taken from uiautomator [By class](https://developer.android.com/reference/androidx/test/uiautomator/By). `action` can be one of: "click", "longClick", "getText", "getContentDescription", "getClassName","getResourceName", "getVisibleBounds", "getVisibleCenter", "getApplicationPackage","getChildCount", "clear", "isCheckable", "isChecked", "isClickable", "isEnabled","isFocusable", "isFocused", "isLongClickable", "isScrollable" and "isSelected", taken from uiautomator [UiObject2](https://developer.android.com/reference/androidx/test/uiautomator/UiObject2). `index` is optional, if not given, will return all matching results | `{strategy, locator, index, action}` | `{strategy: 'clazz', locator: 'android.widget.TextView', index: 2, action: "getText"}` |
|
||||
| mobile:webAtoms | Runs a chain of [webatoms](https://developer.android.com/training/testing/espresso/web). `withElement` and `perform` are basic chain items. Please refer [issue](https://github.com/appium/appium-espresso-driver/pull/380) and [Sample test code](https://github.com/appium/ruby_lib_core/blob/c9062c4b744263d790c7de17263cbd4645cdefc6/test/functional/android/android/mobile_commands_test.rb#L196-L239) as references. | `{webviewElement, forceJavascriptEnabled, methodChain}` | (webdriverio) `{ webviewElement: webviewEl.value, forceJavascriptEnabled: true, methodChain: [...]}` |
|
||||
| mobile:dismissAutofill | Disable autofill dialog in Android O+ | `{element}` | `{element: elementId}` |
|
||||
| mobile:deviceInfo | Gets device information like manufacturer, model, timezone and locale. Read [GetDeviceInfo](https://github.com/appium/appium-espresso-driver/blob/master/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/GetDeviceInfo.kt) for more details. | <none> | <none> |
|
||||
| mobile:registerIdlingResources | Registers one or more idling resources. Read [idling-resources.js](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/idling-resources.js) for more details. | `{classNames}` | `{classNames: 'com.package.MyIdlingResource1, com.package.MyIdlingResource2'}` |
|
||||
| mobile:unregisterIdlingResources | Unregisters one or more idling resources. Read [idling-resources.js](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/idling-resources.js) for more details. | `{classNames}` | `{classNames: 'com.package.MyIdlingResource1, com.package.MyIdlingResource2'}` |
|
||||
| mobile:listIdlingResources | Returns the list of canonical class names of currently registered idling resources. Read [idling-resources.js](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/idling-resources.js) for more details. | <none> | <none> |
|
||||
## IOS
|
||||
### XCUITest
|
||||
|
||||
Please refer to [mobile commands](https://github.com/appium/appium-xcuitest-driver#platform-specific-extensions) section in XCUITest driver repository.
|
||||
|
||||
example_usage:
|
||||
java:
|
||||
|
||||
@@ -90,12 +90,12 @@ example_usage:
|
||||
AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new Uri("http://127.0.0.1:4723/wd/hub"), appiumOptions);
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/remote/server/DefaultSession.html#createSession-org.openqa.selenium.remote.server.DriverFactory-org.openqa.selenium.remote.server.Clock-org.openqa.selenium.remote.SessionId-org.openqa.selenium.Capabilities-"
|
||||
java: "https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebDriver.html"
|
||||
python: "http://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElement.clear"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/webdriver.html#newsession"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1780"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element:clear"
|
||||
ruby_core: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element:clear"
|
||||
ruby: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver"
|
||||
ruby_core: "https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver"
|
||||
php: "https://github.com/appium/php-client/" # TODO PHP documentation link
|
||||
csharp: "https://github.com/appium/appium-dotnet-driver/" # TODO Dotnet documentation link
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ example_usage:
|
||||
ICapabilities caps = driver.Capabilities;
|
||||
|
||||
client_docs:
|
||||
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/remote/server/ActiveSessions.html#get-org.openqa.selenium.remote.SessionId-"
|
||||
java: "https://www.selenium.dev/selenium/docs/api/java/overview-summary.html"
|
||||
python: "https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.session.Session.session"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/jsonwp.html#getsession"
|
||||
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L227"
|
||||
|
||||
+7
-2
@@ -6,6 +6,11 @@ Formatted doc is [here](http://appium.io/documentation.html?lang=en).
|
||||
|
||||
## doc translation
|
||||
|
||||
At the moment we are focusing on improving the english documentation. When it
|
||||
is done we are planning to setup proper i18n l10n processes so that it is
|
||||
At the moment we are focusing on improving the english documentation. When it
|
||||
is done we are planning to setup proper i18n l10n processes so that it is
|
||||
easier for people to help in translating the documentation.
|
||||
|
||||
## Bump supported NodeJS version
|
||||
|
||||
- Refer to https://nodejs.org/en/download/releases/ if current supported version is EOL
|
||||
- Example to bump supported NodeJS version: https://github.com/appium/appium/pull/15000
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Appium 介绍
|
||||
|
||||
Appium 是一个开源工具,用于自动化 iOS 手机、 Android 手机和 Windows 桌面平台上的原生、移动 Web 和混合应用。**「原生应用」**指那些用 iOS、 Android 或者 Windows SDKs 编写的应用。**「移动 Web 应用」**是用移动端浏览器访问的应用( Appium 支持 iOS 上的 Safari 、Chrome 和 Android 上的内置浏览器)。**「混合应用」**带有一个「webview」的包装器——用来和 Web 内容交互的原生控件。类似于 [Apache Cordova](https://cordova.apache.org) 或 [Phonegap](http://phonegap.com/) 项目,创建一个混合应用使得用 Web 技术开发然后打包进原生包装器创建一个混合应用变得容易了。
|
||||
Appium 是一个开源工具,用于自动化 iOS 手机、 Android 手机和 Windows 桌面平台上的原生、移动 Web 和混合应用。**「原生应用」**指那些用 iOS、 Android 或者 Windows SDKs 编写的应用。**「移动 Web 应用」**是用移动端浏览器访问的应用( Appium 支持 iOS 上的 Safari 、Chrome 和 Android 上的内置浏览器)。**「混合应用」**带有一个「webview」的包装器——用来和 Web 内容交互的原生控件。类似于 [Apache Cordova](https://cordova.apache.org) 项目,创建一个混合应用使得用 Web 技术开发然后打包进原生包装器创建一个混合应用变得容易了。
|
||||
|
||||
重要的是,Appium 是跨平台的:它允许你用同样的 API 对多平台(iOS、Android、Windows)写测试。做到在 iOS、Android 和 Windows 测试套件之间复用代码。
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ Appium 给用户提供了在一个机器上启动多个 Android sessions 的方
|
||||
|
||||
十分不幸,目前并不能在本地运行 iOS 的并发测试。iOS 同一时间只能启动一个模拟器,不像 Andoid 可以同时多个模拟器去运行测试。
|
||||
|
||||
如果你想运行 iOS 的并发测试,你需要使用 Sauce 上传你的 Appium 测试脚本,然后就可以运行多台 iOS 和 Android 的并发测试,只要你的账号允许。查看更多相关信息可以查看 [这里](https://docs.saucelabs.com/tutorials/appium/)。
|
||||
如果你想运行 iOS 的并发测试,你需要使用 Sauce 上传你的 Appium 测试脚本,然后就可以运行多台 iOS 和 Android 的并发测试,只要你的账号允许。
|
||||
|
||||
|
||||
本文由 thanksdanny 翻译,由 lihuazhang 校验。
|
||||
|
||||
@@ -8,9 +8,6 @@ Appium 的 iOS 版本的后端用的是[Facebook's WebDriverAgent](https://githu
|
||||
|
||||
### 安装WDA
|
||||
|
||||
Appium 会自动下载 WebDriverAgent 源码。如果使用 npm 命令(`npm install -g appium`) 安装Appium的话,通常情况下会保存在/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent 目录下。
|
||||
如果是首次安装的话,还需要下载一些第三方依赖("carthage"工具就是为此准备的: `brew install carthage`):
|
||||
|
||||
```bash
|
||||
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
|
||||
./Scripts/bootstrap.sh -d
|
||||
|
||||
@@ -23,7 +23,6 @@ git clone https://github.com/appium/appium.git
|
||||
cd appium
|
||||
npm install
|
||||
npm run build
|
||||
npm run authorize-ios # for ios only
|
||||
node .
|
||||
```
|
||||
```center
|
||||
@@ -31,7 +30,6 @@ git clone https://github.com/appium/appium.git
|
||||
cd appium
|
||||
npm install
|
||||
npm run build # 需要gulp,往下看
|
||||
npm run authorize-ios # 仅iOS
|
||||
node .
|
||||
```
|
||||
|
||||
@@ -74,31 +72,6 @@ node .
|
||||
|
||||
完整的参数列表,请参考[the server documentation](/docs/cn/writing-running-appium/server-args.md)
|
||||
|
||||
|
||||
#### Hacking with Appium for iOS
|
||||
|
||||
#### 鼓捣 iOS 上的Appium
|
||||
|
||||
为了避免启动iOS应用程序时可能出现的安全对话框,您必须通过以下两种方式之一修改 `/etc/authorization` 文件:
|
||||
|
||||
1. 手动修改 `/etc/authorization` 文件中的 `<key>system.privilege.taskport</key>` 下的 `<allow-root>`的值为 `<true/>`。
|
||||
2. 运行以下命令,为您自动修改 `/etc/authorization` 文件:
|
||||
|
||||
```center
|
||||
sudo npm run authorize-ios
|
||||
```
|
||||
|
||||
|
||||
此时,运行:
|
||||
|
||||
```center
|
||||
rm -rf node-modules
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
现在你的 Appium 实例已经准备好了。运行 `node .` 以启动Appium服务器。
|
||||
|
||||
#### 鼓捣 Android 上的Appium
|
||||
|
||||
通过运行以下命令配置Appium:
|
||||
|
||||
@@ -209,7 +209,7 @@ simply type into a text field and check that the correct text was entered:
|
||||
const field = await client.$("android.widget.EditText");
|
||||
await field.setValue("Hello World!");
|
||||
const value = await field.getText();
|
||||
assert.equal(value, "Hello World!");
|
||||
assert.strictEqual(value, "Hello World!");
|
||||
```
|
||||
|
||||
What's going on here is that after creating a session and launching our app,
|
||||
@@ -245,7 +245,7 @@ async function main () {
|
||||
const field = await client.$("android.widget.EditText");
|
||||
await field.setValue("Hello World!");
|
||||
const value = await field.getText();
|
||||
assert.equal(value,"Hello World!");
|
||||
assert.strictEqual(value,"Hello World!");
|
||||
|
||||
await client.deleteSession();
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ applications on iOS mobile, Android mobile, and Windows desktop platforms.
|
||||
supports Safari on iOS and Chrome or the built-in 'Browser' app on Android).
|
||||
**Hybrid apps** have a wrapper around a "webview" -- a native control that
|
||||
enables interaction with web content. Projects like [Apache Cordova](https://cordova.apache.org)
|
||||
or [Phonegap](http://phonegap.com/) make it easy to build apps using web
|
||||
technologies that are then bundled into a native wrapper, creating a hybrid app.
|
||||
make it easy to build apps using web technologies that are then bundled
|
||||
into a native wrapper, creating a hybrid app.
|
||||
|
||||
Importantly, Appium is "cross-platform": it allows you to write tests against
|
||||
multiple platforms (iOS, Android, Windows), using the same API. This enables
|
||||
|
||||
@@ -2,33 +2,35 @@
|
||||
|
||||
Appium supports a variety of platforms and testing modalities (native,
|
||||
hybrid, web, real devices, simulators, etc...). This document is designed to
|
||||
make explicit the level of support and requirements for each of these.
|
||||
make explicit the level of support and requirements for each of these,
|
||||
or guide each driver to proper page.
|
||||
|
||||
## Appium team support
|
||||
|
||||
This section lists drivers that are supported by Appium team.
|
||||
|
||||
### iOS Support
|
||||
|
||||
iOS automation is supported with two drivers:
|
||||
|
||||
* The [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md)
|
||||
* The (deprecated) [UIAutomation Driver](/docs/en/drivers/ios-uiautomation.md)
|
||||
- The [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md)
|
||||
- The (deprecated) [UIAutomation Driver](/docs/en/drivers/ios-uiautomation.md)
|
||||
- The [safaridriver](/docs/en/drivers/safari.md) for Apple's [safaridriver](https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari?language=objc)
|
||||
|
||||
Please refer to these driver docs for setup instructions.
|
||||
|
||||
* Versions: 9.0 and up (as a rule, Appium supports the latest two iOS versions)
|
||||
* Devices: Simulator and real device for iPhone, iPad and tvOS
|
||||
* Native app support: Yes, with debug version of .app (simulator),
|
||||
- Versions: 12.2 and up (as a rule, Appium supports the latest two iOS versions)
|
||||
- Devices: Simulator and real device for iPhone, iPad and tvOS
|
||||
- Native app support: Yes, with debug version of .app (simulator),
|
||||
or correctly-signed .ipa (real devices). Underlying support is provided by
|
||||
Apple's [XCUITest](https://developer.apple.com/reference/xctest) (or [UIAutomation](https://web.archive.org/web/20160904214108/https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/) for older versions)
|
||||
framework.
|
||||
* Mobile web support: Yes, via automation of mobile Safari. For real devices,
|
||||
`ios-webkit-remote-debugger` is required, and automation of native aspects of
|
||||
the Safari interface is not possible. See the [mobile web doc](/docs/en/writing-running-appium/web/mobile-web.md) for instructions.
|
||||
* Hybrid support: Yes. For real devices, ios-webkit-remote-debugger is
|
||||
required. See the [hybrid doc](/docs/en/writing-running-appium/web/hybrid.md) for instructions.
|
||||
* Support for automating multiple apps in one session: No
|
||||
* Support for automating multiple devices simultaneously: No
|
||||
* Support for automating vendor-provided or third-party apps: Only
|
||||
vendor-provided apps (Preferences, Maps, etc...), and only on the simulator. For iOS 10+, you can automate the home screen as well.
|
||||
* Support for automating custom, non-standard UI controls: Minimal. You need to
|
||||
- Mobile web support: Yes, via automation of mobile Safari. See the [mobile web doc](/docs/en/writing-running-appium/web/mobile-web.md) for instructions.
|
||||
- Hybrid support: Yes. See the [hybrid doc](/docs/en/writing-running-appium/web/hybrid.md) for instructions.
|
||||
- Support for automating multiple apps in one session: No
|
||||
- Support for automating multiple devices simultaneously: Yes
|
||||
- Support for automating vendor-provided or third-party apps: Yes, apps which are already installed on the device
|
||||
- Support for automating custom, non-standard UI controls: Minimal. You need to
|
||||
set accessibility information on the control which enables some basic
|
||||
automation.
|
||||
|
||||
@@ -36,33 +38,65 @@ Please refer to these driver docs for setup instructions.
|
||||
|
||||
Android automation is supported with two drivers:
|
||||
|
||||
* The [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)
|
||||
* The (deprecated) [UiAutomator Driver](/docs/en/drivers/android-uiautomator.md)
|
||||
- The [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)
|
||||
- The [Espresso Driver](/docs/en/drivers/android-espresso.md)
|
||||
- The (deprecated) [UiAutomator Driver](/docs/en/drivers/android-uiautomator.md)
|
||||
- The [geckodriver](/docs/en/drivers/gecko.md) for Firefox and [GeckoView](https://wiki.mozilla.org/Mobile/GeckoView)
|
||||
|
||||
Please refer to these driver docs for setup instructions.
|
||||
|
||||
* Versions: 4.3 and up
|
||||
* Versions 4.3 and up are supported via Appium's [UiAutomator and UiAutomator2](http://developer.android.com/tools/testing-support-library/index.html#UIAutomator)
|
||||
libraries. UiAutomator is the default driver.
|
||||
* Devices: Android emulators and real Android devices
|
||||
* Native app support: Yes
|
||||
* Mobile web support: Yes. Automation
|
||||
- Versions: 4.3 and up
|
||||
- Versions 4.3 and up are supported via Appium's [UiAutomator and UiAutomator2](http://developer.android.com/tools/testing-support-library/index.html#UIAutomator)
|
||||
libraries. UiAutomator is the default driver.
|
||||
- Devices: Android emulators and real Android devices
|
||||
- Native app support: Yes
|
||||
- Mobile web support: Yes. Automation
|
||||
is effected using a bundled [Chromedriver](http://chromedriver.chromium.org)
|
||||
server as a proxy. With 4.3, automation works on official Chrome
|
||||
browser or Chromium only. With 4.4+, automation also works on the built-in
|
||||
"Browser" app. Chrome/Chromium/Browser must already be installed on the
|
||||
device under test. See the [mobile web doc](/docs/en/writing-running-appium/web/mobile-web.md) for instructions.
|
||||
* Hybrid support: Yes. See the [hybrid doc](/docs/en/writing-running-appium/web/hybrid.md) for instructions.
|
||||
* With default Appium automation backend: versions 4.4 and up
|
||||
* Support for automating multiple apps in one session: Yes
|
||||
* Support for automating multiple devices simultaneously: Yes,
|
||||
- Hybrid support: Yes. See the [hybrid doc](/docs/en/writing-running-appium/web/hybrid.md) for instructions.
|
||||
- With default Appium automation backend: versions 4.4 and up
|
||||
- Support for automating multiple apps in one session: Yes
|
||||
- Support for automating multiple devices simultaneously: Yes,
|
||||
though Appium must be started using different ports for the server
|
||||
parameters `--port`, `--bootstrap-port` and/or
|
||||
parameters `--port`, `--bootstrap-port` and/or
|
||||
`--chromedriver-port`. See the [server args doc](/docs/en/writing-running-appium/server-args.md) for more
|
||||
information on these parameters.
|
||||
* Support for automating vendor-provided or third-party apps: Yes
|
||||
* Support for automating custom, non-standard UI controls: No
|
||||
- Support for automating vendor-provided or third-party apps: Yes
|
||||
- Support for automating custom, non-standard UI controls: No
|
||||
|
||||
### macOS Support
|
||||
|
||||
macOS automation is supported with below drivers.
|
||||
|
||||
- The [Mac2Driver](/docs/en/drivers/mac2.md) is for macOS 10.15 or later
|
||||
- The (deprecated) [MacDriver](/docs/en/drivers/mac.md) is for lower macOS versions
|
||||
|
||||
### Windows Desktop Support
|
||||
|
||||
See the [Windows Driver](/docs/en/drivers/windows.md) doc for details
|
||||
Windows automation is supported with below drivers.
|
||||
|
||||
- The [WinAppDriver](/docs/en/drivers/windows.md)
|
||||
- The [geckodriver](/docs/en/drivers/gecko.md) for Firefox and [GeckoView](https://wiki.mozilla.org/Mobile/GeckoView)
|
||||
|
||||
## Vendors/Community based drivers
|
||||
|
||||
This section lists drivers that are supported by vendors and community.
|
||||
|
||||
### You.i Engine Support
|
||||
|
||||
- The [You.i Engine](https://github.com/YOU-i-Labs/appium-youiengine-driver)
|
||||
|
||||
### Flutter Support
|
||||
|
||||
- The [Flutter Driver](https://github.com/truongsinh/appium-flutter-driver)
|
||||
|
||||
### Roku Support
|
||||
|
||||
- The [Roku Driver](https://github.com/sharkyStudy/appium-roku-driver)
|
||||
|
||||
### WebOS Support
|
||||
|
||||
- The [WebOS Driver](https://github.com/sharkyStudy/appium-webos-driver)
|
||||
|
||||
@@ -76,10 +76,6 @@ driver.findElement(z)
|
||||
|
||||
where x and y are non-xpath locators and z is a xpath locator).
|
||||
|
||||
### System dependencies
|
||||
|
||||
In addition to the many gotchas that might come with upgrading any XCode installation (unrelated to Appium), Appium's XCUITest support requires a new system dependency: [Carthage](https://github.com/Carthage/Carthage). Appium Doctor has now been updated to ensure that the `carthage` binary is on your path.
|
||||
|
||||
### API differences
|
||||
|
||||
Unfortunately, the XCUITest API and the UIAutomation API are not equivalent. In many cases (like with `tap/click`), the behavior is identical. But some features that were available in the UIAutomation backend are not yet available in the new XCUITest backend. These known lacking features include:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Settings
|
||||
|
||||
Settings are a new concept introduced by appium. They are currently not a part of the Mobile JSON Wire Protocol, or the Webdriver spec.
|
||||
Settings are a new concept introduced by Appium. They are currently not a part of the Mobile JSON Wire Protocol, or the Webdriver spec.
|
||||
|
||||
Settings are a way to specify the behavior of the appium server.
|
||||
|
||||
@@ -48,62 +48,14 @@ Settings are implemented via the following API endpoints:
|
||||
|
||||
[Image Elements](https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/image-elements.md) also has image elements specific settings.
|
||||
|
||||
### Android Only
|
||||
### UiAutomator2
|
||||
|
||||
|Name|Description|Values|
|
||||
|----|----|----|
|
||||
| `ignoreUnimportantViews` | Controls whether the Android device should use `setCompressedLayoutHeirarchy()` which ignores all views which are marked IMPORTANT_FOR_ACCESSIBILITY_NO or IMPORTANT_FOR_ACCESSIBILITY_AUTO (and have been deemed not important by the system), in an attempt to make things less confusing or faster. Defaults to `false`. | `false` or `true` |
|
||||
Please refer to the documentation on the [UiAutomator2 Driver repository](https://github.com/appium/appium-uiautomator2-driver#settings-api)
|
||||
|
||||
#### UiAutomator2
|
||||
### XCUITest
|
||||
|
||||
|Name|Description|Values|
|
||||
|----|----|----|
|
||||
| `actionAcknowledgmentTimeout` | Same as: [setActionAcknowledgmentTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setActionAcknowledgmentTimeout(long)). If a negative value is given, it would set to default (3 * 1000 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g., `5000` |
|
||||
| `allowInvisibleElements` | Controls whether the Android device should show all elements, visible and invisible. Defaults to `false`. | `false` or `true` |
|
||||
| `enableMultiWindows` | If enabled then the page source and xpath lookup will include all windows available to the accessibility rather than the active one only. It might help to resolve finding elements on windows like `android.widget.PopupWindow`. Defaults to `false` and returns an active root window. Read [appium-uiautomator2-server#301](https://github.com/appium/appium-uiautomator2-server/pull/301) for more details. | `true` or `false` |
|
||||
| `enableNotificationListener` | Controls whether the Android device should enable or disable the `NotificationListener`. Defaults to `true`. | `false` or `true` |
|
||||
| `keyInjectionDelay` | Same as: [setKeyInjectionDelay](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setKeyInjectionDelay(long)). If a negative value is given, it would set to default (0 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g., `5000` |
|
||||
| `mjpegBilinearFiltering` | Controls whether or not to apply bilinear filtering to source screenshot resize algorithm. Enabling this flag may improve the quality of the resulting scaled bitmap, but will introduce a [small] performance hit. Defaults to `false`. | `false` or `true` |
|
||||
| `mjpegScalingFactor` | Controls the scaling factor of streamed screenshots. 100 means no scaling is applied (e.g. 100% of the original size). The bigger image size is the more CPU performance is needed to encode it. Integer values between `1` and `100` are available. Defaults to `50`. | `1` to `100` |
|
||||
| `mjpegServerFramerate` | Controls the framerate of streamed screenshots. Greater framerate values create greater CPU load. That actual maximum framerate value is limited by the performance of the device under test. Integer values between `1` and `60` are available. Defaults to `10`. | `1` to `60` |
|
||||
| `mjpegServerPort` | Controls the MJPEG server port. Integer values between `1024` and `65535` are available. Defaults to `7810`. | `1024` to `65535` |
|
||||
| `mjpegServerScreenshotQuality` | Controls the quality of streamed screenshots. Where the best quality is 100 and the worst is 1. The greater the value is the more CPU time is needed to encode a single bitmap into JPEG format. Usually a value between 25 and 90 is fine for this setting. Greater values affect performance too much without visible quality improvements and lower ones introduce visible distortions into the resulting image. Integer values between `1` and `100` are available. Defaults to `50`. | `1` to `100` |
|
||||
| `normalizeTagNames` | Translate all class names used as XML tags to the limited set of ASCII characters supported by Apache Harmony library. Used by default in Android to avoid possible XML parsing exceptions caused by XPath lookup. The translation is based on [junidecode](https://github.com/gcardone/junidecode). This prevents [this error case](https://github.com/appium/appium/issues/11854). Defaults to `false`. | `false` or `true` |
|
||||
| `scrollAcknowledgmentTimeout` | Same as: [setScrollAcknowledgmentTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setScrollAcknowledgmentTimeout(long)). If a negative value is given, it would set to default (200 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g. `300` |
|
||||
| `serverPort` | Controls the server port. Integer values between `1024` and `65535` are available. Defaults to `6790`. | `1024` to `65535` |
|
||||
| `shutdownOnPowerDisconnect` | Shutdown the server through the broadcast receiver on [ACTION_POWER_DISCONNECTED](https://developer.android.com/reference/android/content/Intent.html#ACTION_POWER_DISCONNECTED). Defaults to `true`. | `false` or `true` |
|
||||
| `simpleBoundsCalculation` | If enabled then the `bounds` attribute will be calculated using a less accurate but simpler method that may improve performance. First available in Appium 1.18.0. Defaults to `false`. | `false` or `true` |
|
||||
| `trackScrollEvents` | Controls the tracking of scroll events as they happen. If `true`, a field, `lastScrollData`, is added to the results of `getSession`, which can then be used to check on scroll progress. Turning this feature off significantly increases touch action performance. Defaults to `true`. | `false` or `true` |
|
||||
| `waitForIdleTimeout` | Same as: [setWaitForIdleTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setWaitForIdleTimeout(long)). If a negative value is given, it would set to default (10 * 1000 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g. `10000` |
|
||||
| `waitForSelectorTimeout` | Same as: [setWaitForSelectorTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setWaitForSelectorTimeout(long)). If a negative value is given, it would set to default (10 * 1000 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g. `10000` |
|
||||
| `wakeLockTimeout` | Controls the timeout of the acquired wake lock. The lock is acquired on server startup and is held until the UIAutomator2 server is killed or the timeout expires. Setting this value to zero or a negative number will release the lock immediately if it is held. Defaults to '24 * 60 * 60 * 1000' milliseconds. | e.g. `0`, `60000` (1 min) |
|
||||
|`useResourcesForOrientationDetection`| Whether to use application resource properties to figure out the current device orientation. By default the orientation value is based on the current rotation, which might be incorrect for some particular device types (usually tablets). `false` by default. Available since Appium 1.19.1 | e.g. `true` |
|
||||
|
||||
### iOS Only
|
||||
|
||||
#### XCUITest
|
||||
|
||||
|Name|Description|Values|Appium versions|
|
||||
|----|----|----|----|
|
||||
|`nativeWebTap`| Enable "real", non-javascript-based web taps in Safari. Default: `false`. Warning: depending on viewport size/ratio; this might not accurately tap an element. | `true`, `false` |1.7.0+|
|
||||
|`mjpegServerScreenshotQuality`| The quality of the screenshots generated by the screenshots broadcaster, expressed as a value from `0` to `100`. The value `0` represents the maximum compression (or lowest quality) while the value `100` represents the least compression (or best quality). The default value is `25`. | e.g., `10` |1.10.0+|
|
||||
|`mjpegServerFramerate`| The framerate at which the background screenshots broadcaster should broadcast screenshots in range `1..60`. The default value is `10` (Frames Per Second). Setting zero value will cause the framerate to be at its maximum possible value. | e.g., `60` |1.10.0+|
|
||||
|`screenshotQuality`| Changes the quality of phone display screenshots following [xctest/xctimagequality](https://developer.apple.com/documentation/xctest/xctimagequality?language=objc). Default value is `1`. Read `screenshotQuality` in [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver#desired-capabilities) | e.g. `0`, `1`, `2` |1.10.0+|
|
||||
|`mjpegScalingFactor`| Changes the scale of screenshots. Defaults to `100`, no scaling. Integer between `1` and `100` are available. | e.g. `1`, `50`, `100` |1.12.0+|
|
||||
|`keyboardAutocorrection`| Changes the 'Auto-Correction' preference in _Keyboards_ setting. Defaults to `false` when WDA starts as xctest. | `true`, `false` |1.14.0+|
|
||||
|`keyboardPrediction`| Changes the 'Predictive' preference in _Keyboards_ setting. Defaults to `false` when WDA starts as xctest. | `true`, `false` |1.14.0+|
|
||||
|`customSnapshotTimeout` (`snapshotTimeout` before 1.19.1) | Set how much time is allowed to resolve a single accessibility snapshot with custom attributes. _Snapshots_ are mainly used for page source generation, XML lookup and custom attributes retrieval (these are visibility and accessibility ones). It might be necessary to increase this value if the actual page source is very large and contains hundreds of UI elements. Defaults to 15 seconds. Since Appium 1.19.1 if this timeout expires and no custom snapshot could be made then WDA tries to calculate the missing attributes using its own algorithms, so setting this value to zero might speed up, for example, page source retrieval, but for the cost of some element attribute preciseness. | e.g. `10`, `100` (seconds) |1.15.0+|
|
||||
|`waitForIdleTimeout`|The amount of time in float seconds to wait until the application under test is idling. XCTest requires the app's main thread to be idling in order to execute any actions on it, so each action, like single click, might take a lot of time in case your app is constantly hogging the main thread. The default value is `10` (seconds). Setting it to zero disables idling checks completely (not recommended).|e.g. `2.5`|1.19.1+|
|
||||
|`animationCoolOffTimeout`|The amount of time in float seconds to wait until the application under test does not have any active animations. This check is usually applied after each automation action that is supposed to change the state of the application under test, like `click` one, and blocks XCTest until the transition of the tested application to a new state completes or the cool off timeout occurs. The default value is `2` (seconds). Setting it to zero disables animation checks completely.|e.g. `1.5`, `0`|1.19.1+|
|
||||
|`snapshotMaxDepth`| Changes the value of maximum depth for traversing elements source tree. It may help to prevent out of memory or timeout errors while getting the elements source tree, but it might restrict the depth of source tree. Please consider restricting this value if you observed an error like _Timed out snapshotting com.apple.testmanagerd..._ message or _Cannot get 'xml' source of the current application_ in your Appium log since they are possibly timeout related. A part of elements source tree might be lost if the value was too small. Defaults to `50` | e.g. `100` | 1.17.0+ |
|
||||
|`useFirstMatch` | Enabling this setting makes single element lookups faster, but there is the known [problem](https://github.com/appium/appium/issues/10101) related to nested elements lookup. Defaults to `false`. |`true`, `false` |1.15.0+|
|
||||
|`reduceMotion`| Changes the 'reduce motion' preference of accessibility feature. | `true`, `false` |1.15.0+|
|
||||
|`defaultActiveApplication`| Sets the hint for active application selection. This helps WebDriverAgent to select the current application if there are multiple items in the active applications list and the desired one is also one of them. The setting is particularly useful for split-screen apps automation. Defaults to `auto`, which makes WebDriverAgent to select the application whose element is located at `screenPoint` location or a single item from the active apps list if the length of this list is equal to one. | e.g., `com.apple.Preferences` |1.15.0+|
|
||||
|`activeAppDetectionPoint`| Defines the coordinates of the current screen point. WebDriverAgent uses this point to detect the active application if multiple application are active on the screen. The format of this value is `x,y`, where x and y are float or integer numbers representing valid screen coordinates. Setting this value to a point outside the actual screen coordinates might corrupt WebDriverAgent functionality. By default the screen point coordinates equal to 20% of the minimum screen dimension each, e.g. `MIN(w, h) * 0.2, MIN(w, h) * 0.2` | e.g. `100,300` |1.15.0+|
|
||||
| `includeNonModalElements` | Whether returns all of elements including no modal dialogs on iOS 13+. It fixes [cannot find elements on nested modal presentations](https://github.com/appium/appium/issues/13227), but it might make visibility attributes unreliable. You could also enable `shouldUseTestManagerForVisibilityDetection` setting (defaults to `false`) or `simpleIsVisibleCheck` capability to improve the visibility detection. This issue may happen between iOS 13.0 to 13.2 (and Xcode 11.0 to 11.2). The query issued in `includeNonModalElements` returns `nil` with newer iOS/Xcode versions and Appium/WDA return proper elements three without this setting being used. Defaults to `false`. | `true`, `false` |1.15.0+|
|
||||
| `acceptAlertButtonSelector` | Allows to customize accept alert button selector. It helps you to handle an arbitrary element as accept button in `accept alert` command. The selector should be a valid [class chain](https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules) expression, where the search root is the alert element itself. The default button location algorithm is used if the provided selector is wrong or does not match any element. | e.g., <code>**/XCUIElementTypeButton[\`label CONTAINS[c] 'accept'\`]</code> | 1.16.0+ |
|
||||
| `dismissAlertButtonSelector` | Allows to customize dismiss alert button selector. It helps you to handle an arbitrary element as dismiss button in `dismiss alert` command. The selector should be a valid [class chain](https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules) expression, where the search root is the alert element itself. The default button location algorithm is used if the provided selector is wrong or does not match any element. | e.g., <code>**/XCUIElementTypeButton[\`label CONTAINS[c] 'dismiss'\`]</code> | 1.16.0+ |
|
||||
| `screenshotOrientation` | Adjust screenshot orientation for iOS. Appium tries to return a screenshot and adjust its orientation properly using internal heuristics, but sometimes it does not work, especially in landscape mode. The actual screenshot orientation depends on various factors such as OS versions, model versions and whether this is a real or simulator device. This option allows you to enforce the given image orientation. Defaults to `auto`.| `auto`, `portrait`, `portraitUpsideDown`, `landscapeRight`, `landscapeLeft` | 1.17.0+ |
|
||||
| `boundElementsByIndex` | Whether to look up elements with [`allElementsBoundByAccessibilityElement`](https://developer.apple.com/documentation/xctest/xcuielementquery/1500816-allelementsboundbyaccessibilitye) (default) or [`allElementsBoundByIndex`](https://developer.apple.com/documentation/xctest/xcuielementquery/1500945-allelementsboundbyindex). [This Stack Overflow topic](https://stackoverflow.com/questions/49307513/meaning-of-allelementsboundbyaccessibilityelement) explains the differences. Defaults to `false` | `true`, `false` | 1.18.0+ |
|
||||
Please refer to the documentation on the [XCUITest Driver repository](https://github.com/appium/appium-xcuitest-driver#settings-api)
|
||||
|
||||
### Mac2
|
||||
|
||||
Please refer to the documentation on the [Mac2Driver repository](https://github.com/appium/appium-mac2-driver#settings-api)
|
||||
|
||||
@@ -20,8 +20,6 @@ Important points:
|
||||
WebDriverAgent source is automatically downloaded with Appium. The usual folder location
|
||||
in case Appium is installed via npm tool (`npm install -g appium`) is
|
||||
`/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent`
|
||||
If this was a fresh install then it is also necessary to download third-party dependencies
|
||||
(_carthage_ tool is mandatory for this purpose: `brew install carthage`):
|
||||
|
||||
```bash
|
||||
cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
|
||||
|
||||
@@ -96,7 +96,7 @@ iOS tests with XCUITest can also use the `mobile: queryAppState` method. See det
|
||||
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/app-state.yml)
|
||||
### Endpoint
|
||||
|
||||
`GET /session/:session_id/appium/device/app_state`
|
||||
`POST /session/:session_id/appium/device/app_state`
|
||||
|
||||
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/app-state.yml)
|
||||
### URL Parameters
|
||||
|
||||
@@ -7,7 +7,7 @@ Place a file onto the device in a particular place
|
||||
|
||||
```java
|
||||
// Java
|
||||
driver.pushFile("/path/to/device/foo.bar", new File("/Users/johndoe/files/foo.bar"));
|
||||
driver.pushFile("/data/local/tmp/foo.bar", new File("/Users/johndoe/files/foo.bar"));
|
||||
|
||||
```
|
||||
|
||||
@@ -26,29 +26,29 @@ let data = new Buffer("Hello World").toString('base64');
|
||||
driver.pushFile('/data/local/tmp/file.txt', data);
|
||||
|
||||
// wd example
|
||||
await driver.pushFileToDevice('/path/to/device/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
await driver.pushFileToDevice('/data/local/tmp/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
|
||||
```
|
||||
|
||||
```ruby
|
||||
# Ruby
|
||||
# ruby_lib example
|
||||
push_file('/path/to/device/foo.bar', File.read('path/to/file.png'))
|
||||
push_file('/data/local/tmp/foo.bar', File.read('path/to/file.png'))
|
||||
|
||||
# ruby_lib_core example
|
||||
@driver.push_file('/path/to/device/foo.bar', File.read('path/to/file.png'))
|
||||
@driver.push_file('/data/local/tmp/foo.bar', File.read('path/to/file.png'))
|
||||
|
||||
```
|
||||
|
||||
```php
|
||||
# PHP
|
||||
$driver->pushFile('/path/to/device/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
$driver->pushFile('/data/local/tmp/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
|
||||
|
||||
```
|
||||
|
||||
```csharp
|
||||
// C#
|
||||
driver.PushFile("/path/to/device/foo.bar", new FileInfo("/Users/johndoe/files/foo.bar"))
|
||||
driver.PushFile("/data/local/tmp/foo.bar", new FileInfo("/Users/johndoe/files/foo.bar"))
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ driver.StartRecordingScreen(
|
||||
| options.method | `string` | The http multipart upload method name. The 'PUT' one is used by default. |
|
||||
| options.forceRestart | `boolean` | Whether to try to catch and upload/return the currently running screen recording (`false`, the default setting on server) or ignore the result of it and start a new recording immediately (`true`). |
|
||||
| options.timeLimit | `string` | Recording time. 180 seconds is by default. |
|
||||
| options.videoType | `string` | (iOS Only) The format of the screen capture to be recorded. Available formats are the output of `ffmpeg -codecs` such as `libx264` and `mpeg4`. Defaults to `mpeg4`. |
|
||||
| options.videoType | `string` | (iOS Only) The format of the screen capture to be recorded. Available formats are the output of `ffmpeg -codecs` such as `libx264` and `mpeg4`. Defaults to `mjpeg`. |
|
||||
| options.videoQuality | `string` | (iOS Only) The video encoding quality (low, medium, high, photo - defaults to medium). |
|
||||
| options.videoFps | `string` | (iOS Only) The Frames Per Second rate of the recorded video. Change this value if the resulting video is too slow or too fast. Defaults to 10. This can decrease the resulting file size. |
|
||||
| options.videoScale | `string` | (iOS Only) The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for possible values. Example value of 720p scaling is '1280:720'. This can decrease/increase the resulting file size. No scale is applied by default. |
|
||||
|
||||
@@ -86,7 +86,7 @@ IWebElement currentElement = driver.SwitchTo().ActiveElement();
|
||||
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/other/active.yml)
|
||||
### Endpoint
|
||||
|
||||
`POST /session/:session_id/element/active`
|
||||
`'GET'(W3C), 'POST'(JSONWP) /session/:session_id/element/active`
|
||||
|
||||
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/other/active.yml)
|
||||
### URL Parameters
|
||||
|
||||
@@ -85,8 +85,8 @@ action.Perform();
|
||||
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#doubleTap-org.openqa.selenium.WebElement-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.double_tap) |
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [www.selenium.dev](https://www.selenium.dev/selenium/docs/api/java/overview-summary.html) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html?highlight=tap_and_hold#selenium.webdriver.common.touch_actions.TouchActions.double_tap) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L425) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:double_tap) |
|
||||
|
||||
@@ -81,7 +81,7 @@ action.Perform();
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#flick-org.openqa.selenium.WebElement-int-int-int-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.flick_element) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.flick_element) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1513) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:flick) |
|
||||
|
||||
@@ -88,7 +88,7 @@ touchAction.LongPress(element).Perform();
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#longPress-org.openqa.selenium.WebElement-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.long_press) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.long_press) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1531) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:long_press) |
|
||||
|
||||
@@ -98,7 +98,7 @@ As of Appium 1.8.0 all move actions take coordinates that are absolute.
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#down-int-int-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.move) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.common.touch_actions) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1531) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:move) |
|
||||
|
||||
@@ -82,7 +82,7 @@ action.Perform();
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#scroll-int-int-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.scroll) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.scroll) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L425) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:scroll) |
|
||||
|
||||
@@ -91,7 +91,7 @@ action.Perform();
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#down-int-int-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.tap_and_hold) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html?highlight=tap_and_hold#selenium.webdriver.common.touch_actions.TouchActions.tap_and_hold) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1546) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/TouchActionBuilder#down-instance_method) |
|
||||
|
||||
@@ -91,7 +91,7 @@ action.Perform();
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html#up-int-int-) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.touch_actions.html#selenium.webdriver.common.touch_actions.TouchActions.release) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.touch_actions.TouchActions.release) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1546) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FTouchActionBuilder:up) |
|
||||
|
||||
@@ -58,124 +58,19 @@ Syntax is `execute("mobile: <commandName>", <JSON serializable argument>)`
|
||||
(see [Execute Script](/docs/en/commands/web/execute.md) for more details
|
||||
on syntax).
|
||||
|
||||
List of available commands:
|
||||
## Android
|
||||
### UiAutomator2
|
||||
|
||||
### IOS
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:viewportScreenshot | Like [screenshot](/docs/en/commands/session/screenshot.md) but only includes contents of viewport | <none> | <none> |
|
||||
Please refer to [mobile commands](https://github.com/appium/appium-uiautomator2-driver#platform-specific-extensions) section in UiAutomator2 driver repository.
|
||||
|
||||
### IOS (XCUITest Only)
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:startPerfRecord | Starts performance profiling for the device under test | <none> | |
|
||||
| mobile:stopPerfRecord | Stops performance profiling for the device under test | <none> | |
|
||||
| mobile:startLogsBroadcast | Starts iOS system logs broadcast websocket on the same host and port where Appium server is running at `/ws/session/:sessionId:/appium/device/syslog` endpoint. | <none> | |
|
||||
| mobile:stopLogsBroadcast | Stops the iOS system logs broadcasting websocket server started by `mobile:startLogsBroadcast` | <none> | |
|
||||
| mobile:swipe | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-swipe) | | |
|
||||
| mobile:scroll | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-scroll) | | |
|
||||
| mobile:pinch | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-pinch) | | |
|
||||
| mobile:doubleTap | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-doubleTap) | | |
|
||||
| mobile:touchAndHold | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-touchAndHold) | | |
|
||||
| mobile:twoFingerTap | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-twoFingerTap) | | |
|
||||
| mobile:tapWithNumberOfTaps | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-tapWithNumberOfTaps) | | |
|
||||
| mobile:tap | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-tap) | | |
|
||||
| mobile:dragFromToForDuration | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-dragFromToForDuration) | | |
|
||||
| mobile:selectPickerWheelValue | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-selectPickerWheelValue) | | |
|
||||
| mobile:alert | refer to [Automating Mobile Gestures For iOS With WebDriverAgent/XCTest Backend](/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md#mobile-alert) | | |
|
||||
| mobile:installApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-installapp) | | |
|
||||
| mobile:removeApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-removeapp) | | |
|
||||
| mobile:isAppInstalled | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-isappinstalled) | | |
|
||||
| mobile:launchApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-launchapp) | | |
|
||||
| mobile:terminateApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-terminateapp) | | |
|
||||
| mobile:activateApp | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-activateapp) | | |
|
||||
| mobile:queryAppState | refer to [XCUITest Mobile App Managemenet](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-queryappstate) | | |
|
||||
| mobile:setPasteboard | refer to [IOS Pasteboard Guide](/docs/en/writing-running-appium/ios/ios-xctest-pasteboard.md#mobile-setpasteboard) | | |
|
||||
| mobile:getPasteboard | refer to [IOS Pasteboard Guide](/docs/en/writing-running-appium/ios/ios-xctest-pasteboard.md#mobile-getpasteboard) | | |
|
||||
| mobile:installCertificate | refer to [IOS Pasteboard Guide](/docs/en/writing-running-appium/ios/ios-xctest-install-certificate.md) | | |
|
||||
| mobile:getContexts | Retrieve available contexts, along with the url and title associated with each webview (see [get contexts](/docs/en/commands/context/get-contexts.md)). If `waitForWebviewMs` is provided, Appium will wait for available WebViews up to the number since Appium 1.17.0. | `{waitForWebviewMs}` | `{waitForWebviewMs: 5000}` |
|
||||
| mobile:batteryInfo | Reads the battery information from the device under test | <none> | <none> |
|
||||
| mobile:pressButton | Press a physical button. The available button options are: _home_, _volumeup_ and _volumedown_. Real devices support all three buttons whereas simulator only supports _home_. | `{name}` | `{name: "home"}` |
|
||||
| mobile:enrollBiometric | Enroll (or unenroll) an iOS Simulator to use [biometrics](https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/authentication/#face-id-and-touch-id) | `{isEnabled}` | `{isEnabled: true}` |
|
||||
| mobile:sendBiometricMatch | Send a matching or non-matching biometric input to an iOS Simulator. 'type' must be `touchId` or `faceId`. Match is a boolean indicating if it's a matching or non-matching input | `{type, match}` | `{type: "touchId", match: true}` |
|
||||
| mobile:isBiometricEnrolled | Check if an iOS Simulator is enrolled or not. Returns `true` if enrolled, `false` if not enrolled. |||
|
||||
| mobile:clearKeychains | Clear the keychains for an iOS Simulator |||
|
||||
| mobile:siriCommand| Sends a command to Siri | `{text}` | `{text: "What time is it?"}` |
|
||||
| mobile:source | This endpoint allows to retrieve the current native page source from WDA as a string (also being in a web context). Possible output formats are: `xml` (same output as for `getPageSource` command, the default value), `json` (the same tree structure as for the `xml` format, but represented as JSON) and `description` (native `debugDescription` output generated by XCTest). An optional `excludedAttributes` array allows to provide attributes names, which are going to be excluded from the resulting xml tree. This might significantly improve the performance of page source retrieval, especially if the `visible` attribute gets excluded. | `{format, excludedAttributes}` | `{format: 'description'}` `{format: 'xml', excludedAttributes: ['visible']}` |
|
||||
| mobile:activeAppInfo | Gets current active application's information such as bundleId and process arguments | <none> | <none> |
|
||||
| mobile:deviceInfo | Gets device information like locale and timezone. The timezone is TZ database format like `America/New_York` by default, fallback to Apple name like `US/New_York` | <none> | <none> |
|
||||
| mobile:rotateElement | Sends a rotation gesture with two touches to the given element. See [rotate:withVelocity:](https://developer.apple.com/documentation/xctest/xcuielement/1618665-rotate) for more details. | `{element, rotation, velocity}` | `{element: 2, rotation: π/2, velocity: 1.5}` |
|
||||
| mobile:deleteFile | Delete a file on the device under test. The remote path value should comply to [Pushing/Pulling Files](/docs/en/writing-running-appium/ios/ios-xctest-file-movement.md) tutorial. | `{remotePath}` | `{remotePath: 'path/to/file'}` |
|
||||
| mobile:deleteFolder | Delete a folder on the device under test. The remote path value should comply to [Pushing/Pulling Files](/docs/en/writing-running-appium/ios/ios-xctest-file-movement.md) tutorial. | `{remotePath}` | `{remotePath: '@io.appium.example:documents/path/to/folder'}` |
|
||||
| mobile:getPermission | Gets application permission state on a simulator. It requires https://github.com/wix/AppleSimulatorUtils |||
|
||||
| mobile:setPermission | Set a permission for the given bundleId via `xcrun simctl privacy` which is available since Xcode 11.4. `key` is 'service' in the list of `xcrun simctl privacy`. `value` is `yes`(grant), `no`(revoke) or `unset`(reset). It works on simulator. | `{bundleId, {key: value}}`| `{bundleId: 'io.appium.example', {'location-always': 'yes', calendar: 'no'}` |
|
||||
| mobile:getAppearance | Get the device's UI appearance style via `xcrun simctl ui`. It returns `light`, `dark`, `unknown` or `unsupported` (below iOS 12). |||
|
||||
| mobile:setAppearance | Set the device's UI appearance style via `xcrun simctl ui` or Siri command. | `{style}` | `{style: 'dark'}` |
|
||||
| mobile:getDeviceTime | Get time of the device under test. https://momentjs.com/docs/ is the full list of supported datetime format specifiers. Defaults to `YYYY-MM-DDTHH:mm:ssZ` which is ISO-8601. | `{format}` | `{format: 'YYYY-MM'}` |
|
||||
| mobile:startAudioRecording | Start recording audio stream. Read [Audio Capture From iOS Simulators and Real Devices](/docs/en/writing-running-appium/ios/audio-capture.md) for more details | | |
|
||||
| mobile:stopAudioRecording | Stop and store the recording audio stream. Read [Audio Capture From iOS Simulators and Real Devices](/docs/en/writing-running-appium/ios/audio-capture.md) for more details | | |
|
||||
### Espresso
|
||||
|
||||
### Android
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:shell | Execute [ADB shell](https://developer.android.com/studio/command-line/adb#shellcommands) commands (requires [insecure feature](/docs/en/writing-running-appium/security.md) `adb_shell` to be enabled) | Read [this page](/docs/en/writing-running-appium/android/android-shell.md) | `{'command': 'echo', 'args': ['arg1', 'arg2']}` |
|
||||
| mobile:startLogsBroadcast | Starts Android logcat broadcast websocket on the same host and port where Appium is running at `/ws/session/:sessionId:/appium/device/logcat` endpoint | <none> | <none> |
|
||||
| mobile:stopLogsBroadcast | Stops the logcat broadcasting websocket server started by `mobile:startLogsBroadcast` | <none> | <none> |
|
||||
| mobile:performEditorAction | Performs the given editor action on the focused input field. The following action names are supported: `normal, unspecified, none, go, search, send, next, done, previous`. | `{action}` | `{action: "previous"}`|
|
||||
| mobile:getPermissions | Gets a list of permissions which are `denied`, `granted` or `requested`. | `{type, appPackage}` | `{type: "granted", appPackage: "io.appium.android.apis"}`|
|
||||
| mobile:changePermissions | Grants or revokes permissions. | `{action, appPackage, permissions}` | `{action: "grant", appPackage: "io.appium.android.apis", permissions: "android.permission.READ_CONTACTS"}`, `{action: "revoke", appPackage: "io.appium.android.apis", permissions: ["android.permission.READ_CONTACTS", "android.permission.CAMERA"]}` |
|
||||
| mobile:getNotifications | Get the list of items as JSON format in the status bar notifications. Please turn 'Notification access' on via _Settings > App & notifications > Special app access_ (the actual path depends on the device model). Please read [Appium Pro](https://appiumpro.com/editions/106-retrieving-status-bar-notifications-for-android-devices) for more details. | <none> | <none> |
|
||||
| mobile: listSms | Get the list of SMS messages as [JSON format](https://github.com/appium/io.appium.settings#sms). | <none> | <none> |
|
||||
| mobile:type | Send Unicode text to a focused element. | `{text}` | `{text: "happy testing"}` |
|
||||
| mobile:getDeviceTime | Get time of the device under test. https://momentjs.com/docs/ is the full list of supported datetime format. Defaults to `YYYY-MM-DDTHH:mm:ssZ` which is ISO-8601. | `{format}` | `{format: 'YYYY-MM'}` |
|
||||
| mobile:deleteFile | Delete a file on the device under test. The remote path value should be the full path or a file inside an application bundle. | `{remotePath}` | `{remotePath: '@io.appium.example/path/in/bundle'}`, `{remotePath: '/tmp/data/file'}` |
|
||||
| mobile:startService | Starts the given service by calling `am start-service` or `am start-foreground-service` under the hood since Appium 1.18.0. The `intent` argument is mandatory. `user` is the ID of the user the service should be started for (the current user ID is used by default). If `foreground` is set to `true` then the service will be started in foreground. | `{intent, user, foreground}` | `{intent: 'my.app/my.activity', foreground: true}` |
|
||||
| mobile:stopService | Stops the given service by calling `am stop-service` under the hood since Appium 1.18.0. The `intent` argument is mandatory. `user` is the ID of the user the service should be stopped for (the current user ID is used by default). | `{intent, user}` | `{intent: 'my.app/my.activity'}` |
|
||||
| mobile:getContexts | Retrieve available contexts, along with details associated with each webview (see [get contexts](/docs/en/commands/context/get-contexts.md)) in JSON structure. The details of each webview includes such as android package name and its window handles details (see [get handles](/docs/en/commands/web/window/get-handles.md)). The details of each window handle (which donated as `pages` in the JSON) contains such as url, title and id. The id is part of a window handle name. Therefore, by concatenating a string like "CDwindow-" + id, you can use the string for switching to window (see [set window](/docs/en/commands/web/window/set-window.md).) | | |
|
||||
Please refer to [mobile commands](https://github.com/appium/appium-espresso-driver#platform-specific-extensions) section in Espresso driver repository.
|
||||
|
||||
### Android (UiAutomator2 only)
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:batteryInfo | Reads the battery information from the device under test | <none> | <none> |
|
||||
| mobile:acceptAlert | Accepts an on-screen alert | Optional button label to click on | <none> |
|
||||
| mobile:dismissAlert | Dismisses an on-screen alert | Optional button label to click on | <none> |
|
||||
| mobile:scrollBackTo | Scroll from one element to another | `{elementId, elementToId}` | `{elementId: 2, elementToId: 1}` |
|
||||
| mobile:scroll | Scroll the given scrollable element until the element identifier by `strategy` and `selector` becomes visible since Appium 1.18.0. An optional `maxSwipes` property can limit the number of scroll actions. It accepts an optional `element` property which should be the element identifier and scrollable. Without this property, Appium will select the first currently available scrollable container. Please read `mobileScroll` section in [appium-uiautomator2-driver](https://github.com/appium/appium-uiautomator2-driver/blob/master/lib/commands/general.js) for more details. | `{element, strategy, selector, maxSwipes}` | `{strategy: 'accessibility id', selector: 'target content description'}` |
|
||||
| mobile:viewportScreenshot | Like [screenshot](/commands/session/screenshot/) but only includes contents of viewport | <none> | <none> |
|
||||
| mobile:viewportRect | Returns the coordinates and size of the viewports since Appium 1.18.0. The return type is Rectangle defined in [general.js](https://github.com/appium/appium-uiautomator2-driver/blob/master/lib/commands/general.js).| <none> | <none> |
|
||||
| mobile:deepLink | Opens a deep-link URL for testing [Instant Apps](https://support.google.com/googleplay/answer/7240211?hl=en) | `{url, package}` | `{url: "https://www.site.com/", package: "com.site.SomeAndroidPackage"}` |
|
||||
| mobile:deviceInfo | Gets device information like manufacturer, model, timezone and locale. Read [GetDeviceInfo](https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java) for more details. | <none> | <none> |
|
||||
| mobile:type | Types the given Unicode string into focused field. The combination of `unicodeKeyboard` capability and the [send keys](https://appium.io/docs/en/commands/element/actions/send-keys/) works as _replacing_ the text field content. The send key in W3C action works only for ASCII. This command helps such cases to append unicode text content against the focused field. | `{text}` | `{text: 'happy testing'}` |
|
||||
| mobile:longClickGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-longclickgesture) since Appium 1.19.0 | | |
|
||||
| mobile:dragGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-draggesture) since Appium 1.19.0 | | |
|
||||
| mobile:flingGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-flinggesture) since Appium 1.19.0 | | |
|
||||
| mobile:pinchOpenGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-pinchopengesture) since Appium 1.19.0 | | |
|
||||
| mobile:pinchCloseGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-pinchclosegesture) since Appium 1.19.0 | | |
|
||||
| mobile:swipeGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-swipegesture) since Appium 1.19.0 | | |
|
||||
| mobile:scrollGesture | Refer to [Automating Mobile Gestures With UiAutomator2 Backend](/docs/en/writing-running-appium/android/android-mobile-gestures.md##mobile-scrollgesture) since Appium 1.19.0 | | |
|
||||
## IOS
|
||||
### XCUITest
|
||||
|
||||
### Android (Espresso only)
|
||||
| Command | Description | Argument | Argument Example |
|
||||
| ------- | ----------- | -------- | ---------------- |
|
||||
| mobile:swipe | Perform the ["swipe" view action](https://developer.android.com/reference/android/support/test/espresso/action/ViewActions.html#swipeDown()) | `{element, direction}` | `{element: 2, direction: "down|up|left|right"}` |
|
||||
| mobile:swipe | Perform ["GeneralSwipeAction"](https://developer.android.com/reference/androidx/test/espresso/action/GeneralSwipeAction) | `{element, swiper, startCoordinates, endCoordinates, precisionDescriber}` | `{element: 3, swiper: "FAST|SLOW", startCoordinates: 'BOTTOM_RIGHT', endCoordinates: 'TOP_RIGHT', precisionDescriber: 'FINGER'}` |
|
||||
| mobile:clickAction | Perform ["ClickAction"](https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction) | `{element, tapper, coordinatesProvider, precisionDescriber, inputDevice, buttonState}` | `{element: 2, tapper: 'Long', coordinatesProvider: 'BOTTOM_RIGHT', precisionDescriber: 'Thumb', inputDevice: 0, buttonState: 0}` |
|
||||
| mobile:isToastVisible | Check whether a toast message is visible. `text` is the mandatory argument. `isRegexp` is optional. `text` will be parsed as a regular expression pattern if `isRegexp` is `true`. `isRegexp` is `false` by default. It returns `true` if the `text` exists, or `false` otherwise. | `{text, isRegexp}` | `{ text: 'A toast' }`, `{ text: '^regex$', isRegexp: true } `|
|
||||
| mobile:openDrawer | Open drawer by [DrawerAction](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions) with [gravity](https://developer.android.com/reference/android/view/Gravity). `gravity` is option. The default is [GravityCompat.START](https://developer.android.com/reference/android/support/v4/view/GravityCompat.html#START). This method blocks until the drawer is fully open. No operation if the drawer is already open. | `{element, gravity}` | `{ element: element_id }`, `{ element: element_id, gravity: 3 }` |
|
||||
| mobile:closeDrawer | Close drawer by [DrawerAction](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions) with [gravity](https://developer.android.com/reference/android/view/Gravity). `gravity` is option. The default is [GravityCompat.START](https://developer.android.com/reference/android/support/v4/view/GravityCompat.html#START). This method blocks until the drawer is fully closed. No operation if the drawer is already closed. | `{element, gravity}` | `{ element: element_id }`, `{ element: elementId, gravity: 3 }` |
|
||||
| mobile:setDate | Set date by [PickerActions#setDate](https://developer.android.com/reference/android/support/test/espresso/contrib/PickerActions.html#setDate(int,%20int,%20int)) for [DataPicker](https://developer.android.com/reference/android/widget/DatePicker). | `{element, year, monthOfYear, dayOfMonth}` | `{element: elementId, year: 2018, monthOfYear: 12, dayOfMonth: 1}` |
|
||||
| mobile:setTime | Set time by [PickerActions#setTime](https://developer.android.com/reference/android/support/test/espresso/contrib/PickerActions.html#setTime(int,%20int)) for [TimePicker](https://developer.android.com/reference/android/widget/TimePicker). | `{element, hours, minutes}` | `{element: elementId, hours: 12, minutes: 10}` |
|
||||
| mobile:navigateTo | Action to [NavigationView](https://developer.android.com/reference/android/support/design/widget/NavigationView) by [NavigationViewActions#navigateTo](https://developer.android.com/reference/android/support/test/espresso/contrib/NavigationViewActions.html#navigateTo(int)). The view must be a child of a DrawerLayout, of type NavigationView, visible on screen and displayed on screen. `com.google.android.material:material` as `additionalAndroidTestDependencies` capability is necessary. | `{element, menuItemId}` | `{element: elementId, menuItemId: 1}` |
|
||||
| mobile:scrollToPage | Action to [ViewPager](https://developer.android.com/reference/android/support/v4/view/ViewPager) by [ViewPagerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/ViewPagerActions). `scrollTo` must be one of `first`, `last`, `left`, `right`. `scrollTo` is used by default if `scrollTo` and `scrollToPage` are provided. | `{scrollTo, scrollToPage, smoothScroll}` | `{element: elementId, scrollTo: 'left', smoothScroll: true}`, `{element: elementId, scrollToPage: 2}`|
|
||||
| mobile:backdoor | Invoke arbitrary methods defined in Android app. The methods must be `public` in Java and must be `open` in Kotlin. `target` is `activity`, `application` or `element`. `methods` are methods you would like to invoke. `element` is mandatory if `target` is `element`. Read docstring of _mobileBackdoor_ method [here](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/general.js) for more details | `{target, methods, element}` | `{target: 'activity', methods: [{name: 'method1'}, {name: 'method2', args: [{value: 'hello appium', type: 'java.lang.String'}] }] }`, `{target: 'element', element: elementId, [{name: 'getTypeface'}, {name: 'isItalic'}]}` |
|
||||
| mobile:flashElement | Flashes an element on the screen to visually confirm you are operating on the correct element. Can optionally set `durationMillis` (in ms) and `repeatCount` of animation| `{element, durationMillis, repeatCount}` | `{element: "1234-abcd-5678", durationMillis: 1000, repeatCount: 10}` |
|
||||
| mobile:uiautomator | Drive areas which are not part of App Under Test, using uiautomator2 APIs. `strategy` can be one of: "clazz", "res", "text", "textContains", "textEndsWith", "textStartsWith","desc", "descContains", "descEndsWith", "descStartsWith" and "pkg", taken from uiautomator [By class](https://developer.android.com/reference/androidx/test/uiautomator/By). `action` can be one of: "click", "longClick", "getText", "getContentDescription", "getClassName","getResourceName", "getVisibleBounds", "getVisibleCenter", "getApplicationPackage","getChildCount", "clear", "isCheckable", "isChecked", "isClickable", "isEnabled","isFocusable", "isFocused", "isLongClickable", "isScrollable" and "isSelected", taken from uiautomator [UiObject2](https://developer.android.com/reference/androidx/test/uiautomator/UiObject2). `index` is optional, if not given, will return all matching results | `{strategy, locator, index, action}` | `{strategy: 'clazz', locator: 'android.widget.TextView', index: 2, action: "getText"}` |
|
||||
| mobile:webAtoms | Runs a chain of [webatoms](https://developer.android.com/training/testing/espresso/web). `withElement` and `perform` are basic chain items. Please refer [issue](https://github.com/appium/appium-espresso-driver/pull/380) and [Sample test code](https://github.com/appium/ruby_lib_core/blob/c9062c4b744263d790c7de17263cbd4645cdefc6/test/functional/android/android/mobile_commands_test.rb#L196-L239) as references. | `{webviewElement, forceJavascriptEnabled, methodChain}` | (webdriverio) `{ webviewElement: webviewEl.value, forceJavascriptEnabled: true, methodChain: [...]}` |
|
||||
| mobile:dismissAutofill | Disable autofill dialog in Android O+ | `{element}` | `{element: elementId}` |
|
||||
| mobile:deviceInfo | Gets device information like manufacturer, model, timezone and locale. Read [GetDeviceInfo](https://github.com/appium/appium-espresso-driver/blob/master/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/GetDeviceInfo.kt) for more details. | <none> | <none> |
|
||||
| mobile:registerIdlingResources | Registers one or more idling resources. Read [idling-resources.js](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/idling-resources.js) for more details. | `{classNames}` | `{classNames: 'com.package.MyIdlingResource1, com.package.MyIdlingResource2'}` |
|
||||
| mobile:unregisterIdlingResources | Unregisters one or more idling resources. Read [idling-resources.js](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/idling-resources.js) for more details. | `{classNames}` | `{classNames: 'com.package.MyIdlingResource1, com.package.MyIdlingResource2'}` |
|
||||
| mobile:listIdlingResources | Returns the list of canonical class names of currently registered idling resources. Read [idling-resources.js](https://github.com/appium/appium-espresso-driver/blob/master/lib/commands/idling-resources.js) for more details. | <none> | <none> |
|
||||
Please refer to [mobile commands](https://github.com/appium/appium-xcuitest-driver#platform-specific-extensions) section in XCUITest driver repository.
|
||||
|
||||
|
||||
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/mobile-command.yml)
|
||||
|
||||
@@ -133,11 +133,11 @@ Please do not forget to call [delete command](/docs/en/commands/session/delete.m
|
||||
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/remote/server/DefaultSession.html#createSession-org.openqa.selenium.remote.server.DriverFactory-org.openqa.selenium.remote.server.Clock-org.openqa.selenium.remote.SessionId-org.openqa.selenium.Capabilities-) |
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [www.selenium.dev](https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebDriver.html) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](http://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElement.clear) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1780) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element:clear) |
|
||||
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver) |
|
||||
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|
||||
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ ICapabilities caps = driver.Capabilities;
|
||||
|
||||
|Language|Support|Documentation|
|
||||
|--------|-------|-------------|
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/remote/server/ActiveSessions.html#get-org.openqa.selenium.remote.SessionId-) |
|
||||
|[Java](https://github.com/appium/java-client/releases/latest)| All | [www.selenium.dev](https://www.selenium.dev/selenium/docs/api/java/overview-summary.html) |
|
||||
|[Python](https://github.com/appium/python-client/releases/latest)| All | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.session.Session.session) |
|
||||
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|
||||
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L227) |
|
||||
|
||||
@@ -64,29 +64,6 @@ node .
|
||||
See [the server documentation](/docs/en/writing-running-appium/server-args.md)
|
||||
for a full list of command line arguments that can be used.
|
||||
|
||||
#### Hacking with Appium for iOS
|
||||
|
||||
To avoid a security dialog that may appear when launching your iOS apps you'll
|
||||
have to modify your `/etc/authorization` file in one of two ways:
|
||||
|
||||
1. Manually modify the element following `<allow-root>` under `<key>system.privilege.taskport</key>`
|
||||
in your `/etc/authorization` file to `<true/>`.
|
||||
|
||||
2. Run the following command which automatically modifies your
|
||||
`/etc/authorization` file for you:
|
||||
|
||||
```
|
||||
sudo npm run authorize-ios
|
||||
```
|
||||
|
||||
At this point, run:
|
||||
|
||||
```
|
||||
rm -rf node_modules && rm -rf package-lock.json && npm install
|
||||
```
|
||||
|
||||
Now your Appium instance is ready to go. Run `node .` to kick up the Appium server.
|
||||
|
||||
#### Hacking with Appium for Android
|
||||
|
||||
To work on Android, make sure you have `ant`, `maven`, and `adb` installed
|
||||
|
||||
@@ -139,7 +139,7 @@ for e2e test files to end in `-e2e-specs.js`.
|
||||
The release process for any Appium module other than the main Appium package is
|
||||
pretty straightforward (note that you will need to be an NPM owner for the
|
||||
package if you want to publish it. Ownership is managed by the Appium
|
||||
committers; talk to @jlipps or @imurchie if you believe you should be an owner
|
||||
committers; talk to @jlipps, @kazucocoa, @dang, @mykola-mokhnach if you believe you should be an owner
|
||||
and are not):
|
||||
|
||||
1. `rm -rf node_modules && rm -rf package-lock.json && npm install` and run tests to make sure a clean install works.
|
||||
@@ -149,7 +149,7 @@ and are not):
|
||||
1. Push the appropriate branch to GitHub, and don't forget to include the `--tags` flag to include the tag just created by `npm version`.
|
||||
1. Run `npm publish` (with `--tag beta` if this isn't an official release).
|
||||
|
||||
For the main Appium packages, all the above steps must be taken, but with
|
||||
For the main Appium package, all the above steps must be taken, but with
|
||||
several changes. One reason is that for the main package we use NPM shrinkwrap
|
||||
to ensure dependencies don't change between installations. Another reason is
|
||||
that we develop on master and release on various branches. The way it works is
|
||||
@@ -177,18 +177,4 @@ checked in to GitHub along with changes to `package.json`. With npm 5+ there is
|
||||
also a `package-lock.json` file produced. During the shrinkwrap process this is
|
||||
converted into the `npm-shrinkwrap.json` file.
|
||||
|
||||
1. Remove the NPM shrinkwrap and package-lock JSON files if they exists.
|
||||
1. `rm -rf node_modules && npm install` and run tests to make sure a clean install works.
|
||||
1. Determine whether we have a `patch` (bugfix), `minor` (feature), or `major` (breaking) release according to the principles of SemVer.
|
||||
1. Update `package.json` with the appropriate new version.
|
||||
1. Update the CHANGELOG/README with appropriate changes and submit for review as a PR, along with shrinkwrap and `package.json` changes. Wait for it to be merged, then pull it into the release branch.
|
||||
1. Run `npm shrinkwrap` to generate the `npm-shrinkwrap.json`
|
||||
1. Create a tag of the form `v<version>` on the release branch (usually a minor branch like `1.5` or `1.4`), with: `git tag -a v<version>`, e.g., `git tag -a v1.5.0`, `git tag -a v1.5.0-rc.1`. This is not necessary for beta versions.
|
||||
1. Push the tag to upstream: `git push --tags <remote> <branch>`
|
||||
1. Run `npm publish` (with `--tag rc` if this isn't a GA release).
|
||||
1. Remove the NPM shrinkwrap JSON file from Git and push the changes
|
||||
1. Update the site docs by going to https://github.com/appium/appium.io/pulls and merging the latest pull request that was opened by the Triager bot. Close any other pull requests opened by Triager bot.
|
||||
1. Create a new release on GitHub: go to `https://github.com/appium/appium/releases/tag/v<VERSION>` and hit "Edit Tag". Make the release name `<VERSION>` (e.g., `2.0.5`), then paste in the changelog (but not the changelog header for this version). If it's a beta release, mark as pre-release.
|
||||
1. Create a new post on discuss.appium.io announcing the release. Post it in the "News" category. Paste in the changelog and any choice comments. Pin it and unpin the previous release post.
|
||||
1. Begin process of releasing `appium-desktop`.
|
||||
1. Notify @jlipps to so he can tweet a link to the discuss post.
|
||||
Follow directions in [Release Appium Doc](/docs/en/contributing-to-appium/release-appium.md)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# Releasing Appium
|
||||
Appium follows the GitLab flow approach. Releases are made on release branches that have the format `releases/x.y` where `x` is a major version and `y` is a minor version. The main Appium repository doesn't strictly follow semver (unlike the dependencies of Appium). A minor release (e.g.: `1.20.0`) means that we're creating a new release that has a newly created set of dependencies that are shrinkwrapped to the latest. A patch release (e.g.: `1.20.4`) isn't strictly a "patch", but just means that we're making an intermediary release that brings in small changes. For example, suppose I have a new version of `appium-xcuitest-driver` that I want to publish and it can't wait until the next minor release. To bring in that change, I would checkout the release branch (e.g.: `git checkout releases/1.20`); install the dependency (`npm install appium-xcuitest-driver@version && git commit -a -m 'bump appium-xcuitest-driver to version $version`); release a "release candidate" (see below) and then when it's ready, graduate the "release candidate" to general availability
|
||||
|
||||
## Create a release branch
|
||||
1. `bash ./scripts/release-branch.sh x.y` where `x` is the major version and `y` is the minor version (example: `bash ./scripts/release-branch.sh 1.20`)
|
||||
* This will create:
|
||||
* A release branch `releases/1.20`
|
||||
* A git tag `v1.20.0-rc.0`
|
||||
* Publish a NPM package `1.20.0-rc.0` as a release candidate
|
||||
1. Create a changelog pull request
|
||||
|
||||
## Create a release candidate
|
||||
1. Checkout the release branch (e.g.: `git checkout releases/1.21 && git pull origin releases/1.21`)
|
||||
1. `bash ./scripts/release.sh rc`
|
||||
|
||||
## Publish to GA
|
||||
1. Checkout the release branch (e.g.: `git checkout releases/1.21 && git pull origin releases/1.21`)
|
||||
1. `bash ./scripts/release.sh latest`
|
||||
1. Update the site docs by going to https://github.com/appium/appium.io/pulls and merging the latest pull request that was opened by the Triager bot. Close any other pull requests opened by Triager bot.
|
||||
1. Create a new release on GitHub: go to `https://github.com/appium/appium/releases/tag/v<VERSION>` and hit "Edit Tag". Make the release name `<VERSION>` (e.g., `2.0.5`), then paste in the changelog (but not the changelog header for this version). If it's a beta release, mark as pre-release.
|
||||
1. Create a new post on discuss.appium.io announcing the release. Post it in the "News" category. Paste in the changelog and any choice comments. Pin it and unpin the previous release post.
|
||||
1. Begin process of releasing `appium-desktop`.
|
||||
1. Notify @jlipps to so he can tweet a link to the discuss post.
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
## When you publish a version to a wrong channel
|
||||
|
||||
For example, you accidentally pusbed `rc` version into the `latest` channel.
|
||||
Then, you could add the `deprecated` label to this version , and re-tag the previous stable version in order to keep the stable one via `npm install`.
|
||||
`dist-tag` command helps to achieve that.
|
||||
|
||||
```
|
||||
$ npm deprecate appium@1.21.0-rc.0 "this release should be in rc channel" --tag=latest
|
||||
$ npm dist-tag add appium@1.20.2 latest
|
||||
```
|
||||
|
||||
You can confirm if the above step works by calling `npm install -g appium`.
|
||||
Once you can install `appium@1.20.2`, the above step worked.
|
||||
(You may need to wait for a few minutes because of npm caching.)
|
||||
@@ -20,6 +20,7 @@ In addition to Appium's general requirements:
|
||||
|
||||
* Java 8 installed and configured correctly for your platform
|
||||
* Mac, Windows, or Linux OS with the ability to run the Android SDK
|
||||
* The minimum required Android SDK Build Tools version is 24
|
||||
|
||||
### Usage
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ In addition to Appium's general requirements:
|
||||
|
||||
* Java 8 installed and configured correctly for your platform
|
||||
* Mac, Windows, or Linux OS with the ability to run the Android SDK
|
||||
* The minimum required Android SDK Build Tools version is 24
|
||||
|
||||
Further, the UiAutomator2 driver does not support Android versions below 5.0
|
||||
(Lollipop, API level 21). If you are automating such versions, consider using
|
||||
|
||||
@@ -55,32 +55,6 @@ Reference](#TODO).
|
||||
simulator may be open, and automated, at any given time. For multiple simulator
|
||||
support, you will need to upgrade to the [XCUITest driver](ios-xcuitest.md)).
|
||||
|
||||
1. To allow the iOS simulator to be automated by Instruments, you need to
|
||||
modify the authorization database for the system. Appium provides an easy
|
||||
way to do this by installing and running an authorization script:
|
||||
|
||||
```
|
||||
sudo authorize-ios
|
||||
```
|
||||
|
||||
1. By default, Instruments-based automation is limited by the inclusion of
|
||||
a 1-second hard-coded delay between commands, implemented for obscure
|
||||
reasons by Apple's engineers. There is a way around this limitation called
|
||||
[instruments-without-delay](https://github.com/facebookarchive/instruments-without-delay)
|
||||
(IWD). IWD ships with Appium for Xcode versions < 7. For 7.x and up, IWD
|
||||
must be installed manually by the user in advance of using Appium. The way
|
||||
to do this is as follows:
|
||||
|
||||
* Clone the [appium-ios-driver](https://github.com/appium/appium-ios-driver)
|
||||
repository.
|
||||
* Inside the repo, run the `xcode-iwd.sh` script included in the `bin` dir,
|
||||
passing it several arguments: (1) the path to the Xcode app you are
|
||||
using. (2) The path to the appium-instruments directory. For example:
|
||||
|
||||
```
|
||||
sh ./bin/xcode-iwd.sh /Applications/Xcode.app /Users/me/appium-instruments/
|
||||
```
|
||||
|
||||
1. For best results, launch each simulator you wish to use and ensure the following:
|
||||
|
||||
* The soft keyboard is enabled (Command+K in the Simulator app)
|
||||
@@ -163,8 +137,7 @@ $HOME/Library/Logs/CoreSimulator/*
|
||||
### Running iOS tests using Jenkins
|
||||
|
||||
First download the `jenkins-cli.jar` and verify that the Mac successfully
|
||||
connects to Jenkins master. Ensure you've run the `authorize-ios` command
|
||||
mentioned above.
|
||||
connects to Jenkins master.
|
||||
|
||||
```
|
||||
wget https://jenkins.ci.cloudbees.com/jnlpJars/jenkins-cli.jar
|
||||
|
||||
@@ -130,10 +130,12 @@ installed, and is _not_ recommended):
|
||||
```
|
||||
* Given this installation location, `/path/where/installed/bin/appium`, `WebDriverAgent` project
|
||||
will be found in `/path/where/installed/lib/node_modules/appium/node_modules/appium-webdriveragent`.
|
||||
Open a terminal and go to that location, then run the following in order to
|
||||
set the project up:
|
||||
Open a terminal and go to the location, then run the next script.
|
||||
```
|
||||
mkdir -p Resources/WebDriverAgent.bundle
|
||||
```
|
||||
* (Only for Appium versions below 1.20) Run the next script on the same terminal.
|
||||
```
|
||||
./Scripts/bootstrap.sh -d
|
||||
```
|
||||
* Open `WebDriverAgent.xcodeproj` in Xcode. For **both** the `WebDriverAgentLib`
|
||||
|
||||
@@ -95,12 +95,6 @@ dependencies)_
|
||||
|
||||
1. Ensure that you have Appium's general dependencies (e.g., Node
|
||||
& NPM) installed and configured.
|
||||
2. Install the [Carthage](https://github.com/Carthage/Carthage) dependency
|
||||
manager:
|
||||
|
||||
```bash
|
||||
brew install carthage
|
||||
```
|
||||
|
||||
If you don't need to automate real devices, you're done! To automate an app on
|
||||
the simulator, the `app` capability should be set to an absolute path or url
|
||||
@@ -150,3 +144,12 @@ Over Appium 1.14.0, Appium configures keyboard preferences by default to make te
|
||||
- Turn `Predictive` in _Keyboards_ off
|
||||
- Mark keyboard tutorial as complete
|
||||
- (Only for Simulator) Toggle software keyboard on
|
||||
|
||||
### Accessibility preferences fine-tuning
|
||||
|
||||
In some cases, enabling of the below preferences helps to make some view elements accessible.
|
||||
Appium does not modify these settings automatically, since they could affect the way your application under test performs.
|
||||
Please change them manually if needed
|
||||
|
||||
- Turn `Spoken Content` in _Settings > Accessibility_ on
|
||||
- Turn `Speak Selection` in _Settings > Accessibility_ on
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
## The Mac2Driver
|
||||
|
||||
Mac2Driver has been added to Appium since version 1.20.
|
||||
This driver is for automating macOS applications using Apple's [XCTest](https://developer.apple.com/documentation/xctest) framework.
|
||||
It provides more flexibility and features in comparison to the legacy
|
||||
[MacDriver](mac.md) and is better compatible with operating system internals.
|
||||
The driver operates in scope of [W3C WebDriver protocol](https://www.w3.org/TR/webdriver/) with several custom extensions to cover operating-system specific scenarios.
|
||||
The original idea and parts of the source code are borrowed from the Facebook's [WebDriverAgent](https://github.com/facebookarchive/WebDriverAgent) project.
|
||||
|
||||
Development of the Mac2Driver happens at the
|
||||
[appium-mac2-driver](https://github.com/appium/appium-mac2-driver) repo.
|
||||
|
||||
|
||||
### Requirements and Support
|
||||
|
||||
In addition to Appium's general requirements:
|
||||
|
||||
- macOS 10.15 or later
|
||||
- Xcode 12 or later should be installed
|
||||
- Xcode Helper app should be enabled for Accessibility access. The app itself could be usually found at `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/Xcode Helper.app`. In order to enable Accessibility access for it simply open the parent folder in Finder: `open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/` and drag & drop the `Xcode Helper` app to `Security & Privacy -> Privacy -> Accessibility` list of your `System Preferences`. This action must only be done once.
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
The way to start a session using the Mac2Driver is to include the
|
||||
`automationName` capability in your new session request, with
|
||||
the value `Mac2`. Of course, you must also include appropriate
|
||||
`platformName` (only `Mac` is supported). Read
|
||||
[Mac2Driver documentation](https://github.com/appium/appium-mac2-driver/blob/master/README.md)
|
||||
for more details.
|
||||
|
||||
|
||||
### Capabilities
|
||||
|
||||
The list of available driver capabilities could be found in
|
||||
the driver [README](https://github.com/appium/appium-mac2-driver/blob/master/README.md) file.
|
||||
@@ -114,7 +114,7 @@ capabilities entry. Below is an example of creating a test session for Windows
|
||||
DesiredCapabilities appCapabilities = new DesiredCapabilities();
|
||||
appCapabilities.SetCapability("app", @"C:\Windows\System32\notepad.exe");
|
||||
NotepadSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities);
|
||||
// Control the AlarmClock app
|
||||
// Control the Notepad app
|
||||
NotepadSession.FindElementByClassName("Edit").SendKeys("This is some text");
|
||||
```
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ Appium needs to know package and activity names in order to properly initialize
|
||||
- `appWaitActivity`: The name of the application activity to wait for/which starts the first
|
||||
- `appWaitPackage`: The id of the application package to wait for/which starts the first
|
||||
- `appWaitDuration`: The maximum duration to wait until the `appWaitActivity` is focused in milliseconds (20000 by default)
|
||||
- `appWaitForLaunch`: Whether to wait until Activity Manager returns the control to the calling process. By default the driver always waits until `appWaitDuration` is expired. Setting this capability to `false` effectively cancels this wait and unblocks the server loop as soon as `am` successfully triggers the command to start the activity.
|
||||
|
||||
All these capabilities are optional. If they are not set explicitly then Appium tries to auto detect them by reading their values from the APK manifest. Although, if the application under test is supposed to be already installed on the device (`noReset=true`) then at least `appActivity` and `appPackage` options are required to be set, since no package manifest is available in such case. If you don't set `appWaitPackage` and `appWaitActivity` explicitly then these are getting assigned to `appPackage`/`appActivity` values automatically. For more details check on the implementation of `packageAndLaunchActivityFromManifest` method in the [appium-adb](https://github.com/appium/appium-adb/blob/master/lib/tools/android-manifest.js) package.
|
||||
|
||||
@@ -32,4 +33,8 @@ The full error description usually looks like `'java.lang.SecurityException: Per
|
||||
|
||||
Thus exception usually indicates, that the first application activity is not the same package/activity, as it is set (or auto detected) by `appWaitPackage`/`appWaitActivity`. Such error normally happens in applications having multiple activities. In order to resolve the problem one should check with application developer regarding which activity/package is the very first one that appears on application startup. The currently focused activity name might be verified using the `adb shell dumpsys window windows` command mentioned above. Also, Appium allows to use wildcards while setting `appWaitActivity` value. This might be particularly useful if the activity name is generated dynamically or it is not the same all the time. For example `com.mycomany.*` will match any of `com.mycomany.foo`, `com.mycomany.bar`.
|
||||
|
||||
#### Command '…' timed out after X ms
|
||||
|
||||
If you've double checked that activity names are correct, but the startup still times out, then try to increase the value of `appWaitDuration` capability. Normally, the default 20 seconds is enough for the most of applications, however, some bigger apps might require more time to start and show the first activity. Please, don't create such apps.
|
||||
|
||||
There might be also situations where an activity does not return the control to the calling process at all, so `am start` call blocks forever independently of the value of `appWaitDuration`, thus causing the timeout. In such case setting `appWaitForLaunch` to `false` might help to resolve the issue. Although, by choosing this option, the driver cannot make sure the activity has fully started, so then it is up to the client code to verify the initial UI state is the one that is expected.
|
||||
|
||||
@@ -37,6 +37,35 @@ driver.execute_script('mobile: longClickGesture', {'x': 100, 'y': 100, 'duration
|
||||
```
|
||||
|
||||
|
||||
### mobile: doubleClickGesture
|
||||
|
||||
This gesture performs double click action on the given element/coordinates.
|
||||
Available since Appium v1.21
|
||||
|
||||
#### Supported arguments
|
||||
|
||||
* _elementId_: The id of the element to be clicked.
|
||||
If the element is missing then both click offset coordinates must be provided.
|
||||
If both the element id and offset are provided then the coordinates
|
||||
are parsed as relative offsets from the top left corner of the element.
|
||||
* _x_: The x-offset coordinate
|
||||
* _y_: The y-offset coordinate
|
||||
|
||||
#### Usage examples
|
||||
|
||||
```java
|
||||
// Java
|
||||
((JavascriptExecutor) driver).executeScript("mobile: doubleClickGesture", ImmutableMap.of(
|
||||
"elementId", ((RemoteWebElement) element).getId()
|
||||
));
|
||||
```
|
||||
|
||||
```python
|
||||
# Python
|
||||
driver.execute_script('mobile: doubleClickGesture', {'x': 100, 'y': 100})
|
||||
```
|
||||
|
||||
|
||||
### mobile: dragGesture
|
||||
|
||||
This gesture performs drag action from the given element/coordinates to the given point.
|
||||
|
||||
@@ -34,4 +34,12 @@ result = driver.execute_script('mobile: shell', {
|
||||
'timeout': 5000
|
||||
})
|
||||
assert result['stdout'] == 'arg1 arg2'
|
||||
```
|
||||
```
|
||||
|
||||
```javascript
|
||||
// Javascript
|
||||
const output = driver.executeScript('mobile: shell', [{
|
||||
command: 'ls',
|
||||
args: ['/sdcard'],
|
||||
}]);
|
||||
```
|
||||
|
||||
@@ -6,7 +6,7 @@ By delegating to Espresso's [Data Matcher](https://developer.android.com/referen
|
||||
|
||||
Android apps have special types of Views called [AdapterViews](https://developer.android.com/reference/android/widget/AdapterView) (e.g.: `ScrollView`, `ListView`, `GridView`) which have child views, but only render that child views that are on-screen. The AdapterView has "adapter" object which stores all the data for that view's children, including the views that aren't being rendered.
|
||||
|
||||
When using Espresso's Data Matcher, you can target views that are off-screen by writing a [Hamcrest matcher](http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html) that selects an item from an adapter. If the item is not in the view hierarchy, Espresso automatically scrolls it into view.
|
||||
When using Espresso's Data Matcher, you can target views that are off-screen by writing a [Hamcrest matcher](https://junit.org/junit4/javadoc/latest/org/hamcrest/class-use/Matcher.html) that selects an item from an adapter. If the item is not in the view hierarchy, Espresso automatically scrolls it into view.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ These Capabilities span multiple drivers.
|
||||
|`automationName`|Which automation engine to use|`Appium` (default), or `UiAutomator2`, `Espresso`, or `UiAutomator1` for Android, or `XCUITest` or `Instruments` for iOS, or `YouiEngine` for application built with You.i Engine|
|
||||
|`platformName`|Which mobile OS platform to use|`iOS`, `Android`, or `FirefoxOS`|
|
||||
|`platformVersion`|Mobile OS version|e.g., `7.1`, `4.4`|
|
||||
|`deviceName`|The kind of mobile device or emulator to use|`iPhone Simulator`, `iPad Simulator`, `iPhone Retina 4-inch`, `Android Emulator`, `Galaxy S4`, etc.... On iOS, this should be one of the valid devices returned by instruments with `instruments -s devices`. On Android this capability is currently ignored, though it remains required.|
|
||||
|`deviceName`|The kind of mobile device or emulator to use|`iPhone Simulator`, `iPad Simulator`, `iPhone Retina 4-inch`, `Android Emulator`, `Galaxy S4`, etc.... On iOS, this should be one of the valid devices returned by instruments with `instruments -s devices` or xctrace with `xcrun xctrace list devices` (since Xcode 12). On Android this capability is currently ignored, though it remains required.|
|
||||
|`app`|The absolute local path _or_ remote http URL to a `.ipa` file (IOS), `.app` folder (IOS Simulator), `.apk` file (Android) or `.apks` file (Android App Bundle), or a `.zip` file containing one of these. Appium will attempt to install this app binary on the appropriate device first. Note that this capability is not required for Android if you specify `appPackage` and `appActivity` capabilities (see below). `UiAutomator2` and `XCUITest` allow to start the session without `app` or `appPackage`. Incompatible with `browserName`. See [here](/docs/en/writing-running-appium/android/android-appbundle.md) about `.apks` file.|`/abs/path/to/my.apk` or `http://myapp.com/app.ipa`|
|
||||
|`otherApps`|App or list of apps (as a JSON array) to install prior to running tests. Note that it will not work with `automationName` of `Espresso` and iOS real devices|e.g., `"/path/to/app.apk"`, `https://www.example.com/url/to/app.apk`, `["http://appium.github.io/appium/assets/TestApp9.4.app.zip", "/path/to/app-b.app"]`|
|
||||
|`browserName`|Name of mobile web browser to automate. Should be an empty string if automating an app instead.|'Safari' for iOS and 'Chrome', 'Chromium', or 'Browser' for Android|
|
||||
@@ -58,7 +58,7 @@ These Capabilities span multiple drivers.
|
||||
|`printPageSourceOnFindFailure`| When a find operation fails, print the current page source. Defaults to `false`.|e.g., `true`|
|
||||
|`clearSystemFiles`| Delete any generated files at the end of a session. Default to `false`. | `true`, `false`|
|
||||
|
||||
- [Update settings](#update-settings)
|
||||
#### Update settings
|
||||
|
||||
|Capability|Description|Values|
|
||||
|----|-----------|-------|
|
||||
@@ -66,8 +66,7 @@ These Capabilities span multiple drivers.
|
||||
|
||||
### Android Only
|
||||
|
||||
These Capabilities are available only on Android-based drivers (like
|
||||
[UiAutomator2](/docs/en/drivers/android-uiautomator2.md) for example).
|
||||
These Capabilities are available only on Android-based drivers.
|
||||
|
||||
|Capability|Description|Values|
|
||||
|----|-----------|-------|
|
||||
@@ -142,9 +141,9 @@ These Capabilities are available only on Android-based drivers (like
|
||||
| logcatFilterSpecs | Set the output filter rule for logcat messages since Appium 1.18.0. Please read [logcat#filteringOutput](https://developer.android.com/studio/command-line/logcat#filteringOutput) for more details about the rule. [Write and View Logs with Logcat](https://developer.android.com/studio/debug/am-logcat) is also helpful. | e.g., `['*:W', 'MyActivity:D']` (`MyActivity` is a tag)|
|
||||
| allowDelayAdb | Whether enable `-delay-adb` on emulator startup. Defaults to `true` | `true`, `false` |
|
||||
|
||||
#### UIAutomator (1 & 2)
|
||||
#### UIAutomator 1
|
||||
|
||||
These Capabilities are available on UIA 1 and 2
|
||||
These Capabilities are available on UIAutomator 1.
|
||||
|
||||
|Capability|Description|Values|
|
||||
|----|-----------|-------|
|
||||
@@ -155,77 +154,11 @@ These Capabilities are available on UIA 1 and 2
|
||||
|
||||
#### UIAutomator2 Only
|
||||
|
||||
These Capabilities are available only on the [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)
|
||||
|
||||
|Capability|Description|Values|
|
||||
|----|-----------|-------|
|
||||
|`appWaitForLaunch`| Tries to launch the app under test without [-W](https://developer.android.com/studio/command-line/adb#am) option in session creation. It might help when the session creation does not proceed since `shell am start` does not respond. Defaults to `true`. | `false` or `true` |
|
||||
|`disableSuppressAccessibilityService`| Set [FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES](https://developer.android.com/reference/android/app/UiAutomation#FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES) to allow existing accessibility service continue to run, and a new one may start for Appium. It helps to test the app under test which has accessibility feature such as TalkBack. Appium will not specify the flag if nothing is provided. The flag requires Android API Level 24+. | `false` or `true` |
|
||||
|`mjpegServerPort`| If specified this is the local port that will be bound to the `appium-uiautomator2-server`'s MJPEG screenshot stream. This can be used in conjunction with `mjpegScreenshotUrl`. It should be a valid integer in range _1025..65535_. Defaults to `null`. e.g. `mjpegScreenshotUrl = 'http://localhost:9200', mjpegServerPort = 9200`| any `Integer`, recommended: `9200..9299` for consistency w/ `serverPort` range |
|
||||
|`skipServerInstallation`| Skip uiAutomator2 server installation and use uiAutomator2 server from the device. Can be used to improve startup performance when an uiAutomator2 server in proper version is already installed on the device. Defaults to `false`. | `false` or `true` |
|
||||
|`uiautomator2ServerInstallTimeout`| Timeout in milliseconds used to wait for an uiAutomator2 server to be installed. Defaults to `20000` |e.g., `20000`|
|
||||
|`uiautomator2ServerLaunchTimeout`| Timeout in milliseconds used to wait for an uiAutomator2 server to launch. Defaults to `20000` |e.g., `20000`|
|
||||
|`userProfile`| Enforce user profile as the given parameter if the value was provided. It should be an integer. | e.g., `11` |
|
||||
Please refer to the documentation on the UIAutomator2 driver [repository](https://github.com/appium/appium-uiautomator2-driver#capabilities) about its available capabilities.
|
||||
|
||||
#### Espresso Only
|
||||
|
||||
These Capabilities are available only on the [Espresso Driver](/docs/en/drivers/android-espresso.md)
|
||||
|
||||
|Capability|Description|Values|
|
||||
|----|-----------|-------|
|
||||
|`espressoServerLaunchTimeout`|Timeout in milliseconds used to wait for the Espresso server to launch. Defaults to `30000` |e.g., `50000`|
|
||||
|`espressoBuildConfig`|Path to the Espresso server build configuration JSON (see below) or a stringified JSON itself (only supported since server version 1.19)|e.g., `/projects/myapp-tests/buildconfig.json`|
|
||||
|`showGradleLog`|Whether to pipe Gradle build log for the Espresso server to the Appium log. Defaults to `false`|e.g., `true`|
|
||||
|`skipServerInstallation`|Skip Espresso server build and apk installation. This option could break proper Espresso server setup for the particular Appium version, but it can improve startup performance when the proper Espresso server and the proper app under test are already installed on the device. Please, make sure not to enable this option if the Espresso server or the application under test needs an update. Defaults to `false` | `true` or `false`|
|
||||
|`intentOptions`|Intent options which will be used to start the application under test. It can set intent options such as `action`, `categories` and `component` as JSON format. Please read [#538](https://github.com/appium/appium-espresso-driver/issues/538) as an example usage. | e.g. `{"action": "android.intent.action.MAIN", "categories": "android.intent.category.LAUNCHER", "component": "com.appium/.launcher.MainActivity"` |
|
||||
|`disableSuppressAccessibilityService`| Set [FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES](https://developer.android.com/reference/android/app/UiAutomation#FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES) to allow existing accessibility service continue to run, and a new one may start for Appium. It helps to test the app under test which has accessibility feature such as TalkBack. Appium will not specify the flag if nothing is provided. The flag requires Android API Level 24+. | `true`, `false` |
|
||||
|`appLocale`| Set [Locale](https://developer.android.com/reference/java/util/Locale) for [the target context](https://developer.android.com/reference/androidx/test/core/app/ApplicationProvider#getApplicationContext()) since Appium 1.18.0. `language`, `country` and `variant` are available as same as the Locale class. `language` is mandatory. Please check the [locale page](https://developer.android.com/reference/java/util/Locale) for more details. Setting `appLocale` only affects the locale of the application under test and does not influence other system views, such as the status bar. Consider setting `language`, `locale` and/or `localeScript` capabilities if you would like to change the locale for the entire the system. | e.g., `{"language": "ja", "country": "JP"}` |
|
||||
|
||||
|
||||
##### Espresso server build configuration JSON
|
||||
Passing this configuration file using `espressoBuildConfig` desired capability allows to fine-tune the build process of the Espresso server. It is mostly useful in cases where the default Espresso server settings are not compatible with your application under test.
|
||||
One example of such a case is tests crashing due to `Resource <name> is not a Drawable` error (see https://github.com/appium/appium-espresso-driver/issues/449 for discussion).
|
||||
|
||||
Configuration example:
|
||||
```json
|
||||
{
|
||||
"toolsVersions": {
|
||||
"gradle": "5.1.1",
|
||||
"androidGradlePlugin": "3.4.2",
|
||||
"compileSdk": 28,
|
||||
"buildTools": "28.0.3",
|
||||
"minSdk": 18,
|
||||
"targetSdk": 28,
|
||||
"kotlin": "1.3.31"
|
||||
},
|
||||
"additionalAppDependencies": [
|
||||
"com.google.android.material:material:1.0.0"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
***Version settings***
|
||||
|
||||
`toolsVersion` specifies versions of various tools and SDKs used during the building process of the Espresso server. Default versions are the versions used to build the Espresso driver without build configuration JSON.
|
||||
|
||||
The module versions enumerated under `toolsVersion` are only used to build the server APK. They don't affect the manifest of your application under test or the Espresso server manifest (that is still generated from the manifest of your application under test).
|
||||
|
||||
|Setting|Description|Values|
|
||||
|----|-----------|-------|
|
||||
|`gradle`|Gradle version|e.g.,`5.1.1`|
|
||||
|`androidGradlePlugin`|Android Gradle Plugin version|e.g., `3.4.2`|
|
||||
|`buildTools`|Version of the Android SDK build tools that should be used to compile the Espresso server (corresponds to `buildToolsVersion` in Gradle build files)|e.g., `28.0.3`|
|
||||
|`compileSdk`|Android API level that should be used to compile the Espresso server (corresponds to `compileSdkVersion` in Gradle build files)|e.g., `28`|
|
||||
|`minSdk`|Minimum Android API level required to run the application under tests, affects compatibility libraries used to build the Espresso server (corresponds to `minSdk` in Gradle build files)|e.g., `18`|
|
||||
|`targetSdk`|Android API level used to test the app (corresponds to `targetSdk` in Gradle build files)|e.g., `28`|
|
||||
|`kotlin`|Version of Kotlin compiler and official libraries|e.g., `1.3.311`|
|
||||
|
||||
***Application dependencies***
|
||||
|
||||
`additionalAppDependencies` and `additionalAndroidTestDependencies` array specify additional dependencies of the application under test that build tools should know about when building the Espresso server.
|
||||
For example: `"additionalAndroidTestDependencies": [ "com.google.android.material:material:1.0.0" ]`.
|
||||
|
||||
Items belonging to `additionalAppDependencies` array are translated to `implementation` lines in Gradle build files of the Espresso server. `additionalAndroidTestDependencies` are translated to `androidTestImplementation`.
|
||||
Please refer to the documentation on the Espresso driver [repository](https://github.com/appium/appium-espresso-driver#capabilities) about its available capabilities.
|
||||
|
||||
### iOS Only
|
||||
|
||||
@@ -237,7 +170,6 @@ Driver](/docs/en/drivers/ios-uiautomation.md).
|
||||
|----|-----------|-------|
|
||||
|`calendarFormat`| (Sim-only) Calendar format to set for the iOS Simulator|e.g. `gregorian`|
|
||||
|`bundleId`| Bundle ID of the app under test. Useful for starting an app on a real device or for using other caps which require the bundle ID during test startup. To run a test on a real device using the bundle ID, you may omit the 'app' capability, but you must provide 'udid'.|e.g. `io.appium.TestApp`|
|
||||
|`udid`| Unique device identifier of the connected physical device|e.g. `1ae203187fc012g`|
|
||||
|`launchTimeout`| Amount of time in ms to wait for instruments before assuming it hung and failing the session|e.g. `20000`|
|
||||
|`locationServicesEnabled`| (Sim-only) Force location services to be either on or off. Default is to keep current sim setting.|`true` or `false`|
|
||||
|`locationServicesAuthorized`| (Sim-only) Set location services to be authorized or not authorized for app via plist, so that location services alert doesn't pop up. Default is to keep current sim setting. Note that if you use this setting you MUST also use the `bundleId` capability to send in your app's bundle ID.|`true` or `false`|
|
||||
@@ -269,19 +201,32 @@ Driver](/docs/en/drivers/ios-uiautomation.md).
|
||||
|
||||
#### iOS Only, using XCUITest
|
||||
|
||||
(For XCUITest-specific capabilities, please refer to the documentation on the [XCUITest Driver repo](https://github.com/appium/appium-xcuitest-driver#desired-capabilities) itself.)
|
||||
Please refer to the documentation on the XCUITest driver [repository](https://github.com/appium/appium-xcuitest-driver#desired-capabilities) about its available capabilities.
|
||||
|
||||
### Safaridriver Only
|
||||
|
||||
Please refer to the documentation on the safaridriver [repository](https://github.com/appium/appium-safari-driver) about its available capabilities.
|
||||
|
||||
### Geckodriver Only
|
||||
|
||||
Please refer to the documentation on the geckodriver [repository](https://github.com/appium/appium-geckodriver) about its available capabilities.
|
||||
|
||||
### MacDriver Only
|
||||
|
||||
(For MacDriver capabilities, please refer to the documentation on the [Appium Mac Driver repo](https://github.com/appium/appium-mac-driver#desired-capabilities) itself.)
|
||||
Please refer to the documentation on the MacDriver [repository](https://github.com/appium/appium-mac-driver#desired-capabilities) about its available capabilities.
|
||||
|
||||
### Mac2Driver Only
|
||||
|
||||
Please refer to the documentation on the Mac2Driver [repository](https://github.com/appium/appium-mac2-driver#capabilities) about its available capabilities.
|
||||
|
||||
### You.i Engine Only
|
||||
|
||||
(For You.i Engine-specific capabilities, please refer to the documentation on the [You.i Engine driver](https://github.com/YOU-i-Labs/appium-youiengine-driver#desired-capabilities) itself.)
|
||||
Please refer to the documentation on the You.i Engine driver [repository](https://github.com/YOU-i-Labs/appium-youiengine-driver#desired-capabilities) about its available capabilities.
|
||||
|
||||
### WinAppDriver Only
|
||||
(For WinAppDriver specific capabilities, please refer to the documentation on the [Appium Windows Driver repo](https://github.com/appium/appium-windows-driver#windowsdriver-specific-capabilities) itself.)
|
||||
|
||||
Please refer to the documentation on the Appium Windows Diver [repository](https://github.com/appium/appium-windows-driver#windowsdriver-specific-capabilities) about its available capabilities.
|
||||
|
||||
### Flutter driver only
|
||||
(For FlutterDriver specific capabilities, examples please refer to the documentation on the [Flutter Driver repo](https://github.com/truongsinh/appium-flutter-driver#desired-capabilities-for-flutter-driver-only) itself.)
|
||||
|
||||
Please refer to the documentation on the Flutter Diver [repository](https://github.com/truongsinh/appium-flutter-driver#desired-capabilities-for-flutter-driver-only) about its available capabilities.
|
||||
|
||||
@@ -243,24 +243,29 @@ params.put("element", ((RemoteWebElement) element).getId());
|
||||
js.executeScript("mobile: selectPickerWheelValue", params);
|
||||
```
|
||||
|
||||
### mobile: rotateElement
|
||||
|
||||
### mobile: alert
|
||||
|
||||
Performs operations on NSAlert instance.
|
||||
Performs [rotate](https://developer.apple.com/documentation/xctest/xcuielement/1618665-rotate?language=objc) gesture on the given element.
|
||||
|
||||
#### Supported arguments
|
||||
|
||||
* _action_: The following actions are supported: _accept_, _dismiss_ and _getButtons_.
|
||||
Mandatory parameter
|
||||
* _buttonLabel_: The label text of an existing alert button to click on. This is an
|
||||
optional parameter and is only valid in combination with _accept_ and _dismiss_
|
||||
actions.
|
||||
* _element_: Internal element id (as hexadecimal hash string) to perform
|
||||
rotation on. Mandatory parameter
|
||||
* _rotation_: The rotation of the gesture in radians. Mandatory parameter
|
||||
* _velocity_: The velocity of the rotation gesture in radians per second. Mandatory parameter
|
||||
|
||||
#### Usage examples
|
||||
|
||||
```python
|
||||
# Python
|
||||
driver.execute_script('mobile: alert', {'action': 'accept', 'buttonLabel': 'My Cool Alert Button'});
|
||||
```java
|
||||
// Java
|
||||
JavascriptExecutor js = (JavascriptExecutor) driver;
|
||||
js.executeScript("mobile: rotateElement", ImmutableMap.of(
|
||||
// rotate clockwise, 90 degrees
|
||||
"rotation", -Math.PI / 2,
|
||||
// in approximately two seconds
|
||||
"velocity", Math.PI / 4,
|
||||
"element", ((RemoteWebElement) element).getId()
|
||||
));
|
||||
```
|
||||
|
||||
### mobile: tapWithNumberOfTaps
|
||||
|
||||
@@ -118,7 +118,7 @@ webview = driver.contexts.last
|
||||
driver.switch_to.context(webview)
|
||||
|
||||
# do some webby stuff
|
||||
driver.find_element(:css, ".green_button").click
|
||||
driver.find_element(By.CSS, ".green_button").click
|
||||
|
||||
# switch back to native view
|
||||
driver.switch_to.context(driver.contexts.first)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
## Appium サーバーをサポートしているクライアントライブラリの一覧
|
||||
|
||||
これらのライブラリは、標準の Selenium クライアントライブラリをラップして、[JSON Wire プロトコル](https://w3c.github.io/webdriver/webdriver-spec.html) によって指定されたすべての通常の Selenium コマンドを提供し、**マルチタッチジェスチャー** や **画面の向き** などのモバイルデバイスの制御に関連した追加コマンドを追加します。
|
||||
|
||||
Appium クライアントライブラリは、[Mobile JSON Wire プロトコル](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md) (標準プロトコルの公式ドラフト拡張) と、[W3C Webdriver 仕様](https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html) (トランスポートに依存しない自動化仕様。ここでは MultiAction API が定義されています) の要素を実装しています。
|
||||
|
||||
Appium サーバー自体が公式プロトコルへのカスタム拡張を定義しており、Appium ユーザーに様々なデバイスの動作 (テストセッションの途中でアプリをインストール/アンインストールするなど) を実現する便利な入り口を提供します。これが、「素」な Selenium クライアントだけでなく、Appium 固有のクライアントが必要な理由です。もちろん、Appium クライアントライブラリは機能を**追加**するだけなので (実際には、標準の Selenium クライアントを拡張するだけです)、通常の Selenium セッションに使用できます。
|
||||
|
||||
言語/フレームワーク | Github のリポジトリとインストール手順 |
|
||||
----- | ----- |
|
||||
Ruby | [https://github.com/appium/ruby_lib](https://github.com/appium/ruby_lib), [https://github.com/appium/ruby_lib_core](https://github.com/appium/ruby_lib_core)
|
||||
Python | [https://github.com/appium/python-client](https://github.com/appium/python-client)
|
||||
Java | [https://github.com/appium/java-client](https://github.com/appium/java-client)
|
||||
JavaScript (Node.js) | [https://github.com/admc/wd](https://github.com/admc/wd)
|
||||
JavaScript (Node.js) | [https://github.com/webdriverio/webdriverio](https://github.com/webdriverio/webdriverio)
|
||||
JavaScript (Browser) | [https://github.com/projectxyzio/web2driver](https://github.com/projectxyzio/web2driver)
|
||||
Objective C | [https://github.com/appium/selenium-objective-c](https://github.com/appium/selenium-objective-c)
|
||||
PHP | [https://github.com/appium/php-client](https://github.com/appium/php-client)
|
||||
C# (.NET) | [https://github.com/appium/appium-dotnet-driver](https://github.com/appium/appium-dotnet-driver)
|
||||
RobotFramework | [https://github.com/serhatbolsu/robotframework-appiumlibrary](https://github.com/serhatbolsu/robotframework-appiumlibrary)
|
||||
@@ -0,0 +1,274 @@
|
||||
## はじめに
|
||||
|
||||
このドキュメントでは、簡単な Appium テストを実施して、
|
||||
Appium の基本的な考え方をご紹介します。
|
||||
Appium の概念をより包括的に紹介するためには、[概念的な紹介](/docs/ja/about-appium/intro.md)をご覧ください。
|
||||
|
||||
### Appium のインストール
|
||||
|
||||
Appium は、[NPM](https://npmjs.com) 経由でインストールするか、
|
||||
Appium サーバーを起動するためのグラフィカルなデスクトップベースの方法である [Appium Desktop](https://github.com/appium/appium-desktop) をダウンロードする
|
||||
2つの方法のいずれかでインストールすることができます。
|
||||
|
||||
#### NPM 経由でのインストール
|
||||
|
||||
`npm install` で Appium を実行したり、Appium でハックしたり、Appium に貢献したりするには、
|
||||
[Node.js と NPM](http://nodejs.org) が必要です
|
||||
(Node.js をインストールするには、
|
||||
[nvm](https://github.com/creationix/nvm)、[n](https://github.com/visionmedia/n)、`brew install node` を使用してください。
|
||||
`sudo` で Node や Appium をインストールしていないことを確認してください)。
|
||||
Appium は Node 10+ をサポートしていますが、
|
||||
最新の安定版を推奨します。
|
||||
|
||||
実際のインストールはこんな感じで簡単です。
|
||||
|
||||
```
|
||||
npm install -g appium
|
||||
```
|
||||
|
||||
#### デスクトップアプリのダウンロードからのインストール
|
||||
|
||||
[リリースページ](https://github.com/appium/appium-desktop/releases)から
|
||||
Appium Desktop の最新版をダウンロードするだけです。
|
||||
|
||||
### ドライバー固有の設定
|
||||
|
||||
iOS や Android アプリケーションのように、
|
||||
特定のものを自動化するために Appium を使用したいと思うでしょう。
|
||||
特定のプラットフォームの自動化のサポートは、Appium の「ドライバ」によって提供されます。
|
||||
さまざまな種類の自動化技術へのアクセスを提供するこのようなドライバは多数あり、
|
||||
それぞれが各々のセットアップ要件を持っています。
|
||||
これらの要件のほとんどは、特定のプラットフォームでのアプリ開発と同じ要件です。
|
||||
例えば、Android ドライバを使用して Android アプリケーションを自動化するには、
|
||||
お使いのシステム上で設定された Android SDK が必要です。
|
||||
|
||||
ある時点で、自動化したいプラットフォームのドライバのドキュメントを確認して、
|
||||
システムが正しくセットアップされていることを確認してください。
|
||||
|
||||
- [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md) (iOS と tvOS アプリ用)
|
||||
- [Espresso ドライバー](/docs/en/drivers/android-espresso.md) (Android アプリ用)
|
||||
- [UiAutomator2 ドライバー](/docs/en/drivers/android-uiautomator2.md) (Android アプリ用)
|
||||
- [Windows ドライバー](/docs/en/drivers/windows.md) (Windows デスクトップアプリ用)
|
||||
- [Mac ドライバー](/docs/en/drivers/mac.md) (Mac デスクトップアプリ用)
|
||||
|
||||
### インストールの確認
|
||||
|
||||
Appium の依存関係がすべて満たされていることを確認するには、`appium-doctor` を使うことができます。
|
||||
`npm install -g appium-doctor` でインストールし、
|
||||
`appium-doctor` コマンドを実行して `--ios` または `--android` フラグを指定して、
|
||||
すべての依存関係が正しく設定されていることを確認します。
|
||||
|
||||
### Appium クライアント
|
||||
|
||||
すべてが呼ばれた時、Appium はただの HTTP サーバーです。
|
||||
それはその状態でクライアントからの接続を待ち、
|
||||
クライアントはどのような種類のセッションを開始するか、セッションが開始されるとどのような自動化動作を実行するかを Appium に指示します。
|
||||
これは、Appium を単独では決して使用しないことを意味します。
|
||||
常に何らかの種類のクライアントライブラリ (または、冒険的な場合は cURL!) と一緒に使用する必要があります。
|
||||
|
||||
幸いなことに、Appium は WebDriver プロトコルと呼ばれる [Selenium](http://www.seleniumhq.org/) と同じプロトコルを話します。
|
||||
標準の Selenium クライアントの 1 つを使用するだけで、
|
||||
Appium で多くのことを行うことができます。
|
||||
あなたのシステムにはすでにこれらのクライアントがあるかもしれません。
|
||||
特にモバイルプラットフォーム上の Web ブラウザをテストする目的で Appium を使用している場合は、
|
||||
それだけで十分です。
|
||||
|
||||
しかし、モバイルデバイスが Web ブラウザではできないことを行えるように、
|
||||
Appium は Selenium ではできないことを行えます。
|
||||
そのため、私たちは様々なプログラミング言語の
|
||||
Appium クライアントを用意しています。
|
||||
クライアントのリストとダウンロード手順へのリンクは
|
||||
[Appium クライアントのリスト](/docs/en/about-appium/appium-clients.md)で見ることができます。
|
||||
|
||||
先に進む前に、お好きな言語でクライアントをダウンロードし、
|
||||
準備ができていることを確認してください。
|
||||
|
||||
### Appium の開始
|
||||
|
||||
(NPMのインストールが成功したと仮定して)
|
||||
これで、以下のようにコマンドラインから実行することで、Appium サーバーをキックアップすることができます。
|
||||
|
||||
```
|
||||
appium
|
||||
```
|
||||
|
||||
または、Appium Desktop 内の巨大な Start Server ボタンをクリックしてください。
|
||||
|
||||
Appium は、実行している Appium のバージョンとどのポートを待ち受けているかを示す小さなウェルカムメッセージを表示します
|
||||
(デフォルトは `4723` です)。
|
||||
このポートで Appium に接続するようにテストクライアントを設定する必要があるので、
|
||||
このポート情報は重要です。
|
||||
ポートを変更したい場合は、
|
||||
Appium を起動する際に `-p` フラグを使用して変更することができます
|
||||
([サーバーパラメータ](/docs/en/writing-running-appium/server-args.md)の全リストを確認してください)。
|
||||
|
||||
### 最初のテストの実行
|
||||
|
||||
このセクションでは、基本的な "Hello World" の Android テストを実行します。
|
||||
Android を選択したのは、すべてのプラットフォームで利用可能だからです。
|
||||
[UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)を使用しますので、
|
||||
そのドキュメントを読み、システムを適切に設定してください。
|
||||
また、言語として JavaScript を使用しますので、
|
||||
追加の依存関係に対処する必要はありません。
|
||||
|
||||
(Android 以外のものを
|
||||
JavaScript 以外のものを使って自動化したいと思うこともあるでしょう。
|
||||
その場合は、多くの言語やプラットフォームに対応した
|
||||
[コードサンプル](https://github.com/appium/appium/tree/master/sample-code)を用意しています。)
|
||||
|
||||
#### 前提条件
|
||||
|
||||
- あなたが Android 8.0 エミュレータを設定して実行していると仮定します
|
||||
(例は、バージョン番号を調整することで
|
||||
より低バージョンで動作します。)
|
||||
- あなたが[このテスト APK](https://github.com/appium/appium/raw/master/sample-code/apps/ApiDemos-debug.apk) をダウンロードして、
|
||||
ローカルファイルシステム上で
|
||||
利用可能であると仮定します
|
||||
|
||||
#### Appium クライアントの設定
|
||||
|
||||
この例では、Appium クライアントとして [Webdriver.io](http://webdriver.io) を使用します。
|
||||
この例のディレクトリを作成し、実行します。
|
||||
|
||||
```
|
||||
npm init -y
|
||||
```
|
||||
プロジェクトを初期化したら、`webdriverio` をインストールします:
|
||||
```
|
||||
npm install webdriverio
|
||||
```
|
||||
|
||||
#### セッションの初期化
|
||||
|
||||
ここで `index.js` という名前のテストファイルを作成し、
|
||||
クライアントオブジェクトを初期化します:
|
||||
|
||||
```js
|
||||
// javascript
|
||||
const wdio = require("webdriverio");
|
||||
```
|
||||
|
||||
次にやるべきことは、Appium セッションを開始することです。
|
||||
これを行うには、サーバーオプションと Desired Capabilities のセットを定義し、
|
||||
それらを使って `wdio.remote()` を呼び出します。
|
||||
Desired Capabilities は、セッションの初期化中に Appium サーバーに送信されるキーと値の集合で、
|
||||
どのようなことを自動化したいかを Appium に伝えます。
|
||||
どのような Appium ドライバでも、以下の項目が必要な capabilities の最小セットになります。
|
||||
|
||||
- `platformName`: 自動化するプラットフォームの名前
|
||||
- `platformVersion`: 自動化するプラットフォームのバージョン
|
||||
- `deviceName`: 自動化するデバイスの種類
|
||||
- `app`: 自動化したいアプリへのパス (ただし、Web ブラウザを自動化する場合は代わりに
|
||||
`browserName` capability を使用します)
|
||||
- `automationName`: 使用するドライバーの名前
|
||||
|
||||
Desired Capabilities の詳細と、
|
||||
Appium で使用できるすべての機能のリストについては、
|
||||
[Capabilities doc](/docs/en/writing-running-appium/caps.md)を参照してください。
|
||||
|
||||
ここでは、以下のテストファイルでセッションを構築する方法を説明します:
|
||||
|
||||
```js
|
||||
// javascript
|
||||
const opts = {
|
||||
path: '/wd/hub',
|
||||
port: 4723,
|
||||
capabilities: {
|
||||
platformName: "Android",
|
||||
platformVersion: "8",
|
||||
deviceName: "Android Emulator",
|
||||
app: "/path/to/the/downloaded/ApiDemos-debug.apk",
|
||||
appPackage: "io.appium.android.apis",
|
||||
appActivity: ".view.TextFields",
|
||||
automationName: "UiAutomator2"
|
||||
}
|
||||
};
|
||||
|
||||
async function main () {
|
||||
const client = await wdio.remote(opts);
|
||||
|
||||
await client.deleteSession();
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
#### テストコマンドの実行
|
||||
|
||||
Appium ポートを指定し、要件に一致するように Desired Capabilities を構築したことがわかります
|
||||
(ただし、パスをあなたのシステムの実際のダウンロードパスに置き換えることを忘れないでください)。
|
||||
この事実を `webdriverio` に登録して、
|
||||
Appium サーバーへの接続を表すクライアントオブジェクトができました。
|
||||
ここから先に進み、セッションを開始し、いくつかのテストコマンドを実行し、セッションを終了することができます。
|
||||
ここでは、テキストフィールドに入力して、
|
||||
正しいテキストが入力されたかどうかを確認します:
|
||||
|
||||
```js
|
||||
// javascript
|
||||
|
||||
const field = await client.$("android.widget.EditText");
|
||||
await field.setValue("Hello World!");
|
||||
const value = await field.getText();
|
||||
assert.strictEqual(value, "Hello World!");
|
||||
```
|
||||
|
||||
ここで何が起こっているのかというと、セッションを作成してアプリを起動した後、
|
||||
アプリ階層で要素を見つけて入力するように Appium に指示しています。
|
||||
次に、同じフィールドにテキストを問い合わせ、
|
||||
期待通りのテキストであることを主張します。
|
||||
|
||||
すべてをまとめると、ファイルは次のようになります:
|
||||
|
||||
```js
|
||||
// javascript
|
||||
|
||||
const wdio = require("webdriverio");
|
||||
const assert = require("assert");
|
||||
|
||||
const opts = {
|
||||
path: '/wd/hub',
|
||||
port: 4723,
|
||||
capabilities: {
|
||||
platformName: "Android",
|
||||
platformVersion: "8",
|
||||
deviceName: "Android Emulator",
|
||||
app: "/path/to/the/downloaded/ApiDemos-debug.apk",
|
||||
appPackage: "io.appium.android.apis",
|
||||
appActivity: ".view.TextFields",
|
||||
automationName: "UiAutomator2"
|
||||
}
|
||||
};
|
||||
|
||||
async function main () {
|
||||
const client = await wdio.remote(opts);
|
||||
|
||||
const field = await client.$("android.widget.EditText");
|
||||
await field.setValue("Hello World!");
|
||||
const value = await field.getText();
|
||||
assert.strictEqual(value,"Hello World!");
|
||||
|
||||
await client.deleteSession();
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
このテストを自分で実行してみることができます。
|
||||
保存して `node` を使って実行するだけです:
|
||||
```
|
||||
node index.js
|
||||
```
|
||||
すべてが正しく設定されている場合、
|
||||
Appium がたくさんのログを吐き出し始め、
|
||||
最終的にはアプリが画面上にポップアップし、見えないユーザーがタップしているかのように動作を開始するのがわかります。
|
||||
|
||||
### 次は何をするか
|
||||
|
||||
Appium でできることについては、まだ表面上のことに過ぎません。
|
||||
これらのリソースをチェックして、あなたの旅に役立たせてください:
|
||||
|
||||
- Appium [コマンドリファレンス](https://appium.io/docs/en/commands/status/) - どのようなコマンドが利用可能か、特定のクライアントライブラリでの使用方法などについて学びます
|
||||
- [サンプルコード](https://github.com/appium/appium/tree/master/sample-code) ディレクトリには、他にもたくさんのコードサンプルがあります
|
||||
|
||||
- [discuss.appium.io](https://discuss.appium.io) - これは Appium コミュニティのフォーラムです。バグに遭遇したかもしれないと思った場合、または始めるための助けを得るために最初に行くのに最適な場所です
|
||||
- Appium [不具合トラッカー](https://github.com/appium/appium/issues) - バグを見つけたと思ったら、Appium メンテナに知らせてください
|
||||
@@ -0,0 +1,138 @@
|
||||
## Appium 入門
|
||||
|
||||
Appium は、iOS モバイル、Android モバイル、Windows デスクトッププラットフォーム上の
|
||||
ネイティブ、モバイル Web、ハイブリッドアプリケーションを自動化するためのオープンソースツールです。
|
||||
**ネイティブアプリ**とは、iOS、Android、または Windows SDK を使用して開発されたアプリのことです。
|
||||
**モバイル Web アプリ**は、モバイルブラウザを使用してアクセスする Web アプリです (Appium は、iOS では Safari、Android では Chrome または標準の Browser アプリをサポートしています)。
|
||||
**ハイブリッドアプリ**は、Web コンテンツとのインタラクションを可能にする標準的な仕組みである「WebView」のラッパーを持っています。
|
||||
[Apache Cordova](https://cordova.apache.org) のようなプロジェクトでは、
|
||||
Web 技術を使用してアプリを簡単に構築することができ、
|
||||
それをネイティブのラッパーにバンドルしてハイブリッドアプリを作成することができます。
|
||||
|
||||
重要なことは、Appium は「クロスプラットフォーム」であるということです。
|
||||
つまり、同じ API を使用して、複数のプラットフォーム (iOS、Android、Windows) に対してテストを書くことができます。
|
||||
これにより、iOS、Android、Windows のテストスイート間でコードを再利用することができます。
|
||||
|
||||
Appium がそのプラットフォームを「サポート」することの意味、
|
||||
および自動化の様式についての具体的な情報は、
|
||||
[プラットフォームサポートドキュメント](/docs/ja/about-appium/platform-support.md)を参照してください。
|
||||
|
||||
### Appium の理念
|
||||
|
||||
Appium は、次の4つの信条によって概説された理念に従って、
|
||||
モバイルオートメーションのニーズを満たすように設計されました。
|
||||
|
||||
1. アプリを自動化するために、
|
||||
アプリを再コンパイルしたり、修正したりする必要はありません
|
||||
2. テストを書いて実行するために、
|
||||
特定の言語やフレームワークに縛られるべきではありません
|
||||
3. モバイルオートメーションフレームワークは、
|
||||
自動化 API に関しては、車輪の再発明をしてはいけません
|
||||
4. モバイルオートメーションフレームワークは、名前だけでなく、
|
||||
精神的にも実践的にもオープンソースでなければなりません!
|
||||
|
||||
### Appium のデザイン
|
||||
|
||||
では、Appium プロジェクトの構造はどのようにしてこの理念を実現しているのでしょうか?
|
||||
ベンダーが提供する自動化フレームワークを基盤に利用することで、要件 1 を満たしています。
|
||||
この方法では、Appium 固有のコードやサードパーティのコードやフレームワークをアプリに組み込む必要はありません。
|
||||
つまり、**出荷するアプリと同じアプリをテストしていることになります**。
|
||||
使用しているベンダー提供のフレームワークは以下の通りです。
|
||||
|
||||
* iOS 9.3 以上: Apple の [XCUITest](https://developer.apple.com/reference/xctest)
|
||||
* iOS 9.3 以下: Apple の [UIAutomation](https://web.archive.org/web/20160904214108/https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/)
|
||||
* Android 4.3 以上: Google の [UiAutomator/UiAutomator2](https://developer.android.com/training/testing/ui-automator)
|
||||
* Windows: Microsoft の [WinAppDriver](http://github.com/microsoft/winappdriver)
|
||||
|
||||
ベンダーが提供するフレームワークを
|
||||
[WebDriver](http://docs.seleniumhq.org/projects/webdriver/) API という1つの API でラップすることで要件 2 を満たしています。
|
||||
WebDriver (別名 "Selenium WebDriver") は、([JSON Wire Protocol](https://w3c.github.io/webdriver/webdriver-spec.html) として知られる)
|
||||
クライアント - サーバープロトコルを指定します。
|
||||
このクライアント - サーバーアーキテクチャを考えると、任意の言語で書かれたクライアントを使用して、
|
||||
適切な HTTP リクエストをサーバーに送信することができます。
|
||||
既に[あらゆる一般的なプログラミング言語で書かれたクライアント](http://appium.io/downloads)
|
||||
が存在します。
|
||||
これはまた、好きなテストランナーやテストフレームワークを
|
||||
自由に使用できることを意味します。
|
||||
言い換えれば、Appium と WebDriver クライアントは技術的には「テストフレームワーク」ではなく、
|
||||
「自動化ライブラリ」です。
|
||||
テスト環境を
|
||||
好きなように管理することができます。
|
||||
|
||||
同様に要件 3 を満たしています。
|
||||
WebDriver は、Web ブラウザを自動化するためのデファクトスタンダードとなっており、
|
||||
[W3C のワーキングドラフト](https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html)です。
|
||||
なぜモバイル用に全く違うことをするのでしょうか?
|
||||
その代わりに、モバイルの自動化に役立つ API メソッドを追加して
|
||||
[プロトコルを拡張](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md)しました。
|
||||
|
||||
要件 4 が与えられたものであることは明らかなはずです。
|
||||
あなたがこれを読んでいるのは、[Appium がオープンソース](https://github.com/appium/appium)だからです。
|
||||
|
||||
### Appium の概念
|
||||
|
||||
#### **クライアント/サーバー アーキテクチャ**
|
||||
|
||||
Appium は、REST API を公開する Web サーバーです。
|
||||
クライアントからの接続を受信し、コマンドを待ち受け、
|
||||
モバイル デバイス上でそれらのコマンドを実行し、コマンドの実行結果を表す HTTP レスポンスで応答します。
|
||||
クライアント/サーバー アーキテクチャがあるという事実は、多くの可能性を開きます。
|
||||
HTTP クライアントの API を持つどの言語でもテストコードを書くことができますが、
|
||||
[Appium クライアントライブラリ](http://appium.io/downloads)の 1 つを使用する方が簡単です。
|
||||
テストが実行されているマシンとは別のマシンにサーバーを置くことができます。
|
||||
テストコードを書き、コマンドを受信して解釈するために
|
||||
[Sauce Labs](https://saucelabs.com/products/mobile-app-testing) や [LambdaTest](https://www.lambdatest.com/feature) のようなクラウドサービスに頼ることもできます。
|
||||
|
||||
#### **セッション**
|
||||
オートメーションは常にセッションのコンテキストで実行されます。
|
||||
クライアントはそれぞれのライブラリに固有の方法でサーバーとのセッションを開始しますが、
|
||||
最終的にはサーバーに `POST /session` リクエストを送信し、'desired capabilities' オブジェクトと呼ばれる JSON オブジェクトを送信します。
|
||||
この時点で、サーバーはオートメーションセッションを起動し、
|
||||
さらにコマンドを送信するために使用されるセッション ID で応答します。
|
||||
|
||||
#### **Desired capabilities**
|
||||
Desired capabilities とは、どのような種類の自動化セッションの起動に興味があるかをサーバーに伝えるために、
|
||||
Appium サーバーに送られるキーと値のセット (すなわち、マップやハッシュ) です。
|
||||
また、自動化中にサーバーの動作を変更できる様々な機能があります。
|
||||
例えば、Android や Windows のセッションではなく、
|
||||
iOS のセッションが必要であることを Appium に伝えるために、
|
||||
`platformName` capability を `iOS` に設定することができます。
|
||||
また、Safari の自動化セッション中に JavaScript を使用して新しいウィンドウを開くことができるようにするために、
|
||||
`safariAllowPopups` の capability を `true` に設定することもできます。
|
||||
Appium で利用可能な機能の完全なリストについては、[capabilities のドキュメント](/docs/en/writing-running-appium/caps.md) を参照してください。
|
||||
|
||||
#### **Appium サーバー**
|
||||
Appium は Node.js で書かれたサーバーです。
|
||||
ソースからビルドしてインストールすることもできますし、
|
||||
[NPM](https://www.npmjs.com/package/appium) から直接インストールすることもできます。
|
||||
|
||||
```
|
||||
$ npm install -g appium
|
||||
$ appium
|
||||
```
|
||||
|
||||
Appium の `ベータ版` は `npm install -g appium@beta` で NPM 経由で公開されています。
|
||||
開発版なので、変更点があるかもしれません。
|
||||
新しいバージョンをインストールする前に
|
||||
`appium@beta` をアンインストールしてください (`npm uninstall -g appium@beta`)。
|
||||
|
||||
#### **Appium クライアント**
|
||||
WebDriver プロトコルへの Appium の拡張をサポートする
|
||||
クライアントライブラリ (Java、Ruby、Python、PHP、JavaScript、および C#) があります。
|
||||
Appium を使用する場合は、
|
||||
通常の WebDriver クライアントの代わりにこれらのクライアントライブラリを使用します。
|
||||
ライブラリの完全なリストは[ここ](/docs/en/about-appium/appium-clients.md)で見ることができます。
|
||||
|
||||
#### **[Appium デスクトップ](https://github.com/appium/appium-desktop)**
|
||||
Appium サーバーの GUI ラッパーがあり、どのプラットフォーム用にもダウンロードできます。
|
||||
Appium サーバーを実行するために必要なすべてのものがバンドルされているので、
|
||||
Node について心配する必要はありません。
|
||||
また、インスペクタが付属しており、アプリの階層をチェックアウトすることができます。
|
||||
これはテストを書くときに便利です。
|
||||
|
||||
### はじめに
|
||||
|
||||
おめでとうございます!
|
||||
これで、Appium の使用を開始するのに十分な知識が身につきました。
|
||||
より詳細な要件と指示のために、
|
||||
[始め方のドキュメント](/docs/en/about-appium/getting-started.md) をご覧になってみてはいかがでしょうか?
|
||||
@@ -0,0 +1,97 @@
|
||||
## Appium プラットフォームのサポート
|
||||
|
||||
Appium は、さまざまなプラットフォームとテストの様式
|
||||
(ネイティブ、ハイブリッド、Web、リアルデバイス、シミュレータなど) をサポートしています。
|
||||
このドキュメントは、これらのそれぞれのサポートレベルと要件を明示するように設計されています。
|
||||
もしくは、それぞれの適切なページへ案内します。
|
||||
|
||||
## Appium team support
|
||||
|
||||
以下はAppiumの開発チームによりサポートされるドライバーです。
|
||||
|
||||
### iOS のサポート
|
||||
|
||||
iOS の自動化は2つのドライバーでサポートされています:
|
||||
|
||||
* [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md)
|
||||
* (非推奨) [UIAutomation Driver](/docs/en/drivers/ios-uiautomation.md)
|
||||
* [safaridriver](/docs/en/drivers/safari.md) は Apple の [safaridriver](https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari?language=objc)
|
||||
|
||||
設定方法については、これらのドライバーのドキュメントを参照してください。
|
||||
|
||||
* バージョン: 12.2 以上 (原則として、Appium は iOS の最新バージョン2つをサポートしています)
|
||||
* デバイス: iPhone、iPad、tvOS 用のシミュレータと実機
|
||||
* ネイティブアプリのサポート: はい、デバッグバージョンの .app (シミュレータ)
|
||||
または正しく署名された .ipa (実機) を使用しています。
|
||||
基本的なサポートは、Apple の [XCUITest](https://developer.apple.com/reference/xctest) (古いバージョンでは [UIAutomation](https://web.archive.org/web/20160904214108/https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/)) フレームワークによって
|
||||
提供されています
|
||||
* モバイル Web のサポート: はい、モバイル Safari の自動化機構を経由できます。
|
||||
手順については、[モバイル Web ドキュメント](/docs/en/writing-running-appium/web/mobile-web.md)を参照してください
|
||||
* ハイブリッドサポート: はい。
|
||||
手順については、[ハイブリッドドキュメント](/docs/en/writing-running-appium/web/hybrid.md)を参照してください
|
||||
* 1つのセッションで複数のアプリの自動化をサポート: いいえ
|
||||
* 複数のデバイスの同時自動化のサポート: はい
|
||||
* ベンダー提供またはサードパーティ製アプリの自動化をサポート: はい。予め端末にインストールされている必要があります。
|
||||
* カスタムの非標準 UI コントロールの自動化のサポート: 最小限の設定です。
|
||||
基本的な自動化を可能にするコントロールに
|
||||
アクセシビリティ情報を設定する必要があります
|
||||
|
||||
### Android のサポート
|
||||
|
||||
Android の自動化は2つのドライバーでサポートされています:
|
||||
|
||||
* [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)
|
||||
* [Espresso Driver](/docs/en/drivers/android-espresso.md)
|
||||
* (非推奨) [UiAutomator Driver](/docs/en/drivers/android-uiautomator.md)
|
||||
* Firefox や [GeckoView](https://wiki.mozilla.org/Mobile/GeckoView) 向けの [geckodriver](/docs/en/drivers/gecko.md)
|
||||
|
||||
設定方法については、これらのドライバーのドキュメントを参照してください。
|
||||
|
||||
* バージョン: 4.3 以上
|
||||
* バージョン 4.3 以降は、Appium の [UiAutomator と UiAutomator2](http://developer.android.com/tools/testing-support-library/index.html#UIAutomator) ライブラリを介してサポートされています。
|
||||
UiAutomator はデフォルトのドライバーです
|
||||
* デバイス: Android エミュレータと実機の Android 端末
|
||||
* ネイティブアプリのサポート: はい
|
||||
* モバイル Web のサポート: はい。自動化は、バンドルされている [Chromedriver](http://chromedriver.chromium.org) サーバーを
|
||||
プロキシとして使用して行われます。
|
||||
4.3 では、公式の Chrome ブラウザまたは Chromium 上でのみ自動化が動作します。
|
||||
4.4 以上では、自動化は標準の「ブラウザ」アプリでも動作します。
|
||||
Chrome / Chromium / Browser がテスト対象のデバイスに既にインストールされている必要があります。
|
||||
手順については、[モバイル Web ドキュメント](/docs/en/writing-running-appium/web/mobile-web.md)を参照してください
|
||||
* ハイブリッドサポート: はい。[ハイブリッドドキュメント](/docs/en/writing-running-appium/web/hybrid.md)を参照してください
|
||||
* デフォルトの Appium オートメーションバックエンドを使用した場合: バージョン 4.4 以降
|
||||
* 1つのセッションで複数のアプリの自動化をサポート: はい
|
||||
* 複数のデバイスの同時自動化のサポート: はい。
|
||||
ただし、Appium はサーバーパラメータ `--port`、`--bootstrap-port` や `--chromedriver-port` に対して
|
||||
異なるポートを使用して起動しなければなりません。
|
||||
これらのパラメータの詳細については
|
||||
[サーバー引数のドキュメント](/docs/en/writing-running-appium/server-args.md) を参照してください
|
||||
* ベンダー提供またはサードパーティ製アプリの自動化をサポート: はい
|
||||
* カスタムの非標準 UI コントロールの自動化のサポート: いいえ
|
||||
|
||||
|
||||
### macOS サポート
|
||||
|
||||
macOS の自動化は以下のドライバーによってサポートされます。
|
||||
|
||||
* macOS 10.15 以上 [Mac2Driver](/docs/en/drivers/mac2.md)
|
||||
* macOS 10.15 未満 (非推奨) [MacDriver](/docs/en/drivers/mac.md)
|
||||
|
||||
### Windows デスクトップのサポート
|
||||
|
||||
Windows の自動化は以下のドライバーによってサポートされます。
|
||||
|
||||
* [WinAppDriver](/docs/en/drivers/windows.md)
|
||||
* Firefox と [GeckoView](https://wiki.mozilla.org/Mobile/GeckoView) は [geckodriver](/docs/en/drivers/gecko.md)
|
||||
|
||||
## ベンダー/コミュニティー
|
||||
|
||||
以下はベンダーやコミュニティーによってサポートされるドライバーです。
|
||||
|
||||
### You.i Engine Support
|
||||
|
||||
* [You.i Engine](https://github.com/YOU-i-Labs/appium-youiengine-driver)
|
||||
|
||||
### Flutter Support
|
||||
|
||||
* [Flutter Driver](https://github.com/truongsinh/appium-flutter-driver)
|
||||
+11
@@ -20,6 +20,7 @@ module.exports = {
|
||||
['Safari (Mac/iOS)', 'safari.md'],
|
||||
['Gecko (Firefox)', 'gecko.md'],
|
||||
['Mac', 'mac.md'],
|
||||
['Mac2', 'mac2.md'],
|
||||
]],
|
||||
['Commands', ['commands',
|
||||
['Status', 'status.md'],
|
||||
@@ -317,6 +318,7 @@ module.exports = {
|
||||
['Appium Style Guide', 'style-guide.md'],
|
||||
['How to Write Docs', 'how-to-write-docs.md'],
|
||||
['Appium Package Structure', 'appium-packages.md'],
|
||||
['Release Appium', 'release-appium.md'],
|
||||
['Credits', 'credits.md']]]
|
||||
],
|
||||
cn: [
|
||||
@@ -397,5 +399,14 @@ module.exports = {
|
||||
['如何编写文档', 'how-to-write-docs.md'],
|
||||
['Appium 包结构', 'appium-packages.md'],
|
||||
['鸣谢', 'credits.md']]]
|
||||
],
|
||||
ja: [
|
||||
['ホーム', 'about-appium/intro.md'],
|
||||
['概要', ['about-appium',
|
||||
['イントロ', 'intro.md'],
|
||||
['Appium クライアント', 'appium-clients.md'],
|
||||
['はじめに', 'getting-started.md'],
|
||||
['サポートプラットフォーム', 'platform-support.md'],
|
||||
]]
|
||||
]
|
||||
};
|
||||
|
||||
@@ -19,6 +19,9 @@ const PLATFORMS = {
|
||||
WINDOWS: 'windows',
|
||||
MAC: 'mac',
|
||||
TIZEN: 'tizen',
|
||||
LINUX: 'linux',
|
||||
ROKU: 'roku',
|
||||
WEBOS: 'webos'
|
||||
};
|
||||
|
||||
const AUTOMATION_NAMES = {
|
||||
@@ -33,9 +36,12 @@ const AUTOMATION_NAMES = {
|
||||
INSTRUMENTS: 'Instruments',
|
||||
WINDOWS: 'Windows',
|
||||
MAC: 'Mac',
|
||||
MAC2: 'Mac2',
|
||||
FLUTTER: 'Flutter',
|
||||
SAFARI: 'Safari',
|
||||
GECKO: 'Gecko',
|
||||
ROKU: 'Roku',
|
||||
WEBOS: 'WebOS'
|
||||
};
|
||||
const DRIVER_MAP = {
|
||||
[AUTOMATION_NAMES.UIAUTOMATOR2.toLowerCase()]: {
|
||||
@@ -70,6 +76,10 @@ const DRIVER_MAP = {
|
||||
driverClassName: 'MacDriver',
|
||||
driverPackage: 'appium-mac-driver',
|
||||
},
|
||||
[AUTOMATION_NAMES.MAC2.toLowerCase()]: {
|
||||
driverClassName: 'Mac2Driver',
|
||||
driverPackage: 'appium-mac2-driver',
|
||||
},
|
||||
[AUTOMATION_NAMES.ESPRESSO.toLowerCase()]: {
|
||||
driverClassName: 'EspressoDriver',
|
||||
driverPackage: 'appium-espresso-driver',
|
||||
@@ -90,6 +100,14 @@ const DRIVER_MAP = {
|
||||
driverClassName: 'GeckoDriver',
|
||||
driverPackage: 'appium-geckodriver'
|
||||
},
|
||||
[AUTOMATION_NAMES.ROKU.toLowerCase()]: {
|
||||
driverClassName: 'RokuDriver',
|
||||
driverPackage: 'appium-roku-driver'
|
||||
},
|
||||
[AUTOMATION_NAMES.WEBOS.toLowerCase()]: {
|
||||
driverClassName: 'WebOSDriver',
|
||||
driverPackage: 'appium-webos-driver'
|
||||
},
|
||||
};
|
||||
|
||||
const PLATFORMS_MAP = {
|
||||
@@ -139,6 +157,9 @@ const PLATFORMS_MAP = {
|
||||
[PLATFORMS.WINDOWS]: () => AUTOMATION_NAMES.WINDOWS,
|
||||
[PLATFORMS.MAC]: () => AUTOMATION_NAMES.MAC,
|
||||
[PLATFORMS.TIZEN]: () => AUTOMATION_NAMES.TIZEN,
|
||||
[PLATFORMS.LINUX]: () => AUTOMATION_NAMES.GECKO,
|
||||
[PLATFORMS.ROKU]: () => AUTOMATION_NAMES.ROKU,
|
||||
[PLATFORMS.WEBOS]: () => AUTOMATION_NAMES.WEBOS
|
||||
};
|
||||
|
||||
const desiredCapabilityConstraints = {
|
||||
|
||||
+17
-9
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
// transpile:main
|
||||
|
||||
import { init as logsinkInit } from './logsink';
|
||||
import { init as logsinkInit, clear as logsinkClear } from './logsink';
|
||||
import logger from './logger'; // logger needs to remain first of imports
|
||||
import _ from 'lodash';
|
||||
import { server as baseServer, routeConfiguringFunction as makeRouter } from 'appium-base-driver';
|
||||
@@ -130,13 +130,17 @@ async function main (args = null) {
|
||||
await logStartupInfo(parser, args);
|
||||
let appiumDriver = new AppiumDriver(args);
|
||||
let routeConfiguringFunction = makeRouter(appiumDriver);
|
||||
let server = await baseServer({
|
||||
const serverOpts = {
|
||||
routeConfiguringFunction,
|
||||
port: args.port,
|
||||
hostname: args.address,
|
||||
allowCors: args.allowCors,
|
||||
basePath: args.basePath,
|
||||
});
|
||||
};
|
||||
if (args.keepAliveTimeout) {
|
||||
serverOpts.keepAliveTimeout = args.keepAliveTimeout * 1000;
|
||||
}
|
||||
let server = await baseServer(serverOpts);
|
||||
if (args.allowCors) {
|
||||
logger.warn('You have enabled CORS requests from any host. Be careful not ' +
|
||||
'to visit sites which could maliciously try to start Appium ' +
|
||||
@@ -160,14 +164,18 @@ async function main (args = null) {
|
||||
process.once(signal, async function onSignal () {
|
||||
logger.info(`Received ${signal} - shutting down`);
|
||||
try {
|
||||
await appiumDriver.deleteAllSessions({
|
||||
force: true,
|
||||
reason: `The process has received ${signal} signal`,
|
||||
});
|
||||
await server.close();
|
||||
try {
|
||||
await appiumDriver.deleteAllSessions({
|
||||
force: true,
|
||||
reason: `The process has received ${signal} signal`,
|
||||
});
|
||||
logsinkClear();
|
||||
} finally {
|
||||
await server.close();
|
||||
}
|
||||
process.exit(0);
|
||||
} catch (e) {
|
||||
logger.warn(e);
|
||||
logger.error(e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -66,6 +66,15 @@ const args = [
|
||||
'on this server'
|
||||
}],
|
||||
|
||||
[['-ka', '--keep-alive-timeout'], {
|
||||
required: false,
|
||||
default: null,
|
||||
dest: 'keepAliveTimeout',
|
||||
type: 'int',
|
||||
help: 'Number of seconds the Appium server should apply as both the keep-alive timeout ' +
|
||||
'and the connection timeout for all requests. Defaults to 600 (10 minutes).'
|
||||
}],
|
||||
|
||||
[['-ca', '--callback-address'], {
|
||||
required: false,
|
||||
dest: 'callbackAddress',
|
||||
|
||||
Generated
+15013
File diff suppressed because it is too large
Load Diff
+13
-14
@@ -11,7 +11,7 @@
|
||||
"firefoxos",
|
||||
"testing"
|
||||
],
|
||||
"version": "1.20.0-beta.0",
|
||||
"version": "1.21.0-rc.2",
|
||||
"author": "https://github.com/appium",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
@@ -22,13 +22,12 @@
|
||||
"url": "https://github.com/appium/appium/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8",
|
||||
"npm": ">=6"
|
||||
"node": ">=12",
|
||||
"npm": ">=6.9"
|
||||
},
|
||||
"main": "./build/lib/main.js",
|
||||
"bin": {
|
||||
"appium": "./build/lib/main.js",
|
||||
"authorize-ios": "./node_modules/.bin/authorize-ios"
|
||||
"appium": "./build/lib/main.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "./lib",
|
||||
@@ -46,21 +45,22 @@
|
||||
"appium-base-driver": "^7.0.0",
|
||||
"appium-espresso-driver": "^1.0.0",
|
||||
"appium-fake-driver": "^1.x",
|
||||
"appium-flutter-driver": "^0",
|
||||
"appium-geckodriver": "^0.3.0",
|
||||
"appium-flutter-driver": "^0.x",
|
||||
"appium-geckodriver": "^0.x",
|
||||
"appium-ios-driver": "4.x",
|
||||
"appium-mac-driver": "1.x",
|
||||
"appium-mac2-driver": "^0.x",
|
||||
"appium-safari-driver": "^2.1.0",
|
||||
"appium-support": "2.x",
|
||||
"appium-tizen-driver": "^1.1.1-beta.4",
|
||||
"appium-uiautomator2-driver": "^1.37.1",
|
||||
"appium-windows-driver": "1.x",
|
||||
"appium-xcuitest-driver": "^3.27.6",
|
||||
"appium-youiengine-driver": "^1.2.0",
|
||||
"appium-youiengine-driver": "^1.2.8",
|
||||
"argparse": "^2.0.1",
|
||||
"async-lock": "^1.0.0",
|
||||
"asyncbox": "2.x",
|
||||
"axios": "^0.21.0",
|
||||
"axios": "^0.x",
|
||||
"bluebird": "3.x",
|
||||
"continuation-local-storage": "3.x",
|
||||
"find-root": "^1.1.0",
|
||||
@@ -68,7 +68,7 @@
|
||||
"longjohn": "^0.2.12",
|
||||
"npmlog": "4.x",
|
||||
"semver": "^7.0.0",
|
||||
"source-map-support": "0.x",
|
||||
"source-map-support": "^0.x",
|
||||
"teen_process": "1.x",
|
||||
"winston": "3.x",
|
||||
"word-wrap": "^1.2.3"
|
||||
@@ -95,8 +95,7 @@
|
||||
"generate-docs": "node ./build/commands-yml/parse.js",
|
||||
"zip": "zip -qr appium.zip .",
|
||||
"upload": "gulp github-upload",
|
||||
"zip-and-upload": "npm run zip && npm run upload",
|
||||
"authorize-ios": "authorize-ios"
|
||||
"zip-and-upload": "npm run zip && npm run upload"
|
||||
},
|
||||
"pre-commit": [
|
||||
"precommit-msg",
|
||||
@@ -112,9 +111,9 @@
|
||||
"handlebars": "^4.2.0",
|
||||
"mocha": "^8.0.1",
|
||||
"pre-commit": "1.x",
|
||||
"sinon": "^9.0.0",
|
||||
"sinon": "^10.0.0",
|
||||
"validate.js": "^0.13.0",
|
||||
"wd": "^1.10.0",
|
||||
"yaml-js": "^0.2.0"
|
||||
"yaml-js": "^0.x"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -7,12 +7,15 @@
|
||||
"test": "mocha test/basic",
|
||||
"clean": "rm -rf node_modules && rm -f package-lock.json && npm install"
|
||||
},
|
||||
"mocha": {
|
||||
"timeout": "1800000"
|
||||
},
|
||||
"author": "Daniel Graham",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"assert": "^2.0.0",
|
||||
"chai": "^4.1.2",
|
||||
"mocha": "^8.0.1",
|
||||
"webdriverio": "^6.0.5"
|
||||
"webdriverio": "^7.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
--timeout 1800000
|
||||
@@ -36,10 +36,16 @@ py.test test/test_ios_selectors.py
|
||||
|
||||
# Tutorial
|
||||
|
||||
## Portuguese
|
||||
## Portuguese 🇧🇷
|
||||
|
||||
The brazilian testing community has a complete and free tutorial teaching from 0 to advanced how to use Appium with Python to do software automation.
|
||||
|
||||
If you can read Portuguese from Brazil, see the tutorial below:
|
||||
|
||||
[Automação de teste de software com Appium e Python - Por Maria Clara Bezerra (Github)](https://github.com/clarabez/appium)
|
||||
|
||||
## English 🇺🇸
|
||||
|
||||
Here is the translated version from portugues to english of the free tutorial from 0 to advanced of using Appium with Python for software automation.
|
||||
|
||||
[Software automation with Appium and Python - By Maria Clara Bezerra (Github)](https://github.com/clarabez/appium-en)
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
source 'https://www.rubygems.org'
|
||||
|
||||
gem 'appium_lib', '~> 9.15'
|
||||
gem 'rest-client', '~> 2.0.2'
|
||||
gem 'rspec', '~> 3.8.0'
|
||||
gem 'cucumber', '~> 3.1.2'
|
||||
gem 'rspec-expectations', '~> 3.8.1'
|
||||
gem 'spec', '~> 5.3.4'
|
||||
gem 'sauce_whisk', '~> 0.1.0'
|
||||
gem 'test-unit', '~> 3.2.8'
|
||||
gem 'pry'
|
||||
gem 'appium_lib', '~> 11.2'
|
||||
gem 'appium_lib_core', '~> 4.2'
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
# Ruby Sample Code
|
||||
|
||||
iOS tests are written by `ruby_lib_core`.
|
||||
Android tests are written by `ruby_lib`.
|
||||
|
||||
## Setup
|
||||
|
||||
* Install `ruby` and `rspec`
|
||||
* Run `bundle install` from this directory
|
||||
1. Install Ruby
|
||||
2. `gem install rspec`
|
||||
3. `bundle install`
|
||||
|
||||
## Running Tests
|
||||
|
||||
* `rspec`
|
||||
* `rspec spec/<name_of_test>_spec.rb`
|
||||
|
||||
@@ -1,29 +1,16 @@
|
||||
require 'spec_helper'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'Android',
|
||||
platformVersion: ENV['SAUCE_LABS'] ? (ENV["ANDROID_PLATFORM_VERSION"] || '7.1') : ENV["ANDROID_PLATFORM_VERSION"],
|
||||
deviceName: ENV["ANDROID_DEVICE_VERSION"] || 'Android',
|
||||
app: ANDROID_APP,
|
||||
automationName: 'UIAutomator2',
|
||||
appActivity: '.app.SearchInvoke'
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
require 'appium_lib'
|
||||
|
||||
describe 'Basic Android interactions' do
|
||||
|
||||
before(:all) do
|
||||
@driver = Appium::Driver.new(desired_caps, false).start_driver
|
||||
caps = android_caps
|
||||
caps[:caps][:appActivity] = '.app.SearchInvoke'
|
||||
@driver = Appium::Driver.new(caps, false).start_driver
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
@driver.quit
|
||||
@driver&.quit
|
||||
end
|
||||
|
||||
it 'should send keys to search box and then check the value' do
|
||||
|
||||
@@ -1,23 +1,9 @@
|
||||
require 'spec_helper'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'Android',
|
||||
platformVersion: ENV['SAUCE_LABS'] ? (ENV["ANDROID_PLATFORM_VERSION"] || '7.1') : ENV["ANDROID_PLATFORM_VERSION"],
|
||||
deviceName: ENV["ANDROID_DEVICE_VERSION"] || 'Android',
|
||||
app: ANDROID_APP,
|
||||
automationName: 'UIAutomator2',
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
require 'appium_lib'
|
||||
|
||||
describe 'Create Android session' do
|
||||
it 'should create and destroy Android sessions' do
|
||||
@driver = Appium::Driver.new(desired_caps, true).start_driver
|
||||
@driver = Appium::Driver.new(android_caps, true).start_driver
|
||||
|
||||
@activity = @driver.current_activity
|
||||
@pkg = @driver.current_package
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'Android',
|
||||
platformVersion: ENV['SAUCE_LABS'] ? (ENV["ANDROID_PLATFORM_VERSION"] || '7.1') : ENV["ANDROID_PLATFORM_VERSION"],
|
||||
deviceName: ENV["ANDROID_DEVICE_VERSION"] || 'Android',
|
||||
automationName: 'UIAutomator2',
|
||||
browserName: 'Chrome'
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
require 'appium_lib'
|
||||
|
||||
describe 'Create Chrome web session' do
|
||||
it 'should create and destroy Android browser session' do
|
||||
@driver = Appium::Driver.new(desired_caps, true).start_driver
|
||||
caps = android_caps
|
||||
caps[:caps][:browserName] = :chrome
|
||||
@driver = Appium::Driver.new(caps, true).start_driver
|
||||
|
||||
@driver.get('https://www.google.com')
|
||||
|
||||
@@ -25,6 +13,9 @@ describe 'Create Chrome web session' do
|
||||
expect(@page_title).to eql 'Google'
|
||||
|
||||
@driver.quit
|
||||
expect { @driver.title }.to raise_error(Selenium::WebDriver::Error::InvalidSessionIdError, 'A session is either terminated or not started')
|
||||
expect {
|
||||
@driver.title
|
||||
}.to raise_error(Selenium::WebDriver::Error::InvalidSessionIdError,
|
||||
'A session is either terminated or not started')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,28 +1,14 @@
|
||||
require 'spec_helper'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'Android',
|
||||
platformVersion: ENV['SAUCE_LABS'] ? (ENV["ANDROID_PLATFORM_VERSION"] || '7.1') : ENV["ANDROID_PLATFORM_VERSION"],
|
||||
deviceName: ENV["ANDROID_DEVICE_VERSION"] || 'Android',
|
||||
app: ANDROID_APP,
|
||||
automationName: 'UIAutomator2'
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
require 'appium_lib'
|
||||
|
||||
describe 'Basic Android selectors' do
|
||||
|
||||
before(:all) do
|
||||
@driver = Appium::Driver.new(desired_caps, true).start_driver
|
||||
@driver = Appium::Driver.new(android_caps, true).start_driver
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
@driver.quit
|
||||
@driver&.quit
|
||||
end
|
||||
|
||||
it 'should find elements by Accessibility ID' do
|
||||
|
||||
@@ -1,44 +1,29 @@
|
||||
require 'spec_helper'
|
||||
require 'appium_lib_core'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'iOS',
|
||||
platformVersion: ENV["IOS_PLATFORM_VERSION"] || '11.4',
|
||||
deviceName: ENV["IOS_DEVICE_NAME"] || 'iPhone 6s',
|
||||
app: IOS_APP,
|
||||
automationName: 'XCUITest',
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
|
||||
# Start the driver
|
||||
describe "IOS Basic Interactions" do
|
||||
describe 'IOS Basic Interactions' do
|
||||
before(:all) do
|
||||
@driver = Appium::Driver.new(desired_caps, false).start_driver
|
||||
@driver = Appium::Core.for(ios_caps).start_driver
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
@driver.quit
|
||||
@driver&.quit
|
||||
end
|
||||
|
||||
it "should send keys to inputs" do
|
||||
textFieldEl = @driver.find_element :id, "TextField1"
|
||||
expect(textFieldEl.attribute(:value)).to be_nil
|
||||
textFieldEl.send_keys "Hello World!"
|
||||
expect(textFieldEl.attribute(:value)).to eq "Hello World!"
|
||||
it 'should send keys to inputs' do
|
||||
text_field_el = @driver.find_element :predicate, 'label == "TextField1"'
|
||||
expect(text_field_el.attribute(:value)).to be_nil
|
||||
text_field_el.send_keys 'Hello World!'
|
||||
expect(text_field_el.attribute(:value)).to eq 'Hello World!'
|
||||
end
|
||||
|
||||
it "should click a button that opens an alert" do
|
||||
buttonElementId = "show alert"
|
||||
buttonElement = @driver.find_element :accessibility_id, buttonElementId
|
||||
buttonElement.click
|
||||
alertTitleId = "Cool title"
|
||||
alertTitleElement = @driver.find_element :accessibility_id, alertTitleId
|
||||
alertTitle = alertTitleElement.attribute :name
|
||||
expect(alertTitle).to eq "Cool title"
|
||||
it 'should click a button that opens an alert' do
|
||||
button_el_txt = 'show alert'
|
||||
button_el = @driver.find_element :accessibility_id, button_el_txt
|
||||
button_el.click
|
||||
alert_title = 'Cool title'
|
||||
alert_el = @driver.find_element :accessibility_id, alert_title
|
||||
alert_title = alert_el.attribute :name
|
||||
expect(alert_title).to eq 'Cool title'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,29 +1,18 @@
|
||||
require 'spec_helper'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'iOS',
|
||||
platformVersion: ENV["IOS_PLATFORM_VERSION"] || '11.4',
|
||||
deviceName: ENV["IOS_DEVICE_NAME"] || 'iPhone 6s',
|
||||
app: IOS_APP,
|
||||
automationName: 'XCUITest',
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
require 'appium_lib_core'
|
||||
|
||||
describe 'Create session' do
|
||||
it 'should create and destroy IOS sessions' do
|
||||
@driver = Appium::Driver.new(desired_caps, false).start_driver
|
||||
@driver = Appium::Core.for(ios_caps).start_driver
|
||||
|
||||
application_element = @driver.find_element :class_name, 'XCUIElementTypeApplication'
|
||||
application_name = application_element.attribute :name
|
||||
expect(application_name).to eq 'TestApp'
|
||||
|
||||
@driver.quit
|
||||
expect { application_element.attribute :name }.to raise_error(Selenium::WebDriver::Error::InvalidSessionIdError, 'A session is either terminated or not started')
|
||||
expect {
|
||||
application_element.attribute :name
|
||||
}.to raise_error(Selenium::WebDriver::Error::InvalidSessionIdError,
|
||||
'A session is either terminated or not started')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,28 +1,19 @@
|
||||
require 'spec_helper'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'iOS',
|
||||
platformVersion: ENV["IOS_PLATFORM_VERSION"] || '11.4',
|
||||
deviceName: ENV["IOS_DEVICE_NAME"] || 'iPhone 6s',
|
||||
automationName: 'XCUITest',
|
||||
browserName: 'Safari',
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
require 'appium_lib_core'
|
||||
|
||||
describe 'Create Safari session' do
|
||||
it 'should create and destroy IOS Safari session' do
|
||||
@driver = Appium::Driver.new(desired_caps, false).start_driver
|
||||
caps = ios_caps
|
||||
caps[:caps][:browserName] = :safari
|
||||
@driver = Appium::Core.for(caps).start_driver
|
||||
|
||||
@driver.get 'https://www.google.com'
|
||||
expect(@driver.title).to eql 'Google'
|
||||
expect(@driver.title).to eq 'Google'
|
||||
|
||||
@driver.quit
|
||||
expect { @driver.title }.to raise_error(Selenium::WebDriver::Error::InvalidSessionIdError, 'A session is either terminated or not started')
|
||||
expect {
|
||||
@driver.title
|
||||
}.to raise_error(Selenium::WebDriver::Error::InvalidSessionIdError,
|
||||
'A session is either terminated or not started')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,51 +1,38 @@
|
||||
require 'spec_helper'
|
||||
require 'appium_lib_core'
|
||||
|
||||
desired_caps = {
|
||||
caps: {
|
||||
platformName: 'iOS',
|
||||
platformVersion: ENV["IOS_PLATFORM_VERSION"] || '11.4',
|
||||
deviceName: ENV["IOS_DEVICE_NAME"] || 'iPhone 6s',
|
||||
app: IOS_APP,
|
||||
automationName: 'XCUITest',
|
||||
},
|
||||
appium_lib: {
|
||||
sauce_username: ENV['SAUCE_LABS'] ? ENV['SAUCE_USERNAME'] : nil,
|
||||
sauce_access_key: ENV['SAUCE_LABS'] ? ENV['SAUCE_ACCESS_KEY'] : nil,
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
describe 'Basic IOS selectors' do
|
||||
|
||||
before(:all) do
|
||||
@driver = Appium::Driver.new(desired_caps, true).start_driver
|
||||
@driver = Appium::Core.for(ios_caps).start_driver
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
@driver.quit
|
||||
@driver&.quit
|
||||
end
|
||||
|
||||
it 'should find elements by Accessibility ID' do
|
||||
compute_sum_buttons = @driver.find_elements :accessibility_id, 'ComputeSumButton'
|
||||
expect(compute_sum_buttons.length).to eql 1
|
||||
expect(compute_sum_buttons.length).to eq 1
|
||||
end
|
||||
|
||||
it 'should find elements by class name' do
|
||||
window_elements = @driver.find_elements :class_name, 'XCUIElementTypeWindow'
|
||||
expect(window_elements.length).to eql 2
|
||||
expect(window_elements.length).to eq 1
|
||||
end
|
||||
|
||||
it 'should find elements by NSPredicateString' do
|
||||
all_visible_elements = @driver.find_elements :predicate, 'visible = 1'
|
||||
expect(all_visible_elements.length).to eql 27
|
||||
expect(all_visible_elements.last.name).to eq 'Check calendar authorized'
|
||||
end
|
||||
|
||||
it 'should find elements by class chain' do
|
||||
window_element = @driver.find_elements :class_chain, 'XCUIElementTypeWindow[1]/*[2]'
|
||||
expect(window_element.length).to eql 1
|
||||
window_elements = @driver.find_elements :class_chain, 'XCUIElementTypeWindow[1]/*[1]'
|
||||
expect(window_elements.length).to eq 1
|
||||
end
|
||||
|
||||
it 'should find elements by XPath' do
|
||||
buttons = @driver.find_elements :xpath, '//XCUIElementTypeWindow//XCUIElementTypeButton'
|
||||
expect(buttons.length).to eql 8
|
||||
expect(buttons.length).to eq 8
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,10 +1,33 @@
|
||||
require 'rubygems'
|
||||
require 'appium_lib'
|
||||
require 'test/unit'
|
||||
extend Test::Unit::Assertions
|
||||
# require 'test/unit'
|
||||
# extend Test::Unit::Assertions
|
||||
|
||||
ANDROID_APP = ENV['SAUCE_LABS'] ? 'http://appium.github.io/appium/assets/ApiDemos-debug.apk' : '../apps/ApiDemos-debug.apk'
|
||||
ANDROID_PACKAGE = 'io.appium.android.apis'
|
||||
def android_caps
|
||||
{
|
||||
caps: {
|
||||
platformName: 'Android',
|
||||
platformVersion: ENV['ANDROID_PLATFORM_VERSION'] || '10',
|
||||
deviceName: 'Android',
|
||||
app: '../apps/ApiDemos-debug.apk',
|
||||
automationName: 'UIAutomator2',
|
||||
},
|
||||
appium_lib: {
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
IOS_APP = ENV['SAUCE_LABS'] ? 'http://appium.github.io/appium/assets/TestApp7.1.app.zip' : '../apps/TestApp.app.zip'
|
||||
def ios_caps
|
||||
{
|
||||
caps: {
|
||||
platformName: 'iOS',
|
||||
platformVersion: ENV["IOS_PLATFORM_VERSION"] || '14.2',
|
||||
deviceName: ENV["IOS_DEVICE_NAME"] || 'iPhone 12',
|
||||
app: '../apps/TestApp.app.zip',
|
||||
automationName: 'XCUITest',
|
||||
},
|
||||
appium_lib: {
|
||||
wait: 60
|
||||
}
|
||||
}
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
git fetch
|
||||
echo "* Creating release branch $1"
|
||||
git checkout -b releases/$1
|
||||
rm -rf node_modules/ npm-shrinkwrap.json package-lock.json
|
||||
npm install
|
||||
npm shrinkwrap
|
||||
echo "* git add ."
|
||||
git add npm-shrinkwrap.json package.json
|
||||
git commit -m 'add shrinkwrap'
|
||||
echo "* npm version $1.0-rc.0"
|
||||
npm version $1.0-rc.0
|
||||
git push origin releases/$1
|
||||
bash ./scripts/release.sh
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
npm version prerelease --preid=$1
|
||||
git push
|
||||
git push --tags
|
||||
# Note: Do not forget to add `--tag rc` for RC channel. Without the tag, the publishment will end up in `latest`.
|
||||
npm publish --tag $1
|
||||
+10
-9
@@ -145,7 +145,8 @@ describe('Config', function () {
|
||||
describe('unsupported nodes', function () {
|
||||
const unsupportedVersions = [
|
||||
'v0.1', 'v0.9.12', 'v0.10.36', 'v0.12.14',
|
||||
'v4.4.7', 'v5.7.0', 'v6.3.1', 'v7.1.1',
|
||||
'v4.4.7', 'v5.7.0', 'v6.3.1', 'v7.1.1', 'v8.1.2',
|
||||
'v9.1.2', 'v10.0.1', 'v11.6.0'
|
||||
];
|
||||
for (const version of unsupportedVersions) {
|
||||
it(`should fail if node is ${version}`, function () {
|
||||
@@ -156,20 +157,20 @@ describe('Config', function () {
|
||||
});
|
||||
|
||||
describe('supported nodes', function () {
|
||||
it('should succeed if node is 8+', function () {
|
||||
process.version = 'v8.1.2';
|
||||
it('should succeed if node is 12+', function () {
|
||||
process.version = '12.20.1';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
it('should succeed if node is 9+', function () {
|
||||
process.version = 'v9.1.2';
|
||||
it('should succeed if node is 13+', function () {
|
||||
process.version = '13.14.0';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
it('should succeed if node is 10+', function () {
|
||||
process.version = 'v10.0.1';
|
||||
it('should succeed if node is 14+', function () {
|
||||
process.version = '14.15.4';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
it('should succeed if node is 11+', function () {
|
||||
process.version = 'v11.6.0';
|
||||
it('should succeed if node is 15+', function () {
|
||||
process.version = '15.5.1';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user