QMetry Test Management plugin for Jenkins is designed to seamlessly integrate
QMetry Test Management plugin for Jenkins is designed to seamlessly integrate your CI/CD pipeline with QMetry Test Management.
Download Link: QMetry Test Management for Jenkins
About the Plugin
QMetry Test Management plugin for Jenkins has been designed to seamlessly integrate your CI/CD pipeline with QMetry Test Management.
Download Link: QMetry Test Management for Jenkins
About the Plugin
QMetry Test Management plugin for Jenkins has been designed to seamlessly integrate your CI/CD pipeline with QMetry.
Easily configure Jenkins to submit your test results to QMetry Easily configure Jenkins to submit your test results to QMetry without needing to write any code or deal with REST API. Your Test Results could be from any automation framework like Cucumber, Test NG, JUnit, QAF and more.
...
Parameter | Type | Required | Description | |||||
QMetry URL | string | Yes | QMetry Test Management URL | |||||
Automation API Key | string | Yes | Your API Key. API Key is unique for a specific user in a single project. The result will be imported for the project associated with the given API Key. | |||||
Proxy URL | string | No | Enter Proxy URL if you have configured any Proxy. | |||||
Automation Framework | string | Yes | Format of result file to be imported. Supported formats:
| |||||
Automation Hierarchy | string | No | Hierarchy which will be used to parse test result files on QTM. Supported formats are :- JUnit 1 - Use current Hierarchy in which JUnit Testcase is treated as TestStep and Testsuite is treated as Testcase (default) 2 - Use Junit Testcase as Testcase and link all those (from all testsuites and all files of Junit) to one Testsuite 3 - Create Multiple Testsuites and then link their respective testcases in corresponding Testsuites TestNG 1 - Use class 'name' as Testcase and test-method as TestStep (default) 2 - Use test-method as Testcase 3 - Use test 'name' as Testcase and test-method as TestStep | |||||
Result File(s) Path/Directory | string | Yes | Path wherein your result file to be uploaded. Supported file extensions: .json, .xml and .zip (zip file must contain files of the format given in the 'Automation Framework' param). | |||||
Test Suite ID | string | No | Key of the test suite exists in QMetry. In the absence of Key, a new test suite will be created. Note: If for Junit - 3 - Create Multiple Testsuites and then link their respective testcases in corresponding Testsuites - is chosen, then the parameter Test Suite ID will be ignored. | |||||
Test Suite Name | string | No | If existing "testsuiteId" is not being used and auto-generated name for the new test suite is not desired, then a custom test suite name can be entered for this parameter. Note: If for Junit - 3 - Create Multiple Testsuites and then link their respective testcases in corresponding Testsuites - is chosen, then this parameter will be ignored. | |||||
Project | string | Yes | ID/Key/Name of the Project within which the test suite will be created. | |||||
Release | string | *No | ID/Name of the Release in which the test execution will be created. If Release is not mentioned, then Default Release will be considered. | |||||
Cycle | string | No | ID/Name of the Cycle in which the test execution will be created. If Cycle is not mentioned, then Default Cycle will be considered. | |||||
Build | string | No | Build Name/Id. In the absence of a value, it will create the default build. | |||||
Platform | string | No | Name of Platform on which test run to be executed. | |||||
Test Case Fields | JSON | No | Mention system defined fields and user defined fields for test case as shown in Test Case JSON format below. All the mandatory fields other than Summary should be mentioned in this parameter. | |||||
Test Suite Fields | JSON | No | Mention system defined fields and user defined fields for test case as shown in Test Suite JSON format below. All the mandatory fields other than Summary should be mentioned in this parameter. This parameter will be ignored if existing Test suite Id is used to upload results. |
...
4. Finally check test execution page in QMetry and review your test run results.
Pipeline
QMetry Test Management supports Jenkins Pipeline for implementing and integrating continuous delivery pipelines into Jenkins.
Let’s create a standard Pipeline job in Jenkins.
...
Panel | ||
---|---|---|
| ||
stage( 'Upload Result to QTM' ){ step([$ class : 'QTMReportPublisher' , disableaction: false , qtmUrl: 'https://newuiqa.qmetry.com/' , automationFramework: 'JUNIT' , automationHierarchy: '2' , testResultFilePath: '/cucumber' , qtmAutomationApiKey: '4FR2Oo1g42vUnb5NtDgi3JIjzrFOvUUV8QJBk38D' , project : '7242' , release: 'Release 1' , cycle: 'Cycle 1' , buildName: 'testBuild1' , platformName: 'Jenkins' , testSName: 'junit pipeline' , proxyUrl: '' , testSuiteName: 'TC2-TS-116' testcaseFields: '{"description":"Automated Test case", "testCaseType":"Automated", "testCaseState":"Open", "component":["UI"], "priority":"Blocker", "testcaseOwner":"liza.mathew", "estimatedTime":"143", "userDefinedFields" : {"Integrate" : "Custom Field Testcase"}}' , testsuiteFields: '{"description":"Automated Test suite", "testsuiteOwner": "liza.mathew", "testSuiteState": "New", "userDefinedFields": {"Integrate" : "Custom Field Testsuite"}}' ]) } |
Note: testSName is "Test Suite Name" and testSuiteName is "Test Suite ID" of the test suite.
Syntax of automationFramework:
- CUCUMBER
- TESTNG
- JUNIT
- QAS
- HPUFT
Parameters
Refer to the Parameters section for Freestyle Project above.
7. On successful completion of the process, you can see the console output. It displays success message for uploading the result file.
8. Finally check test execution page in QMetry and review your test run results.
Define Parameters
To define parameters for your job, select the This project is parameterized check box.
The Add Parameter drop-down is enabled with the list of parameter types. Use the drop-down button to add as many parameters as you need.
There are different parameter types available. The way parameters take effect according their respective parameter type.
For example,
Choice Parameter and String Parameter are selected, and corresponding parameters are added as shown below.
The above parameters will be parsed dynamically at the run time.
The field values should be entered in the following syntax:
${ParameterName}
For example,
For the parameters created above, the field value would be ${API} and ${TRID} respectively. The parameter values will be parsed accordingly for the corresponding fields.
The values can also be changed before triggering the Jenkins build.
QMetry Configuration for Specflow
Specflow by default generates the output results in Specflow JSON format. QMetry can consume it as Cucumber JSON format. The following solution will generate the output result in Cucumber JSON format in parallel and the result could imported to QMetry.
Part A : Make the following changes in your Specflow Project to generate result file format as Cucumber JSON
Step 1 : Add Dependencies
Step 2 : Add the below code in .cs of feature file
[BeforeTestRun] public static void BeforeTestRun() { SpecNuts.Reporters.Add( new JsonReporter()); SpecNuts.Reporters.FinishedReport += (sender, args) => { String pathName = "specflow_cucumber.json" ; System.IO.File.WriteAllText(pathName, args.Reporter.WriteToString()); Console.WriteLine( "Result File: " + System.IO.Directory.GetCurrentDirectory().ToString() + System.IO.Path.DirectorySeparatorChar + pathName); }; } |
Step 3 : Open Text Explorer in Visual Studio by Test > Windows > Test Explorer -> Choose Run All
Step 4 : In Visual Studio console, select show output from Test and open Report File as path given in Console
Part B : Make the following Configurations in Jenkins
Configuration Steps
- Install "MSBuild Plugin" and "VSTest Runner Plugin"
- Install Visual tools and Set path for MSBuild.exe and vstest.console.exe files in Manage Jenkins > Global Tool Configuration
Configure the following parameters in the Jenkins Job
Step 1 : In the Build Step >> Choose - Build a Visual Studio project or solution using MSBuild
Step 2 : Provide the MsBuild Version and relative path to solution file
- Select "MSBuild Version" which is configured in Global Tool Configuration
- Specify the relative path for solution file in "MSBuild Build File"
Step 3 : Select a build step for VSTest in Build Section - Run unit tests with VSTest console
- Select "VSTest Version" which is configured in Global Tool Configuration
- Specify the relative path to your VSTest compiled assemblies in "Test Files"
Step 4 : In post build action setup QMetry Test Management plugin
- Choose "Cucumber" format to upload
- Relative Path to result file "specflow_cucumber.json"
- Choose other relevant parameters
Release Notes
Expand | ||
---|---|---|
| ||
Version 1.8 Release Date: 2019/09/25 Summary: Improvements Details:
|
Expand | ||
---|---|---|
| ||
Version 1.7 Release Date: 2019/05/28 Summary: Improvements Details:
|
Expand | ||
---|---|---|
| ||
Version 1.6 Release Date: 2019/05/03 Summary: Improvements Details:
|
Expand | ||
---|---|---|
| ||
Version 1.5 Release Date: 2019/03/04 Summary: Improvements Details:
|
Expand | ||
---|---|---|
| ||
Version 1.4 Release Date: 2018/11/17 Summary: Improvements Details:
|
...
title | QMetry Test Management Plugin v1.3 |
---|
Version 1.3
Release Date: 2018/08/23
Summary: Improvements
Details:
- Trigger build through Pipeline project.
Expand | ||
---|---|---|
| ||
Version 1.2 Release Date: 2018/07/09 Summary: Improvements Details:
|
Expand | ||
---|---|---|
| ||
Version 1.1 Summary: Improvements Details:
|
Help Documentation
...
, proxyUrl: '' , testSuiteName: 'TC2-TS-116' testcaseFields: '{"description":"Automated Test case", "testCaseType":"Automated", "testCaseState":"Open", "component":["UI"], "priority":"Blocker", "testcaseOwner":"liza.mathew", "estimatedTime":"143", "userDefinedFields" : {"Integrate" : "Custom Field Testcase"}}' , testsuiteFields: '{"description":"Automated Test suite", "testsuiteOwner": "liza.mathew", "testSuiteState": "New", "userDefinedFields": {"Integrate" : "Custom Field Testsuite"}}' ]) } |
Note: testSName is "Test Suite Name" and testSuiteName is "Test Suite ID" of the test suite.
Syntax of automationFramework:
- CUCUMBER
- TESTNG
- JUNIT
- QAS
- HPUFT
Parameters
Refer to the Parameters section for Freestyle Project above.
7. On successful completion of the process, you can see the console output. It displays success message for uploading the result file.
8. Finally check test execution page in QMetry and review your test run results.
Define Parameters
To define parameters for your job, select the This project is parameterized check box.
The Add Parameter drop-down is enabled with the list of parameter types. Use the drop-down button to add as many parameters as you need.
There are different parameter types available. The way parameters take effect according their respective parameter type.
For example,
Choice Parameter and String Parameter are selected, and corresponding parameters are added as shown below.
The above parameters will be parsed dynamically at the run time.
The field values should be entered in the following syntax:
${ParameterName}
For example,
For the parameters created above, the field value would be ${API} and ${TRID} respectively. The parameter values will be parsed accordingly for the corresponding fields.
The values can also be changed before triggering the Jenkins build.
QMetry Configuration for Specflow
Specflow by default generates the output results in Specflow JSON format. QMetry can consume it as Cucumber JSON format. The following solution will generate the output result in Cucumber JSON format in parallel and the result could imported to QMetry.
Part A : Make the following changes in your Specflow Project to generate result file format as Cucumber JSON
Step 1 : Add Dependencies
Step 2 : Add the below code in .cs of feature file
[BeforeTestRun] public static void BeforeTestRun() { SpecNuts.Reporters.Add( new JsonReporter()); SpecNuts.Reporters.FinishedReport += (sender, args) => { String pathName = "specflow_cucumber.json" ; System.IO.File.WriteAllText(pathName, args.Reporter.WriteToString()); Console.WriteLine( "Result File: " + System.IO.Directory.GetCurrentDirectory().ToString() + System.IO.Path.DirectorySeparatorChar + pathName); }; } |
Step 3 : Open Text Explorer in Visual Studio by Test > Windows > Test Explorer -> Choose Run All
Step 4 : In Visual Studio console, select show output from Test and open Report File as path given in Console
Part B : Make the following Configurations in Jenkins
Configuration Steps
- Install "MSBuild Plugin" and "VSTest Runner Plugin"
- Install Visual tools and Set path for MSBuild.exe and vstest.console.exe files in Manage Jenkins > Global Tool Configuration
Configure the following parameters in the Jenkins Job
Step 1 : In the Build Step >> Choose - Build a Visual Studio project or solution using MSBuild
Step 2 : Provide the MsBuild Version and relative path to solution file
- Select "MSBuild Version" which is configured in Global Tool Configuration
- Specify the relative path for solution file in "MSBuild Build File"
Step 3 : Select a build step for VSTest in Build Section - Run unit tests with VSTest console
- Select "VSTest Version" which is configured in Global Tool Configuration
- Specify the relative path to your VSTest compiled assemblies in "Test Files"
Step 4 : In post build action setup QMetry Test Management plugin
- Choose "Cucumber" format to upload
- Relative Path to result file "specflow_cucumber.json"
- Choose other relevant parameters