Integrating XCTest UI for iOS with Device Farm
Device Farm provides support for XCTest UI testing framework for iOS. Specifically, Device Farm supports XCTest UI tests
written in both Objective-C and Swift
XCTest UI framework is the new testing framework introduced with Xcode 7. This framework extends XCTest with
UI testing capabilities. For more information, see User Interface Testing
For more information about testing in Device Farm, see Test frameworks and built-in tests in AWS Device Farm.
Use the following instructions to integrate Device Farm with the XCTest UI testing framework for iOS.
Topics
Prepare your iOS XCTest UI tests
Your iOS XCTest UI test runner bundle must be contained in a properly formatted .ipa file.
To create an .ipa file, 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. It can be found in the Products directory for your project.
Upload your iOS XCTest UI tests
Use the Device Farm console to upload your tests.
Sign in to the Device Farm console at https://console.aws.amazon.com/devicefarm
. -
On the Device Farm navigation panel, choose Mobile Device Testing, then choose Projects.
-
In the list of projects, choose the project that you want to upload your tests to.
Tip
You can use the search bar to filter the project list by name.
To create a project, follow the instructions in Creating a project in AWS Device Farm
-
If the Create a new run button is displayed, choose it.
-
On the Choose application page, select Choose File.
-
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.
-
Choose Next.
-
On the Configure page, in the Setup test framework section, choose XCTest UI, and then select Choose File.
-
Browse to and choose the .ipa file that contains your iOS XCTest UI test runner.
-
Choose Next, and then complete the remaining instructions to select the devices to run your tests on and start the run.
(Optional) Take screenshots in iOS XCTest UI tests
XCTest UI tests capture screenshots automatically for every step of your tests. These screenshots are displayed in your Device Farm test report. No additional code is required.