Skip to content

Commit d00adcd

Browse files
Marta KravchukMarta Kravchuk
authored andcommitted
update README
1 parent 3a4a7a4 commit d00adcd

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ This project aims to create a maintainable test framework, implement reusable co
1515
This API test automation framework utilizes TestNG and REST Assured, managed with Maven for building, and generates clear, insightful reports using Allure Report.
1616
It provides a set of predefined test cases to ensure bookstore API functions behave as expected.
1717

18-
19-
### ⚙️ Tech Stack
18+
### Tech Stack:
2019
- **Programming Languages**: Java, JavaScript
2120
- **Testing Framework**: TestNG
2221
- **API Testing Library**: REST Assured
@@ -25,7 +24,7 @@ It provides a set of predefined test cases to ensure bookstore API functions beh
2524
- **CI/CD**: GitHub Actions
2625
- **Backend API**: Express.js (Node.js)
2726

28-
### Requirements
27+
### Requirements:
2928
Requires **Java 22**, **Maven 3.9.x**, and **Allure Report 2.33.x** to be installed and properly configured on your local machine.<br/>
3029

3130
## Table of Contents
@@ -37,21 +36,21 @@ Requires **Java 22**, **Maven 3.9.x**, and **Allure Report 2.33.x** to be instal
3736
6. [CI/CD Pipeline with GitHub Actions](#six)
3837

3938
<a id="one"></a>
40-
## 1. Setting up REST API using Express.js
39+
### 1. Setting up REST API using Express.js
4140
The REST API, built with **Express.js**, is already set up and configured for immediate use.
4241
The following steps provide details for understanding the setup process and exploring the existing configuration:<br/>
4342

44-
### Step 1. Project Initialization:
43+
#### Step 1. Project Initialization:
4544
A new project directory (`api-bookstore/`) was created, and `npm init -y` command was used to initialize the project.
4645
This generates a `package.json` file, which is essential for managing project dependencies.
4746

48-
### Step 2. Installing Dependencies:
47+
#### Step 2. Installing Dependencies:
4948
The following dependencies were installed by running `npm install express body-parser nodemon`:
5049
* `express` - the Express.js framework for building the API.
5150
* `body-parser` - middleware for parsing request bodies, allowing easy access to data sent in POST and PUT requests.
5251
* `nodemon` - utility that automatically restarts the server upon file changes, enhancing the development experience.
5352

54-
### Step 3. Creating `server.js`:
53+
#### Step 3. Creating `server.js`:
5554
The core logic of the API resides in the `server.js` file. It handles routing, request processing, and data management, performing the following key tasks:
5655
* Loads necessary libraries like Express.js for routing and request handling, and middleware for parsing incoming data.
5756
* Creates an instance of the Express application, which serves as the foundation for the API.
@@ -62,7 +61,7 @@ The core logic of the API resides in the `server.js` file. It handles routing, r
6261

6362
You can explore the `server.js` file in the `api-bookstore/` directory for more details on the API implementation.
6463

65-
### Step 4. Configuring `package.json`:
64+
#### Step 4. Configuring `package.json`:
6665
The `package.json` is an important file in Node.js projects. It has several critical functions:
6766
* Contains **metadata** about the project, such as name, version, description, author, license, etc.
6867
* Indicates **dependencies** which other packages (libraries) your project depends on. The `npm` uses this information to install the necessary packages.
@@ -73,14 +72,14 @@ You can explore the `package.json` file in the `api-bookstore/` directory for mo
7372
It is used to define dependencies (**express**, **body-parser**, **nodemon**) and scripts (`start`, `dev`).
7473
This helps to quickly set up the project by simply running `npm install`.
7574

76-
### Step 5. Run server:
75+
#### Step 5. Run server:
7776
To start the server in development mode, use the following command `npm run dev`.
7877
This command leverages `nodemon` to automatically restart the server whenever file changes are detected.
7978
Upon successful startup, you should see a message similar to _"Server is running on port 3000"_ in your terminal, confirming that the API is active and listening for requests.
8079

8180

8281
<a id="two"></a>
83-
## 2. Framework Structure
82+
### 2. Framework Structure
8483
The framework's architecture is built on a structured directory organization to ensure scalability and maintainability:<br/>
8584
```
8685
|--online-bookstoore-frmk/
@@ -112,7 +111,7 @@ The framework's architecture is built on a structured directory organization to
112111

113112

114113
<a id="three"></a>
115-
## 3. Creating API Test Scenarios
114+
### 3. Creating API Test Scenarios
116115
Creating API test scenarios involves defining test data and expected API behavior.<br/>
117116

118117
**Steps to Build API Test Scenarios:**
@@ -123,7 +122,7 @@ Creating API test scenarios involves defining test data and expected API behavio
123122

124123

125124
<a id="four"></a>
126-
## 4. API Test Execution
125+
### 4. API Test Execution
127126
This project uses **Maven** for dependency management and build automation. The base URL for the API tests can be configured by creating a hidden `.env` file and defining the `BASE_URL` parameter.
128127
The default value is `http://localhost:3000/api/v1/`, but this setting can be modified directly within the `server.js` file.<br/>
129128

@@ -145,7 +144,7 @@ _Parameters:_<br/>
145144

146145

147146
<a id="five"></a>
148-
## 5. Generate Allure REST Assured Report
147+
### 5. Generate Allure REST Assured Report
149148
Before running tests, it's crucial to clean up any existing test results and reports. This ensures that your report accurately reflects the most recent test run.
150149
Use the following command to remove the `allure-report` and `allure-results` directories:<br/>
151150
```bash
@@ -175,14 +174,14 @@ allure serve
175174
```
176175
This command starts a local web server and automatically opens the generated report in your default browser.
177176

178-
### Allure Report Overview:
177+
#### Allure Report Overview:
179178
An example of the generated Allure report looks like this:<br/>
180179
<img width="964" height="699" alt="allure_overview" src="https://github.com/user-attachments/assets/5b706e9b-3cbc-47ec-aabe-6b875dc3b456" />
181180
<img width="1739" height="858" alt="allure_report" src="https://github.com/user-attachments/assets/9860344f-eed9-4c45-981d-6e8e4279046a" />
182181

183182

184183
<a id="six"></a>
185-
## 6. CI/CD Pipeline with GitHub Actions
184+
### 6. CI/CD Pipeline with GitHub Actions
186185
This project utilizes a CI/CD pipeline configured using GitHub Actions. The pipeline automates the testing process, ensuring that every code change is thoroughly validated.
187186
The configuration file for the workflow is located at `.github/workflows/ci.yml`.
188187

0 commit comments

Comments
 (0)