ovh / venom

🐍 Manage and run your integration tests with efficiency - Venom run executors (script, HTTP Request, web, imap, etc... ) and assertions
Apache License 2.0
1.06k stars 144 forks source link

FEATURE REQUEST: Use captured variables within steps themselves #742

Closed polyphilz closed 1 year ago

polyphilz commented 1 year ago

I have a single testcase that has 5 steps:

  1. Hit a POST endpoint that creates a resource (this returns some JSON including the ID (let's call it res1Id) of this newly created resource)
  2. Use this res1Id to query Postgres using the SQL executor for a different resource's (res2Id) that was created as a side effect of this original resource being created
  3. Hit a PATCH endpoint that updates this second resource using its ID (res2Id)
  4. Query Postgres again for res2Id and confirm the updates took place
  5. Hit 2 DELETE endpoints for both res1Id and res2Id to remove them from the DB

I see in the docs you can capture variable output from testcases, but is there a way to capture variable output between steps themselves in a single testcase? I tried to do something like {{.testCaseOne.<some-var>}} but that doesn't work from within a next step unfortunately.

polyphilz commented 1 year ago

Sorry turns out I was not referencing the var names correctly and that this is definitely possible