macacajs/XCTestWD

Name: XCTestWD

Owner: Macaca

Description: A Swift implementation of WebDriver server for iOS that runs on Simulator/iOS devices.

Created: 2017-04-23 08:04:52.0

Updated: 2018-05-16 09:57:32.0

Pushed: 2018-05-16 09:57:30.0

Homepage: https://macacajs.github.io

Size: 681

Language: Swift

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

XCTestWD

NPM version node version npm download CircleCI

Swift implementation of WebDriver server for iOS that runs on Simulator/iOS devices.

1. Requirements
2. Starting XCTestWD

XCTestWD can be either started with XCode IDE or via simple xcodebuild command line. By default, the webdriver agent occupies port 8001. You can override the default port in XCode by searching XCTESTWD_PORT under project build settings. Alternatively, it can also be overrided when you execute command line method as specified in 2.2. Using Xcodebuild

2.1. Using Xcode

Download the project and open the XCode project, checkout the scheme XCTestWDUITests and run the test case XCTextWDRunner

2.2. Using XcodeBuild

Open the terminal, go to the directory where contains XCTestWD.xcodeproj file and execute the following command:


ange the port number to override the default port 

odebuild -project XCTestWD.xcodeproj \
       -scheme XCTestWDUITests \
       -destination 'platform=iOS Simulator,name=iPhone 6' \
       XCTESTWD_PORT=8001 \
       clean test

To execute for iOS device, run the following command:


ange the port number to override the default port 
ecify the device name

odebuild -project XCTestWD.xcodeproj \
       -scheme XCTestWDUITests \
       -destination 'platform=iOS,name=(your device name)' \
       XCTESTWD_PORT=8001 \
       clean test

Note: For versions above wxtestwd 2.0.0, please install ideviceinstaller for supporting real device testing

3. Element Types

In the current protocol, element strings for each XCUIElementType are generated based on the existing mapping in reference/xctest/xcuielementtype

4. Common Issues
4.1 Socket hangup error

Socket Hangup Error happens in the following two scenarios:

Additional Info
The project path is at

$(npm root -g)/macaca-ios/node_modules/xctestwd"

Set up the linebreak for swift error and exceptions:

2017-12-14 10 56 33

Run your command regularly, once the driver has been initialized, attach the process:

2017-12-14 10 55 14

4.2 Swift modules fails to compile

Check carthage installation

4.3 Debug info

Now XCTestWD supports gathering debug log into log files which is stored in “Your-App-Sandbox-Root”/Documents/Logs dir. For real devices, you can connect to itunes and choose backup for XCTestWDUITests and get the debug log. For iOS simulators, the log file is in your computer's simulator app directory like:

ers/${user-name}/Library/Developer/CoreSimulator/Devices \
evice-id}/data/Containers/Data/Application/${app-id}/Documents/Logs"

You can use xcrun simctl list to get the id of the booted device.

Contributors

|
SamuelZhaoY

|
xudafeng

|
holy-lousie

|
adudurant

|
Chan-Chun

|
gurisxie

| :—: | :—: | :—: | :—: | :—: | :—: |

This project follows the git-contributor spec, auto upated at Sat Apr 21 2018 12:04:14 GMT+0800.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.