Skip to content

Commit ba11d78

Browse files
VinayKumar VVSVinayKumar VVS
authored andcommitted
Updated the MD files
1 parent 947939f commit ba11d78

File tree

8 files changed

+46
-48
lines changed

8 files changed

+46
-48
lines changed

ReadMe.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## API Automation Tutorial
22

3-
In this tutorial you are going to learn <b>How to Automate the API Tests</b> using <b>RESTAssured Library</b>
3+
In this tutorial you are going to learn <b>How to Automate the REST API's in Java</b> using <b>RESTAssured Library</b>
44

5-
This project contains automated API tests explained step by step. The tech stack used for this project are:
5+
The tech stack used for this tutorial are:
66
1. **JAVA** as the programming language for writing test code
77
2. **TestNg** as the framework
88
3. **Gradle** as the build tool
@@ -32,20 +32,20 @@ Setup your machine.
3232
### PetStore - Swagger
3333
Throughout this tutorial, I am going to use [PetStore-Swagger](http://petstore.swagger.io/). <b>PetStore - Swagger</b> is the open source project which has very good documentation with the various number of examples.
3434

35-
#### [Chapter 1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01.md)
35+
#### [Chapter 1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01.md) :: Send a GET Request and validate the Response
3636
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/FirstChapterTests.java):** Send a get Request of an API and validate the body
3737
2. **[Test-2](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/FirstChapterTests.java):** Send a get Request of an API by passing the Query Parameters in the URL itself
3838
3. **[Test-3](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/FirstChapterTests.java):** Send a get Request of an API and retrieve the data from the body
3939
4. **[Test-4](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/FirstChapterTests.java):** Send a get Request of an API and store the Response
4040

41-
#### [Chapter 2](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/Chapter02.md)
42-
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/SecondChapterTests.java):** Optimized way to send the Request and receive the Response
41+
#### [Chapter 2](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/Chapter02.md) :: Abstracting the code
42+
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/SecondChapterTests.java):** Abstracting the Requests for maintenance and readability
4343

44-
#### [Chapter 3](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter03/Chapter03.md)
44+
#### [Chapter 3](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter03/Chapter03.md) :: POST Request creation and validating the Response Code
4545
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter03/ThirdChapterTests.java):** Creating the POST Request and validating the Response Code
4646

47-
#### [Chapter 4](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter04/Chapter04.md)
47+
#### [Chapter 4](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter04/Chapter04.md) :: POST Request creation and validating RequestBody & ResponseBody
4848
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter04/FourthChapterTests.java):** Creating the POST Request and validating the RequestBody & ResponseBody
4949

50-
#### [Chapter 5](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter05/Chapter05.md)
51-
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter05/FifthChapterTests.java)** Creating a Pet using POST method and verifying it by using GET method
50+
#### [Chapter 5](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter05/Chapter05.md) :: Chaining the API's
51+
1. **[Test-1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter05/FifthChapterTests.java)** Chaining Requests and validate Response Body

src/test/java/Chapters/Chapter01/Chapter01GradleConfig.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Gradle Configuration
22

3-
This file is used to download all the dependencies that are required for this tutorial
3+
``Gradle is a build tool used to manage all the dependencies``
44

55
#### Add the following Dependencies in `build.gradle`
66
1. `testCompile group: 'org.testng', name: 'testng', version: '6.14.3'` - For TestNG
@@ -13,10 +13,10 @@ After adding the dependencies your block should look like
1313

1414
#### Create a task for running tests from the command line
1515
* Add the following lines of code in your `build.gradle` file
16-
* This lines will make you execute all the tests present in the project.
16+
* This will make you execute all the tests present in the project from command line with `@Test` Annotation.
1717

