Still in alpha. Expect rough edges, cryptic error messages and generally unpolished experience.
Cuerdo
Transform Arazzo documents into executable property-based tests.
Installation
Add :cuerdo to the list of dependencies in mix.exs
def deps do
[
{:cuerdo, "~> 0.1"}
]
end
Features
- Arazzo workflow execution directly in Elixir.
- Property-based test generation from Arazzo document.
- Request and response validation against OpenAPI specifications.
- Customizable input generation, when domain-specific constraints cannot be expressed in JSON Schema.
Quick Start
Execute workflows with automatically generated input as part of your test suite
defmodule MyTest do
use Cuerdo.ArazzoCase
arazzo_document_test document: YamlElixir.read_from_file!("arazzo.yaml")
end
Or execute a workflow directly
iex> inputs = %{"email" => "user@example.com", "password" => "securePassword"}
iex> document = YamlElixir.read_from_file!("arazzo.yaml")
iex> {:ok, context} = Cuerdo.Arazzo.run_workflow(inputs, "createUserWorkflow", document)
iex> Cuerdo.Arazzo.Context.workflow_outputs(context, "createUserWorkflow")
%{"token" => "userSessionToken"}
For more in-depth information and guides refer to any of the useful links
Contributions are welcome, please read Contributing before creating any issue or pull request.
Useful links
Unsupported features and limitations
AsyncAPI
All steps and workflows are assumed to execute synchronously and in the order they are defined. AsyncAPI features and fields are unsupported as there is no current way of validating that a message was published to an out-of-band broker or queue
Workflow
dependsOn: The field is ignored. If a workflow depends on another workflow then it should define a step that references the dependency.successActionsandfailureActionsare ignored.
Step
channelPath,correlationId,action: Used exclusively by AsyncAPI.onSuccessandonFailure: Same assuccessActionsandfailureActionsfrom Workflowin: "cookie"dependsOn: Same as Workflow
Condition and Expression
xpathand any XML functionality is unsupportedtypeallows only strings. This means that JSONPath supports RFC-9535 version only, and JSON Pointer (RFC-6901). Non-standard and legacy JSONPath and JSONPointer versions are unsupported.
Failing cases do not shrink at the moment