You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tests were created with a functional testing approach,on every test run some checks and validation are done with certain inputs to verify that data is inserted,displayed,updated and deleted correctly.
Project Solution
This project is divided in one class library(SwaggerPetStoreAutomationAPI) where are located Actions(Endpoint raw call and responses),Controller(Rest client and Rest Request),Entities(Json converted to Objects),Handlers(Json Serialize and Parse),JsonModels(Json Models for each api entity),Resources(miscellaneous files to test file uplad on endpoints) and Helpers(LoggingHelper)folders and in one test class(SwaggerPetStoreAutomationTests) where are located BaseTests(Base Class),Test(Test to be executed in this project) and TestSharedSteps(Object initialization and endpoint calls abstracted on methods) folders,each of this folders
represent an abstraction layer.
This type of solution was used for better code reusability,maintainability of the testing framework.
Framework / Libraries / Tech Stack
C#
.NET Core
RestSharp
XUnit
This project is developed using C# with .NET Core,XUnit as the testing framework and RestSharp as my .NET client for the APIs.
I decided to utilize C# along with Restsharp because this library it's one of the best and easy to use libraries to handle REST api in .NET,it allows you to serialize/deserialize Json as Objects easily and also RestSharp support all the HTTP methods(GET, PUT, HEAD, POST, DELETE and OPTIONS).
I also utilized .NET Core so this project can have the Ability to run on Windows, macOS, and Linux and Xunit since this is one of the .NET Frameworks that is far more flexible and extensible than others .Net Unit test frameworks.
Scenarios covered on the solution
The following scenarios are cover by the automation test suite:
Verify Order Status are updated on the Pet Inventory endpoint(OrderTests.cs).
Verify Order can be created/Updated/Deleted(OrderTests.cs).
Verify pets can be created/Updated/Deleted(PetsTests.cs).
Verify pets can be search by status(available,pending and sold)(PetsTests.cs).
Verify pets can be search by different tags(PetsTests.cs).
Verify images can be uploaded to pet entities(PetsTests.cs).
Verify users can logIn/logOut(UserTests.cs).
Verify users can be created(UserTests.cs).
Verify users can be created/Updated/Deleted(UserTests.cs).