Skip to content

Commit 8ea755f

Browse files
VinayKumar VVSVinayKumar VVS
authored andcommitted
Updated all .md files
1 parent 5cd2e34 commit 8ea755f

File tree

4 files changed

+31
-32
lines changed

4 files changed

+31
-32
lines changed

ReadMe.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
In this tutorial you are going to learn <b>How to Automate the API Tests</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+
This project contains automated API tests explained step by step. The tech stack used for this project are:
66
1. **JAVA** as the programming language for writing test code
7-
2. **TestNg** as framework
7+
2. **TestNg** as the framework
88
3. **Gradle** as the build tool
99
4. **IntelliJ** as the preferred IDE for writing java code.
1010

1111
#### Getting Started
1212
Setup your machine.
1313
1. Install JDK 1.8
1414
2. Install IntelliJ (Community edition is fine)
15-
3. Install gradle
15+
3. Install Gradle
1616

1717
#### Cloning & Importing the Project
1818
1. Clone the project from ```git clone https://github.com/vinaykumarvvs/api-automation-tutorial.git```
19-
2. Import the project (api-automation-tutorial) in IntelliJ ```File -> New -> Project from Existing Sources -> Browse Project Location -> build.gradle```
19+
2. Import the project (API-automation-tutorial) in IntelliJ ```File -> New -> Project from Existing Sources -> Browse Project Location -> build.gradle```
2020
3. Now click on ```auto import -> Ok``` wait until the IntelliJ downloads all the dependencies
2121

2222
#### Running tests
2323
``Note:`` For 2nd & 3rd steps, you need to follow this way ```OpenTerminal/CMD -> cd <change-to-project-location>```
24-
1. You can run the tests directly from the IntelliJ, by right clicking and **Run test**..
24+
1. You can run the tests directly from the IntelliJ, by right-clicking and **Run test**.
2525
2. For Linux/Mac users: ```gradle clean build runTests```
2626
3. For Windows users: ```gradlew clean build runTests```
2727

@@ -30,15 +30,13 @@ Setup your machine.
3030
## Tutorial Begins
3131