1818
![](https://i.imgur.com/OPxH4hv.png)
1919

20-
#### Now total Gradle file should look like
20+
#### Now, the Gradle file should be:
2121

2222
![](https://i.imgur.com/LvkwUPW.png)

src/test/java/Chapters/Chapter02/Chapter02.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ In order to optimize the code, we have introduced the following Java Files.
2323

2424
#### **Tests**
2525
This Chapter consists only one test
26-
1. **Test-1:** Optimized way to send the Request and receive the Response
26+
1. **Test-1:** Abstracting the Requests for maintenance and readability
2727

2828
#### Summary
29-
These are the following things we have learned from [Chapter 1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01.md)
29+
Things we have learned so far from [Chapter 1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01.md)
3030
and [Chapter 2](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/Chapter02.md)
3131
1. How to send the Request and receive the Response.
3232
2. How to segregate the code based on their functionality by following `Single Responsibility Principle`.

src/test/java/Chapters/Chapter02/SecondChapterTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
public class SecondChapterTests extends BaseTest {
1010

11-
// Optimized way to send a Request and receive the Response
11+
// Abstracting the code for more readability and maintainability
1212
@Test
13-
public void optimizedWayToSendReqAndReceiveResponse() {
13+
public void abstractingTheRequestForMaintenanceAndReadability() {
1414
Response response = ResourceHelper.get(propertiesReader.getEndPointUrl("get_animals"));
1515
Assert.assertEquals(response.getStatusCode(), 200);
1616
}

src/test/java/Chapters/Chapter03/Chapter03.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* If you are reading this line then you are good to go. Let's get started with the <b>Third Chapter</b>
66

77
#### **Quick Recap**
8-
Here are some listing, we have learned till now
8+
Here are some listings, we have learned till now
99
1. How to send a GET Request
1010
2. How to validate the Response
1111
3. And also we have seen, How to segregate the things in order to maintain `Single Responsibility Principle`.
@@ -44,14 +44,14 @@ This Chapter consists only one test
4444

4545
In this test, we are doing the following actions:<br/>
4646

47-
a. Creating an object for <b>Category</b> with some data <br/>
48-
b. Creating an object for <b>Tags</b> with some data and inserting in the TagsList<br/>
49-
c. Now we are creating the main object <b>CreatePetRequest</b><br/>
50-
d. After creating the all objects, we are converting the object into String and sending it to the server<br/>
51-
e. Validating the Response StatusCode<br/>
47+
a. Create an object for <b>Category</b> with some data <br/>
48+
b. Create an object for <b>Tags</b> with some data and inserting in the TagsList<br/>
49+
c. Now create a main object <b>CreatePetRequest</b><br/>
50+
d. Then serialize the object into JSON String and sending it in the body<br/>
51+
e. Validate the Response Status-Code<br/>
5252

5353
#### **Summary**
54-
These are the things that we have learned till now
54+
Things we have learned so far:
5555
1. How to send the GET Request and receive the Response.
5656
2. How to segregate the code based on their functionality by following `Single Responsibility Principle`.
5757
3. How to create and send the POST Request using `Entity-Builder` pattern.

src/test/java/Chapters/Chapter04/Chapter04.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ Here are some listing, we have learned till now
1212
4. And also, How to send the POST Request using Entity-Builder pattern and validate the Response Code.
1313

1414
#### **Agenda for this Chapter**
15-
Till now we have how to send a POST Request and validate only the Response Code, Do you think is this sufficient?.
16-
No right!!. Don't worry in this chapter we are going to validate the Response body also. So let's get started.
15+
Till now we know how to send a POST Request and validate only the Response Code, Do you think is this sufficient?.
16+
Don't worry in this chapter we are going to validate the Response body as well. So let's get started.
1717

1818
#### **Response JSON**
1919
Here is the Response JSON, this JSON will be output when we POST the Request to server.
2020

2121
![](https://i.imgur.com/hQ0WTZB.png)
2222

2323
#### **Create Entities**
24-
1. As we have seen the Response JSON in the above picture, we clearly observe that in Response JSON also
24+
1. As we have seen the Response JSON in the above picture, we can clearly observe that in Response JSON also
2525
we have three Objects `Category, Tags & Main Object`. These objects are very similar to the one which we have created
2626
for the POST method.
2727
2. We can use the same one, but this approach is not recommended. Because if someday Request changes and Response is not changed
@@ -42,15 +42,15 @@ This Chapter consists only one test
4242

4343
In this test, we are doing the following actions:<br/>
4444

45-
a. Creating an object for <b>Category</b> with some data <br/>
46-
b. Creating an object for <b>Tags</b> with some data and inserting in the TagsList<br/>
47-
c. Now we are creating the main object <b>CreatePetRequest</b><br/>
48-
d. After creating the all objects, we are converting the object into String and sending it to the server<br/>
49-
e. Once we receive the Response, with the help of <b>ResponseHelper</b> we can map JSON String to Java Object<br/>
50-
f. Verifying the attributes from <b>RequestBody</b> & <b>ResponseBody</b>
45+
a. Create an object for <b>Category</b> with some data <br/>
46+
b. Create an object for <b>Tags</b> with some data and inserting in the TagsList<br/>
47+
c. Now create a main object <b>CreatePetRequest</b><br/>
48+
d. Then serialize the object into JSON String and sending it in the body<br/>
49+
e. Once we receive the Response, with the help of <b>ResponseHelper</b> we can de-serialize JSON String to Java Object<br/>
50+
f. Verify the attributes from <b>RequestBody</b> & <b>ResponseBody</b>
5151

5252
#### **Summary**
53-
These are the things that we have learned till now
53+
Things we have learned so far:
5454
1. How to send the GET Request and receive the Response.
5555
2. How to segregate the code based on their functionality by following `Single Responsibility Principle`.
5656
3. How to create and send the POST Request using `Entity-Builder` pattern.

src/test/java/Chapters/Chapter05/Chapter05.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,30 @@ Here are some listing, we have learned till now
1414

1515
#### **Agenda for this Chapter**
1616
* Till now we have seen how to send a Request and receive the Response, and their validations. Now we are going to see
17-
<b>How to Chain the API's</b>. What is Chaining? It is a process where we can pass
18-
the information from one HTTP method to other HTTP method.
17+
<b>How to Chain the API's</b>. What is Chaining? It is a process where we can pass the information from one HTTP Request to other HTTP Requests.
1918

2019
#### **Tests**
2120
This Chapter consists only one test
22-
1. **Test-1:** Creating a Pet using POST method and verifying it by using GET method
21+
1. **Test-1:** Chaining Requests and validate Response Body
2322

2423
In this test, we are doing the following actions:<br/>
25-
<b>POST Request</b><br/>
26-
a. Creating an object for <b>Category</b> with some data <br/>
27-
b. Creating an object for <b>Tags</b> with some data and inserting in the TagsList<br/>
28-
c. Now we are creating the main object <b>CreatePetRequest</b><br/>
29-
d. After creating the all objects, we are converting the object into String and sending it to the server<br/>
30-
e. Once we receive the Response, with the help of <b>ResponseHelper</b> we can map JSON String to Java Object<br/>
31-
f. Verifying the attributes from <b>RequestBody</b> & <b>ResponseBody</b>
24+
<b>POST Request</b><br/>
25+
a. Create an object for <b>Category</b> with some data <br/>
26+
b. Create an object for <b>Tags</b> with some data and inserting in the TagsList<br/>
27+
c. Now create a main object <b>CreatePetRequest</b><br/>
28+
d. Then serialize the object into JSON String and sending it in the body<br/>
29+
e. Once we receive the Response, with the help of <b>ResponseHelper</b> we can de-serialize JSON String to Java Object<br/>
30+
f. Verify the attributes from <b>RequestBody</b> & <b>ResponseBody</b>
3231

3332
<b>GET Request</b><br/>
3433
g. Creating a GET Request using the PetId and verifying the other data
3534

36-
```Similarly we can chain the other HTTP Methods as well. Like POST -> GET -> PUT -> DELETE ..```
35+
```Similarly, we can chain the HTTP Requests with other methods as well. Like POST -> GET -> PUT -> DELETE ..```
3736

3837
#### **Summary**
39-
These are the things that we have learned till now
38+
Things we have learned so far:
4039
1. How to send the GET Request and receive the Response.
4140
2. How to segregate the code based on their functionality by following `Single Responsibility Principle`.
4241
3. How to create and send the POST Request using `Entity-Builder` pattern.
4342
4. How to verify the RequestBody & ResponseBody
44-
5. How to chain the API's
45-
43+
5. How to chain the API's

src/test/java/Chapters/Chapter05/FifthChapterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class FifthChapterTests extends BaseTest {
2121

2222
@Test
23-
public void createPetAndVerifyTheCreationUsingGETMethod() throws IOException {
23+
public void chainingRequestsAndValidatingTheResponse() throws IOException {
2424

2525
// Creating the Category Object
2626
Category category = new CategoryBuilder()

0 commit comments

Comments
 (0)