-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup and teardown fixtures for the tests #4
Comments
That's a great point. As currently written, the example specifies that there must be a In other incarnations of this, experiments have been tested with support for "prerequisites" -- requests that are sent before the |
Hi, The below example is far from perfect. But if its a worth a discussion I can think about an integration to this project and create a PR. First I needed to create a fixed execution order. Also used create more complex test szenarios later. Therefore create an array with the description of the testcase as reference. I changed the parseXample function to store the raw http parts as 'httpReq' to recreate a preq object later.
To be able to parse the test case like : swaggerTest.parse(parseStoreRestore(xample.test.httpReq)); To be able to store and restore object e.g. the objectid of the created account.
And restore is replaced with right before generating a preq object.
I used "object-resolve-path" to be able to reference specific values from an object |
The example
x-amples
usage requests and receives a pet with IDfido4
. How do you know that ID exists in the tested implementation? It seems like you'd need a setup block where you could push data into the tested implementation, and a teardown block where you could remove any data that might have been left by the test. For systems that autogenerate IDs afterPOST
s, preserving those IDs between requests would take some state preservation on the swagger-test side, and I'm not sure what that would look like in thex-amples
definition.The text was updated successfully, but these errors were encountered: