Project of test automation using cypress. For this project, the api used was Free API Books.
The model of response body for all requests is:
{
"id": 0,
"title": "string",
"description": "string",
"pageCount": 0,
"excerpt": "string",
"publishDate": "2023-10-14T18:44:34.674Z"
}
Endpoint | Method | Test | Expected Result |
---|---|---|---|
/Books | GET | Search all books with success | - Return a status code 200 - The body response contain all fields non empty - The pageCount value is an integer |
/Books/{id} | GET | Search a specific book with success | - Return a status code 200 - The body response contain all fields non empty |
/Books/{id} | GET | Search a specific book with invalid id | - Return a status code 404 - The title of message error should be "Not Found" |
/Books | POST | Create a book with success | - Return a status code 200 - The body response contain all fields non empty - The pageCount value is an integer |
/Books | POST | Create a book without body request | - Return a status code 415 |
/Books | POST | Create a book with empty body request | - Return a status code 200 - The fields of body response are filled with default configuration |
/Books/{id} | PUT | Update an book with success | - Return a status code 200 - The body response contain all fields non empty |
/Books/{id} | PUT | Update a book passing an inexistent ID | - Return a status code 404 |
/Books/{id} | PUT | Update a book passing invalid ID | - Return a status code 400 |
/Books/{id} | PUT | Update a book with empty body request | - Return a status code 200 |
/Books/{id} | DELETE | Delete a book with success | - Return a status code 200 |
/Books/{id} | DELETE | Delete a book with inexistent ID | - Return a status code 400 |
Install the depencencies:
npm install
Running the tests:
npm run tests
You can check more details about how this project was built here