Jenkins
Jenkins is an open-source automation server for CI/CD and build automation. Trigger Testsigma test plans directly from a Jenkins job to keep testing inside your pipeline.
Prerequisites
- An API key and your test plan ID.
- A working Jenkins server with administrative access.
Trigger test plans from Jenkins
Section titled “Trigger test plans from Jenkins”- Log in to Jenkins and click + New Item.
- Enter a name, select Freestyle Project, and click OK.
- On the configuration page, scroll to Build Steps and click Add build step.
- Select Execute Shell and paste the script below.
TESTSIGMA_API_KEY="<your-api-key>"TESTSIGMA_TEST_PLAN_ID="<your-test-plan-id>"
curl -X POST "https://app.testsigma.com/api/v1/execution_results" \ -H "Authorization: Bearer $TESTSIGMA_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"executionId\": $TESTSIGMA_TEST_PLAN_ID}"$TESTSIGMA_API_KEY = "<your-api-key>"$TESTSIGMA_TEST_PLAN_ID = "<your-test-plan-id>"
Invoke-RestMethod -Method Post ` -Uri "https://app.testsigma.com/api/v1/execution_results" ` -Headers @{ Authorization = "Bearer $TESTSIGMA_API_KEY" } ` -ContentType "application/json" ` -Body "{`"executionId`": $TESTSIGMA_TEST_PLAN_ID}"pipeline { agent any environment { TESTSIGMA_API_KEY = credentials('testsigma-api-key') } stages { stage('Testsigma') { steps { sh './run-testsigma.sh 4821' } } }}- Click Save, then Build Now to trigger the test plan.
- In Testsigma, open Test Plans to confirm the run has started.
- In Jenkins, open the build and select Console Log to follow execution.
- Open Run Results in Testsigma for the detailed report.
Reading the results
Section titled “Reading the results”The shell step exits non-zero when the test plan fails, so the Jenkins build fails with it. Detailed step-level output, screenshots, and logs stay in Testsigma under Run Results.
How do I turn the JUnit XML report into HTML?
Get the XML one of three ways: the Testsigma Test Plan plugin writes it into the Jenkins workspace automatically, the Test Results page offers it as a download, or fetch it by API — GET https://app.testsigma.com/api/v1/reports/junit/$RUN_ID with your bearer key and Accept: application/xml. Then transform it with an XSLT stylesheet: xsltproc junit-report.xml stylesheet.xslt > report.html on macOS/Linux, or PowerShell’s XSL transform on Windows. Any stylesheet targeting the JUnit schema works and controls the layout entirely.
Was this page helpful?
Thanks for the feedback.