One of the key principles of Botium is to prevent vendor-lock-in — it is open to the highest degree for integration into any software product out there, even custom pipelines.
Introduction
As long as it supports any of the following technologies, there is a very high likelihood that Botium will seamlessly fit into your CI/CD pipeline:
-
Running a headless CLI tool
-
Running Mocha/Jest/Jasmine tests with Node.js
-
Calling an HTTP(S)-GET-Endpoint, either by itself or by using tools like cURL or Wget
Botium can output several file formats for further processing in a CI/CD pipeline:
-
JUnit XML (test results)
-
CSV (test results and full test case transcripts)
-
JSON (test results and full test case transcripts)
Botium provides a flexible HTTP(S) endpoint for triggering tests and delivering the results. After you defined your test project in the Test Suite, there is a Build Server Integration screen available. It assists in composing the HTTP(S) links and command line calls to use for triggering test case execution.
1 - Enter Build Server Integration Scripts Parameters
Provide some information to Botium:
-
API Key: API Key to use in your requests
-
Build Id: Build Identifier to name your Test Results (in real-life projects this parameter is dynamically filled from the CI/CD pipeline of your choice)
-
Build Tags: Build Tags to attach to the Test Results
-
Output Format: File format to use for the test results
-
Callback URL: Botium will call this URL when test case execution is ready. This is the HTTP(S) endpoint to use for the callback
-
Callback Method: The HTTP(S) Method to use for the callback. If you select POST, then the test case result will be delivered in the request body.
-
Wait with HTTP(S) response until test session completed: When calling the Botium endpoint, you can select if you just want to trigger the test case execution and run it in the background, or if the HTTP(S) request should wait until the test session is completed.
The fields in the next section are automatically filled with what you selected here.
2 - Generated Build Server Integration Scripts
The HTTP(S) Webhook Link is a generic endpoint for triggering test case execution. You can use any client capable of making HTTP(S) requests, including your internet browser (yes, you can even start test case execution by just clicking a hyperlink).
-
Start Test Project Link is the link to use
-
Status Link: Use this link to get the status and result for the Botium Test Project (Build Id required)
Advanced Integration
For advanced integration, you can build your own HTTP(S) webhook link in the 'Build Your Own' section. The base endpoint is provided there, along with the parameters and instructions on how to use them. All parameters can be passed to the webhook in either of the following ways:
-
As HTTP query parameter (“…&PARAMNAME=VALUE…”)
-
As JSON body part attribute (Request Body: { …”PARAMNAME”: “VALUE”…})
-
As HTTP header with prefix “X-BOTIUM-” (“X-BOTIUM-PARAMNAME”: “VALUE”)
The parameters are:
-
APIKEY: mandatory — API Key to use in your requests
-
BUILDID: optional at start, mandatory at status check — Build Identifier to name your Test Results, you can choose your own
-
TAG: optional, multiple — Build Tags to attach to the Test Results
-
REPORTER: optional — File format to use for the test results (json, junit, csv)
-
CALLBACKURL: optional — HTTP(S) endpoint to use for the callback
-
CALLBACKMETHOD: optional — HTTP(S) Method to use for the callback
-
WAIT: optional — 1 (wait until complete) or 0 (run in background)
If everything is setup correctly, the test case results will be imported by your CI/CD pipeline.
3 - Configure Your Build Server
Troubleshooting
Some common issues that occur are cover in the article Troubleshooting CI/CD Integration