Last updated: Jan 08, 2020 15:16
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
.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.gradlefile, and configuration file (
configFile.json) as parameters to the job.Click to view image
Add a string parameter with your Perfecto Lab URL as the default value.Click to view image
Add a string parameter with your security token as the default value.Click to view image
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.Click to view image
Run the job and get the Gradle output in the console logs. The following figure shows sample output.Click to view 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:
/root/gradlewis 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.