CI/CD
Jenkins Integration with Test Management by Testsigma
Integrate Jenkins with Test Management by Testsigma and automate your test runs and generate test reports.
Integrate Jenkins with Test Management by Testsigma to automate test executions and generate test reports through CI/CD pipelines. This article discusses integrating Jenkins with Test Management by Testsigma.
Prerequisites
Before you begin, ensure:
- You have a Project in Test Management by Testsigma and Test Runs are available.
- You have an API token from Test Management by Testsigma.
- You have a Jenkins account.
Configuring Credentials in Jenkins
Section titled “Configuring Credentials in Jenkins”-
On the Jenkins dashboard, click Manage Jenkins.
-
Under Security, click Credentials.
-
Under Stores scoped to Jenkins, click (global) in the Domain column.
-
On the Global credentials page, click Add Credentials.
-
In the Kind dropdown menu, select Secret text.
-
In the Secret box, enter your API Token from Test Management by Testsigma.
-
In the ID box, enter
TESTSIGMA_API_TOKEN. -
Click Create.
Steps to Configure Pipeline
Section titled “Steps to Configure Pipeline”-
On the Jenkins dashboard, click New Item.
-
In the Enter an item name box, enter a name for the pipeline.
-
Select Pipeline, and click OK.
-
On the Configuration page, scroll to the Pipeline section.
-
In the Definition list, select Pipeline script.
-
In the Script box, paste the following script:
pipeline {agent anyenvironment {TESTSIGMA_API_TOKEN = credentials('TESTSIGMA_API_TOKEN')}stages {stage('Run Tests') {steps {// Run your test script heresh './run-tests.sh'}}stage('Upload to Testsigma TMS') {steps {// Ensure the test result file exists at the specified pathsh '''curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \--header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \--form "junit_xml=@target/test-results/test-report.xml"'''}}}}
- Click Apply, and then click Save.
Trigger a Build in Jenkins
Section titled “Trigger a Build in Jenkins”-
On the Jenkins dashboard, click the configured pipeline.
-
In the left navigation bar, click Build Now.
-
Once the build completes successfully, the test case statuses in the associated test run are updated automatically in Test Management by Testsigma.