Created
June 10, 2020 14:16
-
-
Save subeshb1/9d9f83ed3ef607a5bcf0512c74de2f9a to your computer and use it in GitHub Desktop.
api-test with tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"testCases": { | |
"get_api": { | |
"path": "/books", | |
"query": { | |
"id": "1" | |
}, | |
"expect": { | |
"body": { | |
"contains": { | |
"author": "Aneeta Sharma" | |
}, | |
"hasKey": ["id", "author", "title"] | |
}, | |
"header": { | |
"contains": { | |
"http_status": "200" | |
} | |
} | |
} | |
}, | |
"invalid_post_api": { | |
"path": "/books", | |
"method": "POST", | |
"body": { | |
"id": "1", | |
"author": "Robin Wieruch", | |
"title": "The Road to React" | |
}, | |
"expect": { | |
"body": { | |
"eq": { "message": "Book already exists." } | |
} | |
} | |
} | |
}, | |
"url": "localhost:3000", | |
"header": { | |
"Content-Type": "application/javascript" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment