> For the complete documentation index, see [llms.txt](https://docs.lleverage.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lleverage.ai/build-and-improve/automate/test-and-publish/tests.md).

# Tests

Test a Draft Workflow as a real execution, with explicit awareness of external side effects and test-mode differences.

Tests let builders turn expected Workflow behaviour into repeatable checks against the current Draft.

The Workflow header calls this tab **Test**; the panel it opens is currently headed **Evaluations**. They are the same Workflow-testing surface.

![Creating a Workflow test by selecting variables and writing plain-language evaluation criteria.](https://3370306531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlgSglJDQZxDZdn20CUcl%2Fuploads%2FJVxmMY8dItY4gJXadzeX%2Fcreate-workflow-test.png?alt=media)

A test is attached to an action's output. Create it from the flask control beside a variable in the run output, choose the variables to evaluate, describe the criteria in plain language, and use the evaluation configuration to control how the criteria are judged.

![A saved Workflow test with a passing result and the current result filters and Run all control.](https://3370306531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlgSglJDQZxDZdn20CUcl%2Fuploads%2FrAHXo4N62sVEL7OfmNIA%2Fworkflow-tests-result.png?alt=media)

## Tests are real executions

Running a test does not replay the whole Workflow from a static recording. The trigger, user-interface steps and operator-action steps are replayed from the captured fixture; other actions on the tested path execute again for real.

That means a test can skip the human form while still sending the email, writing to the ERP, running code or making another connected-system change.

Use safe fixtures, test records or non-destructive inputs where appropriate.

## What a test should establish

A useful test makes clear:

* the input or scenario being exercised;
* the result or condition that should hold;
* which parts are deterministic enough to check repeatedly;
* what still requires a builder to inspect the external business outcome.

Tests are strongest when they capture a meaningful operational expectation rather than only checking that the Workflow returned some output.

## Tests do not replace runtime evidence

Passing tests reduce uncertainty about known scenarios. They do not prove that every live input, provider response or external-system condition will behave the same way.

Use **Run** for interactive draft iteration, **Test / Evaluations** for repeatable expectations, and **Monitoring** for evidence from actual executions over time.

Publishing is a separate step. A successful test does not itself move the Draft onto the live path.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lleverage.ai/build-and-improve/automate/test-and-publish/tests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
