Tutorial: scenarios in a pipeline
You keep a team’s pipeline running: the tests must run on every build, in every environment, with results where the rest of the results are, and without anyone editing files between stages. Scenario files live in the repository, the Platform runs them, and a single Python file the Platform serves ties the two together.
This tutorial takes about twenty minutes and ends with a job that runs the same files in two environments.
1. The client and a token
Section titled “1. The client and a token”Under Settings, API tokens, make a token for the pipeline and keep it as a secret there. In the job:
curl -fsSL -o iso8583sim-run.py https://platform.example.com/iso8583sim-run.pyISO8583SIM_PLATFORM_TOKEN=... python iso8583sim-run.py --url https://platform.example.com --junit report.xml scenarios/*.yamlThe client needs Python 3.10 or later and nothing installed. Each file is a test case in the JUnit report, the exit code is 0 when every one passed, and the CI walkthrough has a template for GitHub Actions, GitLab CI, Jenkins and Azure Pipelines.
2. A file that runs anywhere
Section titled “2. A file that runs anywhere”examples/tutorials/ci-engineer.yaml names its target as the files do, Issuer, and gives its variables defaults: a test card and a terminal id. It sends an authorization from that terminal and expects approval with the terminal id echoed, one over the limit declined, and one at the limit approved. Nothing in it says where Issuer is.
3. One job, two environments
Section titled “3. One job, two environments”Under Environments, make DEV with Issuer mapped to a simulated host and the card and terminal your development uses, and UAT with Issuer mapped to your system under test by address and UAT’s values. Then the job runs the same files twice:
python iso8583sim-run.py --url https://platform.example.com --environment DEV --junit dev.xml scenarios/*.yamlpython iso8583sim-run.py --url https://platform.example.com --environment UAT --junit uat.xml scenarios/*.yamlThe environment’s targets and variables are applied on the Platform when each run is queued; the files never change. The environments walkthrough has the model, and its comparison page sets DEV’s results against UAT’s, down to the step.
4. Where the results go
Section titled “4. Where the results go”Each run keeps the request and response of every step, and the run list filters by environment, suite and build (--build names the build a run belongs to, so the analytics compare builds). A webhook tells your chat or ticketing system about a failed run (the webhooks walkthrough); the client can write results to Jira Xray and to the pull request (the CI walkthrough); a signed evidence pack of a run goes with a release (the evidence walkthrough).
5. Keep the suite honest
Section titled “5. Keep the suite honest”A saved suite runs a set of scenarios in order or in parallel, from the console, from a schedule or from the client with --saved-suite; coverage shows which messages and fields the suite exercises and which it doesn’t (the coverage walkthrough); the analytics show pass rates by day, the flaky scenarios and the slowest steps (the analytics walkthrough).
Where to look next
Section titled “Where to look next”The Platform’s own CI runs this file in two environments on every build, against the simulated issuer it brings up, and checks the two agree, so the steps on this page stay true. The install guide covers running the Platform itself from your pipeline’s reach, on a server or on Kubernetes.