Skip to main content

XCUITest Integration

XCUITest Framework and Perfecto Integration

XCUITest is an iOS-specific UI test automation framework. It’s a dev-friendly solution to create unit and functional tests.

Image alt text

XCUITest Automation Benefits

Image
XCUITest screenshot, automation benefits.

Key Features of the XCUITest Framework & Perfecto

XCUITest Step 1

1. Easy XCUITest Setup & Test Creation

Connecting your existing XCUITest test scripts written in Swift with the Perfecto cloud is quite simple. Perfecto has created an XCTest Gradle plugin that can be added to the iOS project and help configure the cloud URL and the security token. These are required to connect the test to the cloud.

In addition, through the configuration file (JSON), clients easily specify the devices under test and the Perfecto dependency. 

On the left are the basic parameters that need to be configured in the Build.gradle file for your iOS application project in XCode:

XCUITest Step 2

2. Configuring Test Parameters & Cloud Connection

To the left is a sample JSON configuration (configFile.json) file to illustrate what parameters you need to set up to connect XCUITest to the Perfecto cloud.

Once the above settings have been identified, the IPA test file and the application IPA files will be installed and executed on the Perfecto cloud devices. Use the following command to launch the test project via the Perfecto gradle plugin:

gradle perfecto-xctest -PconfigFileLocation=configFile.json

In case you want to leverage your existing KIF/EarlGrey tests as well, please refer to this documentation to learn how.

XCUITest Step 3

3. Stable Test Execution in the Cloud

Because the entire execution of XCUITest test automation runs in the Perfecto cloud, it is guaranteed that the execution will be 100% stable on clean and secured iOS devices. Perfecto fully supports executing the tests either from MacOS XCode, a Windows machine via a Gradle command, or through Jenkins CI. 

XCUITest Step 4

4. Scalable Testing in Parallel & Enhanced Coverage

In addition to execution stability, the Perfecto cloud hosts over 10,000 different smartphones and tablets, allowing teams to extend their test automation coverage and scalability. Running XCUITest tests across multiple real and virtual devices is fully supported and allows teams to identify iOS device-specific issues across multiple configurations.

XCUITest Step 5

5. Detailed Reporting & Fast Feedback

Like with any test execution in the Perfecto cloud, clients receive a detailed test execution report. The report includes screenshots, videos, logs, and failure root cause analysis classification. This capability helps eliminate noise. It allows teams to focus only on the real defects in the iOS app under test. With the fast execution that XCUITest facilitates and the fast feedback that Perfecto Smart Reporting provides, teams can deliver more quality apps faster.