-
Notifications
You must be signed in to change notification settings - Fork 280
Custom transaction ordering for workflow/scenario testing #358
Comments
You don't want to use a before hook handler to seed the data that your other hook transaction would populate? |
Hey @mkax, Dredd is designed at this moment to be more a tool for unit testing of each entry in the API Blueprint API reference and hooks are meant as a tool how to isolate and do some setup and teardown for each transaction. If you'd like to test some workflows or scenarios (more integration or functional-like testing) I would recommend using the simple API Blueprint notation which is not resource oriented and is focused more on describing the HTTP calls. You can use multiple blueprint files - one per each workflow (scenario) using the |
@mkax And I would totally love to have native support for scenarios/workflows in both Dredd and API Blueprint and using items from the reference as steps in these scenarios. Or at least, some support for custom ordering of transactions. |
Hey @netmilk, Custom sorting would be nice, for example.. if I could specify list of transactions in dredd.yml like parameter 'only'. @ddelnano hooks works good, but cannot do what i need. POST Create new Item - this new item has status draft. This is strict functionality in our app, so I cannot create child before Item is published.. I'll get 404 - which is correct behavior. |
@mkax Thank you so much for the explanation! I think it's totally testing of API scenarios / workflows. I would absolutely love to have this functionality so I'll try to come up with some proposal or workaround. |
Here is another real-world insight: #151 (comment) |
Let's keep this as a tracking issue for the feature request that Dredd should support scenarios / workflows in the future. Related issue describing the current possibilites: #995 |
hello,
is there any solution _how to run any hooks transactions before others?_ I have some objects depends on others and i need to specify which post method must run first, second, etc..
for example:
book, author - i have to create author first to be able create book..
I cannot find anything about it and --sorted is not enough :-(
The text was updated successfully, but these errors were encountered: