Hi Everyone,
Im looking for a little insight wether to use a datafile for our automated suite
My Question is twofold:
We just finished our Test collection for our API and it’s running beautifullly in CI/CD. We were thinking of adding more testcases with the help of a data file, but we think we kind of hit a wall here:
Our collection as of now consists of different tests on our API different endpoints.
So far what I have seen and read is that a datafile is only used for a single endpoint. (say a single Post call)
1. Is there a way I can use a single datafile to drive my whole test suite?
Say I have 2 API endpoints and 3 methods
My post/action request bodies look like:
"created": "2020-02-28T10:57:16+01:00",
"createdBy": "automatedtest 1",
"occurrence" : "2020-02-28T10:57:16+01:00",
"location" : "Location 1",
"category": "A",
"description": "Description 1",
For my Get/action call I need 2 extra parameters
"spaceid": "",
"venueid": "",
My other post/image request body looks like:
"fileName": "image.png",
"image": "";
Do I need to make one big Json file and add all these parameters into 1 object?
Say i wanted to test if category is mapped correctly (post/action) - and this will take 26 iterations, do my other 2 tests have to run 26 times as well?
2. Can I use a datafile for negative testing?
I want to test error handling on nulls - spaces- or missing keys. As of now we wrote tests for each of these scenario’s . How does one go about when using a data file, assuming we are populating a single post request with data from this file?
Hope someone has some good ideas
Cheers!