3232
### PetStore - Swagger
33-
Through out this tutorial I am going to use [PetStore-Swagger](http://petstore.swagger.io/). <b>PetStore - Swagger</b> is the open source project
34-
which has very good documentation with various number of examples.
33+
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.
3534

3635
#### [Chapter 1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01.md)
3736
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
3837
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
39-
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 body
38+
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
4039
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
4140

4241
#### [Chapter 2](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/Chapter02.md)
43-
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
44-
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

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
click [here](http://rest-assured.io/)
77

88
#### Getting Started
9-
First let us quickly understand the following things
9+
First, let us quickly understand the following things
1010
1. **What is DSL?**
1111
2. **Keywords present in RESTAssured DSL**
1212

@@ -23,7 +23,7 @@ but you often use multiple DSLs in a system mainly written in a general purpose
2323
4. extract()
2424

2525
And other <b>Keywords</b> are used following to the `given|when|then|extract`. Click [here](https://github.com/rest-assured/rest-assured/wiki/usage)
26-
to check few more keywords.
26+
to check a few more keywords.
2727
#### Sequence of creating a Request and receiving a Response
2828
1. `given()` - These are the configs that we can define following to the current keyword
2929
* QueryParameters
@@ -39,10 +39,10 @@ to check few more keywords.
3939
**Note:** Before getting into tests, we need to add the dependencies in Gradle File. Click here to check the
4040
[<b>Gradle Config</b>](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01GradleConfig.md)
4141

42-
This Chapter consists four tests
42+
This Chapter consists of four tests
4343
1. **Test-1:** Send a get Request of an API and validate the body
4444
2. **Test-2:** Send a get Request of an API by passing the Query Parameters in the URL itself
45-
3. **Test-3:** Send a get Request of an API and retrieve the data from body
45+
3. **Test-3:** Send a get Request of an API and retrieve the data from the body
4646
4. **Test-4:** Send a get Request of an API and store the Response
4747

4848
#### **Test-1:** Send a GET Request of an API and validate the body
@@ -53,23 +53,25 @@ In this test we are going to Send a Request and Validate the JSON body
5353
4. `body()` - To get the data from the JSON and verify it.
5454

5555
#### **Test-2:** Send a get Request of an API by passing the Query Parameters in the URL itself
56-
In the above test we have seen how to pass the query parameters separately. Now let's see how to pass it in another way
56+
In the above test, we have seen how to pass the query parameters separately. Now let's see how to pass it in another way
5757
1. Not only in the `queryParameter()` section we can even pass the parameters in the URL itself.
58-
This approach is good when we have common `GET` method across all API's.
58+
This approach is good when we have a common `GET` method across all API's.
5959

60-
#### **Test-3:** Send a GET Request of an API and retrieve the data from body
61-
In this test we are going to Send a Request and retrieve some data from the Response
60+
#### **Test-3:** Send a GET Request of an API and retrieve the data from a body
61+
In this test, we are going to Send a Request and retrieve some data from the Response
6262
1. `extract()` - It is used to return any value from the JSON
6363

6464
#### **Test-4:** Send a GET Request of an API and store the Response
65-
Previously we have seen how to retrieve a single value. Now in this test we are going to store entire Response
65+
Previously we have seen how to retrieve a single value. Now in this test, we are going to store entire Response
6666
1. `Response response = given()...` - This way we can store the Response
67+
6768
![](https://i.imgur.com/t35qmpT.png)
69+
6870
2. `response.getStatusCode` - Will return the StatusCode
6971
3. `response.getBody().asString()` - Returns entire JSON Body in a String format
7072

7173
#### Summary
72-
In this Chapter we have learnt about
73-
1. How to create and send a Request for get API
74+
In this Chapter, we have learned about
75+
1. How to create and send a Request for a get API
7476
2. How to retrieve single data from JSON body
7577
3. How to Store the Response

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ After adding the dependencies your block should look like
1111

1212
![](https://i.imgur.com/8IsMIdQ.png)
1313

14-
#### Create a task for running tests from command line
14+
#### 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 to execute all the tests present in the project.
16+
* This lines will make you execute all the tests present in the project.
1717

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

20-
#### Total gradle file should look like
21-
22-
![](https://i.imgur.com/LvkwUPW.png)
20+
#### Now total Gradle file should look like
2321

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

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

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

77
#### **Before getting into the Tests**
8-
These are the things we have done in the <b>First Chapter</b> that are not recommended. In a layman approach we can simply say <b>First Chapter</b> is very tightly coupled.
8+
These are the things we have done in the <b>First Chapter</b> that are not recommended. In a layman approach, we can simply say that <b>First Chapter</b> is very tightly coupled.
99
1. Hard-coded the `BASE_URL`
1010
2. And if you observe, in every test we are repeating the same lines of code like `given|when|then|get..` for the same functionality.
1111

1212
#### **Agenda for this Chapter**
13-
Now in this chapter we are going to optimize the code what we have used for <b>First Chapter</b>, by doing this anyone can easily
13+
Now in this chapter, we are going to optimize the code what we have used for <b>First Chapter</b>, by doing this anyone can easily
1414
read and maintain the code.
1515

1616
#### **Optimizing**
17-
In order to optimize the code we have introduced the following Java Files.
17+
In order to optimize the code, we have introduced the following Java Files.
1818
1. [PropertiesReader](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/utils/PropertiesReader.java) - It is used to read the URL's from the Properties file.
1919
2. [ResourceHelper](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/utils/ResourceHelper.java) - This Java file is used to implement all <b>HTTP Methods</b>
20-
3. [BaseTest](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/utils/BaseTest.java) - Every test needs to extend this Java File. In this file we can have `Hooks|CommonsMethods`
20+
3. [BaseTest](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/utils/BaseTest.java) - Every test needs to extend this Java File. In this file, we can have `Hooks|CommonsMethods`
2121

22-
```After introducing the above files we can clearly say that, our project is loosly coupled and easily maintainable```.
22+
```After introducing the above files we can clearly say that our project is loosely coupled and easily maintainable```.
2323

2424
This Chapter consists only tests
2525
1. **Test-1:** Optimized way to send the Request and receive the Response
2626

2727
#### Summary
28-
These are the following things we have learnt from [Chapter 1](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter01/Chapter01.md)
28+
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)
2929
and [Chapter 2](https://github.com/vinaykumarvvs/api-automation-tutorial/tree/master/src/test/java/Chapters/Chapter02/Chapter02.md)
3030
1. How to send the Request and receive the Response.
3131
2. How to separate the code based on their functionality `Single Responsibility Principle`.

0 commit comments

Comments
 (0)