Skip to content

Rest Assured+ cucumber+API+uploud local json-server in 15 sec using cmd

Notifications You must be signed in to change notification settings

EladAvrahami/Rest-Assured-for-API-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rest-Assured-for-API-testing

Rest Assured+ cucumber+API+uploud local json-server in 15 sec using cmd
🚧🚧🚧work in progress🚧🚧🚧

###Rest-Assured is a simple java liberary for testing and validating REST services (just like Roby&Groovy).###
pattern behavior-driven development (BDD) is an agile software development process that encourages collaboration among developers, quality assurance testers, and customer representatives in a software project

#1
Testing Features:
Scenario ,Given, And , Then .

#2
GET operation with params:
given() , .with(), .when(), .then(), .queryParam() ,hasSize(num), hasItem() .

#3
1 - Arrange /Act/Assert pattren :
requestSpecBuilder class , setBaseUri() ,builder
2 - RestAssuredExtantion:
RequestSpecification class -is a important class becouse it has a lot of staff like cookies parameters query parameters and a lot more ...

#4
POST with body parameter:
Use json serializer as pom dependency called Jackson-make the haseMap that puted as key value in the BDDStyleMethod to availible to create a new server json objects.
Creat scanerio for POST with body and path params + step definition implementation.
<-- PAY ATTENTION!!! TO DELETE THE DEFULD THAT COMES WITH THAT OR THERE WILL BE DIFFICULT TO IMPORT JAVA's OTHER CLASSES !!!! (according to :https://stackoverflow.com/questions/58515714/the-import-io-restassured-restassured-cannot-be-resolved ) -->


#5
perform a POST operation with path&body parameters- Scenario 7
assertThat()- The assertThat is one of the JUnit methods from the Assert object that can be used to check if a specific value match to an expected one. It primarily accepts 2 parameters. First one if the actual value and the second is a matcher object. I use it to compere between the name valuse that i supposed to get to the one i got .
DataTable and new way to use it : //https://stackoverflow.com/questions/55591569/cucumber-datatable-error-io-cucumber-datatable-undefineddatatabletypeexception .

#6
perform a DELET operation with RESTassured - Scenario 8
just follow the scenario (: + I biuld methods at the RestAssuredExtension java class that I will be required to perform scenario 8 at the DELETEPost.feature
Scnerio Part 8 start process of POST obj >DELETE him>and chack if found with Get operation

#7
implement DELETEPost Scenario+ debuge it by using live json server +debug+postman

#8
implement PUTPost Scenario create PutOperationWithBodyAndPathParams in restAssuredExtention+impliment Scenario and create codition chack if it was updated



## helpful links: 1.https://github.com/typicode/json-server
2.https://rest-assured.io/
3.https://www.youtube.com/watch?v=MBBWVgE0ewk ->cmd nevigation https://github.com/typicode/json-server - json server git
https://github.com/rest-assured/rest-assured/wiki/GettingStarted -> rest-assured dependency https://mvnrepository.com/artifact/io.cucumber/cucumber-java -> cucumber dependency

Releases

No releases published

Packages

No packages published