-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
786f61e
commit ca8037c
Showing
3 changed files
with
109 additions
and
72 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
version "2" | ||
name: Users testsuite | ||
|
||
vars: | ||
sql.url: "damaris:damarisub@(localhost:3306)/users" | ||
api.url: "http://localhost:8080" | ||
|
||
testcases: | ||
- name: init db | ||
steps: | ||
- type: sql | ||
driver: mysql | ||
dsn: "{{.sql.url}}" | ||
commands: | ||
- "INSERT INTO `users` (`jobtitle`, `firstname`, `lastname`, `email`, `phone`, `address`, `city`, `country`, `postalcode`, `dateofbirth`, `nationality`, `summary`, `workexperience`, `education`, `skills`, `languages`) VALUES ('Inginer Software', 'Sophye', 'Soph', '[email protected]', '07076965173', 'Str. Zambilelor nr.4', 'Timișoara', 'Romania', '010001', '1990-11-11', 'română')" | ||
- "INSERT INTO `users` (`jobtitle`, `firstname`, `lastname`, `email`, `phone`, `address`, `city`, `country`, `postalcode`, `dateofbirth`, `nationality`, `summary`, `workexperience`, `education`, `skills`, `languages`) VALUES ('Inginer Software', 'Myriam', 'Myr', '[email protected]', '07076965173', 'Str. Zambilelor nr.4', 'Timișoara', 'Romania', '010001', '1990-11-11', 'română')" | ||
- name: GetUsers | ||
steps: | ||
- type: http | ||
method: GET | ||
headers: | ||
Accept: application/json | ||
Content-Type: application/json | ||
url: "{{api.url}}/users" | ||
assertions: | ||
- result.statuscode ShouldEqual 200 | ||
- result.bodyjson ShouldBeArray | ||
- result.bodyjson.users[0] ShouldContainKey ID | ||
- result.bodyjson.users[0] ShouldContainKey Firstname | ||
- result.bodyjson.users[0].ID ShouldBeNumber | ||
- result.bodyjson.users[0].Firstname ShouldBeString | ||
- name: GetUser | ||
steps: | ||
- type: http | ||
method: GET | ||
headers: | ||
Accept: application/json | ||
Content-Type: application/json | ||
url: "{{api.url}}/user" | ||
assertions: | ||
- result.statuscode ShouldEqual 200 | ||
- result.bodyjson ShouldBeArray | ||
- result.bodyjson.user[0] ShouldContainKey ID | ||
- result.bodyjson.user[0] ShouldContainKey Firstname | ||
- result.bodyjson.user[0].ID ShouldBeNumber | ||
- result.bodyjson.user[0].Firstname ShouldBeString | ||
- name: CreateUser | ||
steps: | ||
- type: http | ||
method: POST | ||
url: "{{api.url}}/user" | ||
body: | | ||
{ | ||
"Jobtitle": "Developer" | ||
"Firstname": "Christian", | ||
"Lastname": "Ungurean", | ||
"Email": "[email protected]", | ||
"Phone": "07076965173", | ||
"Address": "Str. Zambilelor nr.4", | ||
"City": "Timișoara", | ||
"Country": "România", | ||
"Postalcode": "111111", | ||
"Dateofbirth": "1990-11-11", | ||
"Nationality": "română" | ||
} | ||
headers: | ||
Content-Type: application/json | ||
assertions: | ||
- result.statuscode ShouldEqual 201 | ||
- result.bodyjson ShouldContainKey Firstname | ||
- result.bodyjson.Firstname ShouldEqual Christian | ||
- result.bodyjson.Email ShouldEqual "[email protected]" | ||
- name: UpdateUser | ||
steps: | ||
- type: http | ||
method: PUT | ||
url: "{{.url}}/user/1" | ||
body: | | ||
{ | ||
"Jobtitle": "Developer" | ||
"Firstname": "Christian", | ||
"Lastname": "Ungurean", | ||
"Email": "[email protected]", | ||
"Phone": "07076965173", | ||
"Address": "Str. Zambilelor nr.4", | ||
"City": "Timișoara", | ||
"Country": "România", | ||
"Postalcode": "111111", | ||
"Dateofbirth": "1990-11-11", | ||
"Nationality": "română" | ||
} | ||
headers: | ||
Content-Type: application/json | ||
assertions: | ||
- result.statuscode ShouldEqual 200 | ||
- result.bodyjson ShouldContainKey Firstname | ||
- result.bodyjson.Firstname ShouldEqual Christian | ||
- result.bodyjson.Lastname ShouldEqual Ungurean | ||
- result.bodyjson.Email ShouldEqual "[email protected]" | ||
- name: DeleteUser | ||
steps: | ||
- type: http | ||
method: DELETE | ||
url: "{{.url}}/user/1" | ||
headers: | ||
Content-Type: application/json | ||
assertions: | ||
- result.statuscode ShouldEqual 204 |
This file was deleted.
Oops, something went wrong.
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