Skip to content

Commit

Permalink
Add testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
damarisnicolae committed Sep 6, 2024
1 parent 12822b4 commit c9dd262
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions api/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,53 @@ testcases:
- result.bodyjson.users[0] ShouldContainKey Firstname
- result.bodyjson.users[0].ID ShouldBeNumber
- result.bodyjson.users[0].Firstname ShouldBeString
- name: CreateUser
steps:
- type: http
method: POST
url: "{{.url}}/user"
body: |
{
"Firstname": "Anne",
"Lastname": "Ungurean",
"Email": "[email protected]"
}
headers:
Accept: application/json
Content-Type: application/json
assertions:
- result.statuscode ShouldEqual 201
- result.bodyjson ShouldContainKey ID
- result.bodyjson.ID ShouldBeNumber
- result.bodyjson.Firstname ShouldEqual Anne
- result.bodyjson.Email ShouldEqual "[email protected]"
- name: UpdateUser
steps:
- type: http
method: PUT
url: "{{.url}}/user/1"
body: |
{
"Firstname": "Anne",
"Lastname": "Ungurean",
"Email": "[email protected]"
}
headers:
Accept: application/json
Content-Type: application/json
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson ShouldContainKey Firstname
- result.bodyjson.Firstname ShouldEqual Anne
- result.bodyjson.Lastname ShouldEqual Ungurean
- result.bodyjson.Email ShouldEqual "[email protected]"
- name: DeleteUser
steps:
- type: http
method: DELETE
url: "{{.url}}/user/1"
headers:
Accept: application/json
Content-Type: application/json
assertions:
- result.statuscode ShouldEqual 204

0 comments on commit c9dd262

Please sign in to comment.