# appium-xcuitest-driver
[![NPM version](http://img.shields.io/npm/v/appium-xcuitest-driver.svg)](https://npmjs.org/package/appium-xcuitest-driver)
[![Downloads](http://img.shields.io/npm/dm/appium-xcuitest-driver.svg)](https://npmjs.org/package/appium-xcuitest-driver)
[![Release](https://github.com/appium/appium-xcuitest-driver/actions/workflows/publish.js.yml/badge.svg)](https://github.com/appium/appium-xcuitest-driver/actions/workflows/publish.js.yml)
Appium XCUITest Driver is a combined solution, which allows to perform automated black-box testing of iOS and tvOS native applications and WebKit web views.
The native testing is based on Apple's [XCTest](https://developer.apple.com/documentation/xctest) framework and the fork of Facebook's [WebDriverAgent](https://github.com/appium/WebDriverAgent) server (the [original](https://github.com/facebookarchive/WebDriverAgent) project is not supported anymore).
Web views communication is done via [Webkit remote debugger protocol](https://github.com/appium/appium-remote-debugger). Real devices communication is ensured by [appium-ios-device](https://github.com/appium/appium-ios-device) library.
Simulators communication is ensured by [appium-ios-simulator](https://github.com/appium/appium-ios-simulator) library.
In the native mode the driver operates in scope of [WebDriver W3C protocol](https://w3c.github.io/webdriver) with several platform-specific extensions. Web views communication only supports the obsolete [JWP protocol](https://webdriver.io/docs/api/jsonwp.html).
*Note*: Issue tracking for this repo has been disabled. Please use the [main Appium issue tracker](https://github.com/appium/appium/issues) instead.
## Requirements
On top of standard Appium requirements XCUITest driver also expects the following prerequisites:
- Only macOS is supported as the host platform
- Xcode and developer tools must be installed. Note, that usually some time is needed for the Appium team to pick up with the support of the most recent Xcode versions, especially beta ones.
- Connected real devices must be trusted, added to your developer profile and configured properly along with WebDriverAgent signing. Read [Real devices](#real-devices) section _carefully_ to set them up properly before running your tests.
- Starting from iOS/iPadOS version iOS/iPadOS 16 real devices require enabling of _Developer Mode_ option in _Settings -> Privacy & Security_
- The minimum supported Xcode SDK version for the current driver snapshot is *10.2 (iOS 12.2)*. Consider using earlier releases of the driver (see [Xcode version support](#xcode-version-support) section below) if it is necessary to test older iOS versions on real devices. Also, it is highly recommended to always use the same major version of Xcode SDK, which was used to build the particular iOS/tvOS version on your real device under test (for example Xcode 11 for iOS 13, Xcode 12 for iOS 14, etc).
- Web views must be debuggable in order to test them. If it is not possible to connect to your web view(s) using [Safari remote debugger](https://appletoolbox.com/use-web-inspector-debug-mobile-safari/) then XCUITest won't be able to connect to them as well.
- Since version 3.33.0 (included into Appium 1.20.0+) of XCUITest driver the [Carthage](https://github.com/Carthage/Carthage) dependency *is not needed anymore*. Prior to that version it was required and could be installed using [brew](https://brew.sh/): `brew install carthage`.
## Optional dependencies
- [xcpretty](https://github.com/supermarin/xcpretty) tool could be used to make Xcode output easier to read. It could be installed using `gem install xcpretty` command.
- For test video recording we use [ffmpeg](https://ffmpeg.org/). It could be installed using [brew](https://brew.sh/): `brew install ffmpeg`
- [IDB](https://github.com/facebook/idb), [go-ios](https://github.com/danielpaulus/go-ios) and [tidevice](https://github.com/alibaba/taobao-iphone-device) could be used to improve some real device/Simulator interactions
- [WIX AppleSimulatorUtils](https://github.com/wix/AppleSimulatorUtils) could be used to improve some Simulator interactions
## Xcode version support
* module versions below `2.96.0` only supports XCode 8 and newer
* module version `2.96.0` and above only supports XCode 9 and newer
* module version `3.0.0` and above only supports Xcode 10 and newer
* module version `3.32.0` and above only supports Xcode 10.2 and newer
## Real devices
### Configuration
See [real device configuration documentation](docs/real-device-config.md).
### Known problems
- After many failures on real devices it could transition to a state where connections are no longer being accepted. To possibly remedy this issue reboot the device. Read https://github.com/facebook/WebDriverAgent/issues/507 for more details.
- iPhone/iPad real devices show overlay, which has `Automation Running Hold both volume buttons to stop` text, since iOS/iPadOS 15. This is a known limitation of XCTest framework. This limitation does not affect screenshooting APIs though (e.g. the overlay is not visible on taken screenshots).
- iPhone/iPad real devices [require passcode or touch id](https://github.com/appium/appium/issues/15898#issuecomment-927340411) when they start a XCTest session since iOS/iPadOS 15. Disabling passcode/touch id in the device preference allows to workaround the behaviour above.
- OpenSSL v3 breaks secured communication with real devices. It can cause a [Failed to receive any data within the timeout](https://github.com/appium/appium/issues/16399) error in [appium-ios-device](https://github.com/appium/appium-ios-device). Please read [this issue](https://github.com/appium/appium-ios-device/pull/88#discussion_r825315862) for more details.
- Please make sure your environment has Open SSL v1 for NodeJS environment, or prepare an OpenSSL v3 build by patching `OPENSSL_TLS_SECURITY_LEVEL=1`. (e.g. [an article](https://www.feistyduck.com/library/openssl-cookbook/online/ch-openssl.html))
- This configuration is only necessary for XCUITest driver v4.3.0 or lower.
#### Weird state
**Note:** Running `WebDriverAgent` tests on a real device is particularly flakey. If things stop responding, the only recourse is, most often, to restart the device. Logs in the form of the following _may_ start to occur:
```shell
info JSONWP Proxy Proxying [POST /session] to [POST http://10.35.4.122:8100/session] with body: {"desiredCapabilities":{"ap..."
dbug WebDriverAgent Device: Jul 26 13:20:42 iamPhone XCTRunner[240] <Warning>: Listening on USB
dbug WebDriverAgent Device: Jul 26 13:21:42 iamPhone XCTRunner[240] <Warning>: Enqueue Failure: UI Testing Failure - Unable to update application state promptly. <unknown> 0 1
dbug WebDriverAgent Device: Jul 26 13:21:57 iamPhone XCTRunner[240] <Warning>: Enqueue Failure: UI Testing Failure - Failed to get screenshot within 15s <unknown> 0 1
dbug WebDriverAgent Device: Jul 26 13:22:57 iamPhone XCTRunner[240] <Warning>: Enqueue Failure: UI Testing Failure - App state of (null) is still unknown <unknown> 0 1
```
### Real device security settings
On some systems, especially CI ones, where tests are executed by a command line agents, macOS Accessibility restrictions make the `WebDriverAgent` system unable to retrieve the development keys from the system keychain. This is usually manifest
by `xcodebuild` returning an error code `65`. A workaround for this is to use a private key that is not stored on the system
keychain. See [this issue](https://github.com/appium/appium/issues/6955) and [this Stack Exchange post](http://stackoverflow.com/questions/16550594/jenkins-xcode-build-works-codesign-fails).
To export the key, use
```
security create-keychain -p [keychain_password] MyKeychain.keychain
security import MyPrivateKey.p12 -t agg -k MyKeychain.keychain -P [p12_Password] -A
```
where `MyPrivateKey.p12` is the private development key exported from the system keychain.
The full path to the keychain can then
没有合适的资源?快使用搜索试试~ 我知道了~
Appium iOS驱动程序,由 Apple XCUITest 提供支持_JavaScript_代码_相关文件_下载
共463个文件
nib:207个
js:120个
plist:36个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 159 浏览量
2022-07-14
18:03:38
上传
评论
收藏 24.16MB ZIP 举报
温馨提示
Appium XCUITest Driver 是一个组合解决方案,它允许对 iOS 和 tvOS 原生应用程序和 WebKit Web 视图执行自动黑盒测试。本机测试基于 Apple 的XCTest框架和 Facebook 的WebDriverAgent服务器的 fork(不再支持原始项目)。Web 视图通信是通过Webkit 远程调试器协议完成的。appium-ios-device库确保了真实设备的通信。模拟器通信由appium-ios-simulator库确保。 在本机模式下,驱动程序在WebDriver W3C 协议的范围内运行,具有几个特定于平台的扩展。Web 视图通信仅支持过时的JWP 协议。 更多详情、使用方法,请下载后细读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
Appium iOS驱动程序,由 Apple XCUITest 提供支持_JavaScript_代码_相关文件_下载
(463个子文件)
Assets.car 11.93MB
Assets.car 1.36MB
CodeResources 28KB
CodeResources 10KB
CodeResources 5KB
CodeResources 5KB
CodeResources 2KB
CodeResources 2KB
CodeResources 2KB
.eslintignore 24B
.eslintrc 49B
.eslintrc 48B
.gitignore 149B
XCTestAssertionsImpl.h 23KB
XCTestAssertions.h 14KB
XCTestCase.h 10KB
XCUIElement.h 10KB
XCTestCase+AsynchronousTesting.h 7KB
XCTestRun.h 5KB
XCUIElementTypeQueryProvider.h 5KB
XCTestObservation.h 4KB
XCUIElementQuery.h 4KB
XCTestSuite.h 3KB
XCAbstractTest.h 3KB
XCUIElementTypes.h 3KB
XCTest.h 3KB
XCUICoordinate.h 2KB
XCUIKeyboardKeys.h 2KB
XCTestObserver.h 2KB
XCUIElementAttributes.h 2KB
XCTestProbe.h 2KB
XCTestDefines.h 2KB
XCUIApplication.h 2KB
XCTestLog.h 2KB
XCTestObservationCenter.h 2KB
XCTestCaseRun.h 2KB
XCTestSuiteRun.h 2KB
XCUIDevice.h 1KB
XCUIRemote.h 1KB
XCTestErrors.h 744B
XCTestExpectation.h 660B
content.html 311B
IDEBundleInjection 94KB
driver.js 49KB
web.js 23KB
safari-basic-e2e-specs.js 20KB
file-movement.js 19KB
gesture-specs.js 19KB
context.js 18KB
find-e2e-specs.js 17KB
gesture.js 15KB
recordscreen.js 15KB
performance.js 14KB
utils.js 14KB
certificate.js 13KB
element-specs.js 13KB
element-e2e-specs.js 12KB
simulator-management.js 12KB
gesture-e2e-specs.js 12KB
basic-e2e-specs.js 11KB
safari-nativewebtap-e2e-specs.js 10KB
safari-window-e2e-specs.js 10KB
element.js 10KB
general.js 10KB
driver-e2e-specs.js 10KB
ios-fs-helpers.js 10KB
css-converter.js 9KB
record-audio.js 9KB
xctest.js 8KB
device-connections-factory.js 8KB
ios-deploy.js 8KB
driver-specs.js 8KB
log.js 7KB
utils-specs.js 6KB
find.js 6KB
execute.js 6KB
simulator-management-specs.js 6KB
general-specs.js 6KB
desired-caps.js 6KB
safari-network-log.js 6KB
safari-execute-e2e-specs.js 6KB
find-specs.js 5KB
app-management.js 5KB
desired.js 5KB
pcap.js 5KB
file-movement-e2e-specs.js 5KB
app-utils.js 5KB
permissions.js 5KB
touch-id-e2e-specs.js 4KB
safari-ssl-e2e-specs.js 4KB
ios-crash-log.js 4KB
location-specs.js 4KB
source.js 4KB
language-specs.js 4KB
xctest-e2e-specs.js 4KB
ios-simulator-log.js 3KB
alert-specs.js 3KB
alert-e2e-specs.js 3KB
safari-console-log.js 3KB
helpers.js 3KB
共 463 条
- 1
- 2
- 3
- 4
- 5
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功