Menu
AWS Device Farm
Developer Guide (API Version 2015-06-23)

Working with XCTest UI Testing Framework for iOS and AWS Device Farm

Device Farm provides support for XCTest UI testing framework for iOS, written in both Objective-C and Swift. The following information describes how to use this test framework with Device Farm test types.

What is XCTest UI Testing Framework?

XCTest UI Framework is the new testing framework introduced with Xcode 7. XCTest UI framework extends XCTest with UI testing capabilities. For more information, see User Interface Testing in the Testing with Xcode section of the iOS Developer Library.

Prepare Your iOS XCTest UI Tests

Before you upload iOS XCTest UI tests to Device Farm for testing, make sure that your iOS XCTest UI test runner bundle is contained within a properly formatted .ipa file. To create an .ipa file, you can place your my-project-nameUITest-Runner.app bundle in an empty Payload directory. Next, archive the Payload directory into a .zip file and then change the file extension to .ipa. The *UITest-Runner.app bundle is produced by Xcode when you build your project for testing, and it can be found in the Products directory for your project.

Upload Your iOS XCTest UI Tests

To run your iOS XCTest UI tests on a set of iOS devices in Device Farm, you upload your tests with the Device Farm console as follows:.

  1. Sign in to the Device Farm console at https://console.aws.amazon.com/devicefarm.

  2. In the list of projects, choose the option next to the project that you want to upload your tests to.

    Tip

    If the list of projects is not displayed, then on the secondary navigation bar, for Projects, choose the name of the project that you want to upload your tests to.

    To create a new project, follow the instructions in Create a Project.

  3. If the Create a new run button is displayed, then choose it.

  4. On the Choose your application page, choose Upload.

  5. Browse to and choose your iOS app file. The file must be an .ipa file.

    Note

    Make sure that your .ipa file is built for an iOS device and not for a simulator.

  6. Choose Next step.

  7. On the Configure a test page, choose XCTest UI, and then choose Upload.

  8. Browse to and choose the .ipa file that contains your iOS XCTest UI test runner. In this .ipa file, make sure that the contents are organized according to the instructions as described in Prepare Your iOS XCTest UI Tests.

  9. Choose Next step, and then complete the remaining on-screen instructions to select the devices to run your tests on and to then start the run.

Taking Screenshots in iOS XCTest UI Tests

XCTest UI tests capture screenshots automatically for every step of your tests. These screenshots will be displayed in your Device Farm test report automatically. No additional code is required.

Additional Considerations for iOS XCTest UI Tests

Device Farm supports XCTest UI tests that are written in Objective-C and Swift.