Foundry.TestScenario (foundry v0.1.6)

Copy Markdown

Lightweight test-side annotations for Studio scenario extraction.

@scenario is intentionally small. Real executable test calls remain the primary source of truth; the attribute only adds labels or exact-focus hints where code alone is ambiguous.

capture/2 automatically records executable entrypoints inside the wrapped test body. trace_node/2 remains available as a compatibility escape hatch for flows that cannot yet be inferred automatically.

Example:

use Foundry.TestScenario

@scenario category: :compliance,
          compliance_links: ["RG-UK-014"],
          flow: [
            %{
              id: "receive",
              type: :entry,
              node: "Finance.WithdrawalWebhook",
              label: "Validate webhook payload",
              action: "handle_webhook",
              focus_targets: ["Finance.WithdrawalWebhookEvent"]
            }
          ]

Summary

Functions

capture(list)

(macro)

capture(context, fun_ast)

(macro)