Skip to content

luossji/XCTestWD

 
 

Repository files navigation

XCTestWD

NPM version build status node version npm download

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

1. Requirements

  • XCode version 8.3.0 and above.
  • iOS version 9.0 and above.

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:

#
#Change the port number to override the default port 
#
$ xcodebuild -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:

#
#Change the port number to override the default port 
#Specify the device name
#
$ xcodebuild -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:

  • Case 1
    Issue:
    When you have some existing XCTestWD instances running and creating new ones.
    Solution:
    verify whether ideviceinstaller and xcrun is properly working on your device and simulator.
    Hint:
    libimobiledevice/ideviceinstaller#48

  • Case 2
    Issue:
    When you have started the XCTestWD instance properly but fails in middle of a testing process.
    Solution:
    See the Macaca Service log to checkout which command leads the error. With detailed and comprehensive log information, please submit an issue to us.
    Optional:
    If you cannot get anything from macaca server log, open the XCTestWD in your node installation path and attatch for debugging on process 'XCTRunner'.

4.2 Swift modules fails to compile

Check carthage installation

About

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

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 62.8%
  • Objective-C 24.1%
  • JavaScript 11.2%
  • Shell 1.1%
  • Makefile 0.4%
  • C 0.4%