Example plan
scripts.yaml
New here? Get started. See Running the examplesfor this plan's fixture, runtime, database or browser requirements. The exec example needs no fixture; Postgres and Playwright need their optional dependencies.
Node (global fetch) and Python 3 script steps run against vero-testserver on its default address. Start bin/vero-testserver in Terminal 1 in the foreground; run bin/vero run examples/scripts.yaml in Terminal 2. Each script logs in and creates an order; an http step checks the Node order through a derived task-result edge.
apiVersion: vero.plan/v1
kind: Plan
metadata:
name: example-scripts
env:
baseUrl: http://127.0.0.1:18080
lifecycle:
strategy: unique # each run creates fresh orders; run.id names the API keys
tasks:
- name: node-checkout
steps:
- script:
runtime: node
entry: ./scripts/checkout.mjs
input: { baseUrl: "{{ env.baseUrl }}", apiKey: "node-{{ run.id }}", sku: ABC-1, qty: 2 }
timeout: 30s
assert:
- ok == true
- result.total == 2000
- result.elapsedMs < 10000
results:
orderId: result.orderId
token: result.token
- name: python-checkout
steps:
- script:
runtime: python
entry: ./scripts/checkout.py
input: { baseUrl: "{{ env.baseUrl }}", apiKey: "python-{{ run.id }}", qty: 1 }
timeout: 30s
assert:
- ok == true
- result.total == 1000
- name: verify-node-order
steps:
- http:
method: GET
url: "{{ env.baseUrl }}/orders/{{ tasks.node-checkout.results.orderId }}"
headers: { Authorization: "Bearer {{ tasks.node-checkout.results.token }}" }
assert:
- status == 200
- body.order.id == tasks.node-checkout.results.orderId
- body.order.qty == 2This page is examples/scripts.yaml in the repository.