@vansah/vansah-connect

1.0.3 • Public • Published

A Single Solution for all the CI/CD tools to send Test results to Vansah Test Management for Jira

WebsiteMore Connect Integrations

Table of Contents

Features

  • Upload your TestNG🎉, 🔜 Junit, xunit🔜 and jtl/xml/csv🔜 to Vansah Test Management for Jira
  • Easy to use as it is command line friendly.
  • Easy to Integrate with CI/CD tools such as Github Actions, Jenkins, Gitlab and so on.
  • Execute your Vansah Test Case in just one command.

Prerequisite

  • Make sure that Vansah is installed in your Jira workspace
  • You need to Generate Vansah connect token to authenticate with Vansah APIs.
  • Node.js version 18 should be installed in your machine.

Installing

Using npm (Install globally) as this is command line tool:

$ npm i -g @vansah/vansah-connect

Configuration

  • Configure your Vansah connect Token. Use either of the following commands:
    • Option 1: Replace "Your Vansah connect Token" with your actual token.

          $ vansah-connect -c "Your Vansah Connect Token"
    • Option 2: If you have the token stored as a pipeline variable, you can use:

          $ vansah-connect -c %YOUR-PIPELINE-VARIABLE%

Uploading Your Results

Now, it's time to effortlessly upload your test results to Vansah Test Management for Jira with a single command.

Replace ./YOUR-TESTNG_FILEPATH.xml with the actual file path to your TestNg file

$ vansah-connect -f ./YOUR-TESTNG_FILEPATH.xml

Note : Set up your TestNG file to include custom attributes for each of your test functions. This way, after running the automation suite, all test methods will have sufficient information to log the results into Vansah Test Management for Jira.

Use of Custom Attributes

In Vansah, the determination of whether a test should pass or fail relies on the utilization of custom attribute annotations

/**
 * Example
 * This is a test method for performing an addition operation.
 *
 * Custom Attributes:
 * - Case Key (Mandatory): "DOT-C1"
 * - Tested Issue (Mandatory): "DOT-1"
 * - Tested Sprint: "DOT Sprint 1"
 * - Tested Environment: "SYS"
 */
@Test(attributes = {
		      @CustomAttribute(name = "Case Key", values = "DOT-C1"),
		      @CustomAttribute(name = "Tested Issue", values = "DOT-1"),
		      @CustomAttribute(name = "Tested Sprint", values = "DOT Sprint 1"),
		      @CustomAttribute(name = "Tested Environment", values = "SYS")})
	public void Addition_Test() {
		
		int a = 3 , b = 2;
		int sum = a + b ;
		System.out.println("Addition of Two numbers are : " + sum);
	
		Assert.assertEquals(sum, 5);
		
	}
	

Note : Modifying the name values is not possible as they are constant and case-sensitive

Adding results to a specific Test Case

If you want to upload results directly to a particular test case follow below command

/**
* -t <TestCaseKey> 
* -s <passedOrFailed>
* -a <IssueKeyorTestFolderID>
**/
$ vansah-connect -t "PVT-C500" -s "passed" -a "PVT-4"

Upon successful execution, you'll receive a reassuring message

A new Test Run created.

And that's it! With vansah-connect, you've streamlined the integration of your automation test results into Vansah, making your testing and test management process even more efficient and seamless.

Developed By

Vansah

Package Sidebar

Install

npm i @vansah/vansah-connect

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

14.1 kB

Total Files

8

Last publish

Collaborators

  • smourya
  • testpointvansah