Veriflow is a CLI tool designed for declarative and deterministic end-to-end API testing. By using a simple JSON configuration file, Veriflow enables seamless definition and execution of API test flows, ensuring that your API behaves as expected across various scenarios with minimal setup and no code changes required.
Veriflow is an efficient and straightforward command line interface (CLI) tool designed for executing effective and deterministic end-to-end API testing. This tool leverages a simple JSON configuration file to define and run declarative test flows, allowing for easy testing of APIs without requiring any code changes on the server.
Key Features
- Declarative Testing: Veriflow enables the creation of structured test flows that mimic real user journeys, such as user onboarding, checkout processes, and admin actions.
- Stateful Execution: The tool supports ordered flows, where data can be seamlessly passed between steps (e.g., authentication tokens, user IDs), ensuring accurate test scenarios.
- Zero Code Changes: Tests are executed on the API as a black box, simplifying the process and avoiding unnecessary impacts on the server.
- Comprehensive Assertions: Users can validate API responses through a variety of assertions, including status code checks and JSON/XML content validation.
- Built-in Support for JSON and XML: Automatic detection of response content types allows for straightforward data extraction and verification.
Example Flow Configuration
The following JSON snippet demonstrates how to configure a user authentication flow:
{
"baseUrl": "http://localhost:8080",
"flows": {
"user-auth": {
"steps": [
{
"name": "register",
"request": {
"method": "POST",
"path": "/api/auth/v3/register",
"json": {
"email": "user+{{RUN_ID}}@example.com",
"password": "secret"
}
},
"assert": {
"status": 201,
"all": [
{ "jsonpath": "$.data.username", "exists": true }
]
},
"exports": { "username": "$.data.username" }
},
{
"name": "login",
"request": {
"method": "POST",
"path": "/api/auth/v3/login",
"json": {
"username": "{{bind:username}}",
"password": "secret"
}
},
"assert": {
"status": 200,
"all": [
{ "jsonpath": "$.data.email", "contains": "{{RUN_ID}}" }
]
}
}
]
}
}
}
User-Friendly Features
- Contextual Session Handling: Veriflow manages session cookies automatically across requests, simplifying the testing of protected endpoints.
- Hooks and Automation: Users can define pre- and post-test scripts for setup and teardown operations, facilitating integration with CI/CD pipelines.
- Custom Output Options: Comprehensive CLI options include generating JSON outputs for machine readability and supporting non-interactive runs for automated environments.
Veriflow embodies a clear design philosophy focused on deterministic execution and transparency, making it an ideal solution for developers and testers aiming to ensure consistent and reliable API performance.
No comments yet.
Sign in to be the first to comment.