Import Test Results using Gradle Plugin

QMetry Test Management plugin for Gradle has been designed to seamlessly integrate your gradle project with QMetry.

QTMGradlePlugin uploads result file(s), generated in a Gradle project, to QMetry. The plugin, if used in a gradle project, provides an additional gradle task "qtmUploadResults".

Using the Plugin

You can use the plugin from anywhere in your gradle project, by including the following code in the 'build.gradle' file.


Code Snippet

plugins
{
	id 'com.qmetry.QTMGradlePlugin' version '1.0'
}

qtmConfig
{
	qtmUrl='https://testmanagement.qmetdry.com/'
	qtmAutomationApiKey='zEzs7iy77D8ARWX8xMFzJRZTzb66W0LCyaK6xdec'
	automationFramework='JUNIT'
	testResultFilePath='/test-results/test/TEST-ispl.sample.AppSecondTest.xml'
	testSuiteId='STR-TS-01'
	project='Demo Project'
	platform='Chrome'
	release='Default Release'
	cycle='Default Cycle'
	build='Demo Build'
}


Use the following command from your project.

gradle test qtmUploadResults



The task qtmUploadResults always refers qtmConfig in build.gradle file of your project.


Provide the following details.

Parameter

Type

Required

Description

qtmUrl

string

Yes

URL to QMetry Test Management instance

qtmAutomationApiKey

string

Yes

Automation Key
automationFrameworkstringYes

Supported frameworks are:

  • JUNIT
  • TESTNG
  • CUCUMBER
  • QAS
  • HPUFT
testResultFilePathstringYesPath to result file (or directory for multiple files) relative to build directory
testSuiteIdstringNoId or Entity key of the target test suite.
projectstringYesProject Id or Project Key or Project name
platformstringNoPlatform Id or Platform Name
releasestringNoRelease Id or Release name
cyclestringNoCycle Id or Cycle Name
buildstringNoBuild Id or Build name

Working Sample

Please look at Sample projects sections for a more concrete end-to-end example.