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. To learn how to set up Gradle, see our Gradle documentation.
A sample Gradle with Perfecto project is available here: https://github.com/PerfectoMobileSA/Perfecto_Gradle
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"))))