Integrate Gradle with Perfecto Smart Reporting
If your Gradle project is configured to run in Perfecto, you can integrate it with Perfecto Smart Reporting by performing the following steps.
A sample Gradle with Perfecto project is available here: https://github.com/PerfectoMobileSA/Perfecto_Gradle
Important: This document includes references to a third-party product, Gradle. The user interface and usage of third-party products are subject to change without notice. For the latest published information about Gradle, see https://docs.gradle.org/current/userguide/userguide.html.
To integrate Gradle with Smart Reporting:
- Open the
build.gradle
file. -
Edit the file as follows:
-
For the project to be able to access the Reporting SDK, add the following jars:
Copycompile ('com.perfecto.reporting-sdk:reportium-java:+') {
exclude group: "org.seleniumhq.selenium", module: "selenium-remote-driver" exclude group: "org.seleniumhq.selenium", module: "selenium-java" exclude group: "org.seleniumhq.selenium", module: "selenium-api" } -
If your project is integrated with a CI tool, also add the following:
CopysystemProperties['jobName']=project.hasProperty('jobName') ? jobName : "NA"systemProperties['jobNumber']=project.hasProperty('jobNumber') ? jobNumber : null
-
-
In the code, fetch the
jobName
andjobNumber
as follows:Copy.withJob(new Job(System.getProperty("jobName") ,
Integer.parseInt(System.getProperty("jobNumber"))))