kiranz / just-api

:boom: Test REST, GraphQL APIs
https://kiranz.github.io/just-api/
MIT License
813 stars 35 forks source link

Use return value of one request for next one #20

Closed skizzo closed 5 years ago

skizzo commented 5 years ago

Hi y'all, (how) is it possible to use one return value of a call as a parameter for the next one? This would be reeeeeally handy. Many thanks!

kiranz commented 5 years ago

You can run the previous spec as a dependency and pass it to the current test as shown here https://github.com/kiranz/just-api/blob/8ee4e7350ed86007834c0f792f1789eb778d709f/test/cli/src/suites/suitedependencies/intradependencies.suite.yml#L19

if you want to use the same data in other tests within a suite, store it in suite context and reuse More details can be found here https://kiranz.github.io/just-api/features/#storing-suite-test-data-in-context-for-reuse