Jenkins with XCUITest
You can use the Gradle plugin as part of a Jenkins CI controlled job. This section guides you through the process of integrating your automation scripts with Jenkins based on your use case.
Scenario 1 | Standalone mode with Gradle plugin
You run Gradle from Jenkins using the Jenkins Gradle plugin. Application, XCTest, XCUITest .ipa
/.app
files exist in the local file system and present in your configFile.json
file, similar to this one.

-
Create a new parameterized Jenkins job.
The job uses the Perfecto Lab URL, security token,
build.gradle
file, and configuration file (configFile.json
) as parameters to the job. -
Add a string parameter with your Perfecto Lab URL as the default value.
-
Add a string parameter with your security token as the default value.
-
Add an Invoke Gradle script build step where we run the plugin task with the command. Also add the job name and build number in the command. These parameters allow you to filter the specific tests in the reports.
For more information on the relevant Gradle parameters, see iOS configuration parameters for the Gradle Plugin.
Copyperfecto-xctest
-PconfigFileLocation=configFile.json
-PjobName=${JOB_NAME} -PjobNumber=${BUILD_NUMBER} -Pdebug=false -PcloudURL=${CLOUD_URL}
-PsecurityToken=${SECURITY_TOKEN} -
Run the job and get the Gradle output in the console logs. The following figure shows sample output.
Scenario 2 | Standalone mode with Gradle wrapper
This scenario is the same as Scenario 1 without the Jenkins Gradle plugin. Instead, you run an installed version of the Gradle wrapper.

- Perform steps 1-3 as described in Scenario 1.
- Add another Execute shell build step to the Jenkins project.
-
In the build step form, add the command to execute the Gradle wrapper. For example:
Copy/root/gradlew perfecto-xctest
-PconfigFileLocation=configFile.json
-PjobName=${JOB_NAME} -PjobNumber=${BUILD_NUMBER} -Pdebug=false -PcloudURL=${CLOUD_URL}
-PsecurityToken=${SECURITY_TOKEN}where:
/root/gradlew
is the full path to the Gradle wrapper executable.For more information on the relevant Gradle parameters, see iOS configuration parameters for the Gradle Plugin.
-
Run the job as in the previous scenario. The output is sent to the console.