mirror of
https://github.com/appium/appium.git
synced 2026-11-12 13:32:01 +08:00
Compare commits
34
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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: [10.x, 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?
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
|
||||
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
|
||||
|
||||
@@ -10,24 +15,21 @@ 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 [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)
|
||||
* 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.
|
||||
* 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: 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 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.
|
||||
@@ -37,7 +39,9 @@ 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 [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.
|
||||
|
||||
@@ -63,6 +67,28 @@ Please refer to these driver docs for setup instructions.
|
||||
* 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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. |
|
||||
|
||||
@@ -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) |
|
||||
|
||||
@@ -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,23 @@
|
||||
# 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.
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -269,19 +202,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) や [Phonegap](http://phonegap.com/) のようなプロジェクトでは、
|
||||
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'],
|
||||
]]
|
||||
]
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@ const AUTOMATION_NAMES = {
|
||||
INSTRUMENTS: 'Instruments',
|
||||
WINDOWS: 'Windows',
|
||||
MAC: 'Mac',
|
||||
MAC2: 'Mac2',
|
||||
FLUTTER: 'Flutter',
|
||||
SAFARI: 'Safari',
|
||||
GECKO: 'Gecko',
|
||||
@@ -70,6 +71,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',
|
||||
|
||||
+6
-2
@@ -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 ' +
|
||||
|
||||
@@ -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',
|
||||
|
||||
+4
-5
@@ -11,7 +11,7 @@
|
||||
"firefoxos",
|
||||
"testing"
|
||||
],
|
||||
"version": "1.20.0-beta.0",
|
||||
"version": "1.21.0-beta.0",
|
||||
"author": "https://github.com/appium",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
@@ -27,8 +27,7 @@
|
||||
},
|
||||
"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",
|
||||
@@ -50,6 +49,7 @@
|
||||
"appium-geckodriver": "^0.3.0",
|
||||
"appium-ios-driver": "4.x",
|
||||
"appium-mac-driver": "1.x",
|
||||
"appium-mac2-driver": "^0",
|
||||
"appium-safari-driver": "^2.1.0",
|
||||
"appium-support": "2.x",
|
||||
"appium-tizen-driver": "^1.1.1-beta.4",
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user