Srotas CLI
Srotas is a developer toolkit designed to simplify manual API testing by automating prerequisite steps. Instead of manually executing a series of API calls to reach your testing target, define your setup sequence in YAML. Srotas manages the execution flow, handling data between requests, so you can focus on testing your latest changes efficiently.
Key Features
- YAML-Based Configuration – Define API requests, assertions, and workflows in a structured format.
- Dynamic Variables – Store and reuse response values using expressions.
- Templated Requests – Use Go
templatesyntax for dynamic request bodies. - Assertions & Validation – Validate responses with powerful
exprexpressions. - Debugging & Logging – Enable
--debugmode for detailed execution insights.
Getting Started
Install Srotas:
- Visit the Srotas Releases page.
- Download the latest release for your platform (Linux, macOS, or Windows).
- Move the binary to a directory in your system’s
PATH.
Now, you can run
srotas --helpto verify the installation.Define a test sequence in
test.yaml:steps: - name: Fetch User Data request: method: GET url: "https://api.example.com/user" status_code: 200Run the test:
srotas run test.yaml
Why Srotas?
- Efficient Manual Testing – The tool automates all necessary HTTP requests leading up to the feature you want to test while keeping you in control.
- Configurable Execution – Customize test sequences to fit your workflow, running individual steps or complete test flows as needed.
- Lightweight & Portable – No dependencies, just a single binary.
Srotas bridges the gap between manual and automated testing, giving developers a fast and structured way to test APIs without the complexity of full test automation.
Start with Getting Started to set up Srotas quickly. Learn how to define API workflows in YAML with the Configuration Reference, explore available commands in the CLI Reference, and check out Examples to see practical use cases in action!
Understanding Expressions and Templates
Srotas leverages expr expressions for dynamic value computation and Go’s text/template syntax for flexible request body definitions. Understanding these concepts will help you write powerful and customizable test configurations.
Expr Expressions
Srotas allows you to use expr expressions in YAML configurations and the CLI to evaluate dynamic values at runtime. You can learn more about the syntax and capabilities of expr here: Expr Language Definition
Go Text Templates
For defining HTTP request bodies, Srotas utilizes Go’s text/template syntax. If you’re new to Go templates or want to explore advanced templating features, refer to these resources:
HashiCorp Nomad Go Template Guide
Gomplate Template Syntax
Official Go text/template Documentation