Skip to content

Gradle plugin for uploading TestNG reports to XRay

Notifications You must be signed in to change notification settings

klikaba/gradle-xray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xray Gradle Plugin

Gradle plugin for uploading TestNG reports to XRay

Summary

This plugin allows you to upload TestNG XML reports to Xray on Jira.

How to install

File : build.gradle

plugins {
  id "ba.klika.xray" version "1.0"
}

Or using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.ba.klika:xray:1.0"
  }
}

apply plugin: 'ba.klika.xray'

How to use

Generate Xray API credentials

File : build.gradle

xrayCredentials {
    clientId = "xxxxxxxxxxxxx"
    clientSecret = "xxxxxxxxxxxx"
}

Upload XML Report

To be able to upload XML report you must know two things: Test execution key and file path.

File : build.gradle

xrayCredentials {
    clientId = "xxxxxxxxxxxx"
    clientSecret = "xxxxxxxxxx"
}

task uploadTest(type: ba.klika.tasks.UploadXmlReportTask) {
    testExecution = "TEST-123"
    filePath = "$buildDir/reports/tests/{testName}/testng-results.xml".toString()
}

In order to upload XML report after test automatically just add finalizedBy at the end of the test referencing to the upload task like this:

task regressionTest(type: Test) {
    useTestNG() {
        useDefaultListeners = false
        suites "src/test/resources/suites/regression_test.xml"
    }
    finalizedBy uploadRegressionTest
}

About

Gradle plugin for uploading TestNG reports to XRay

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages