Skip to content

Commit 2833391

Browse files
author
Serhat Bolsu
committed
Update Overview in README
1 parent 09ca0d0 commit 2833391

File tree

1 file changed

+61
-7
lines changed

1 file changed

+61
-7
lines changed

README.md

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,29 @@ Restful API testing sample framework. ATDD is the suggested design pattern with
44
Jest is chosen since it is sharing the same `expect` library with webdriverio.
55
It is much faster then mocha due to inherent parallelization.
66

7-
## Goal
8-
9-
TBA
7+
## Overview
8+
9+
In this framework, you will find test suites for included restful api "Vegetable" service.
10+
You will find three suites that are representing different design choices
11+
- Test suite using super agent.
12+
- Test suite using base api which represent DSL of 'Vegetable' application.
13+
- Test suite using Resource Objects, explained below.
14+
15+
You can copy this library and use as you like, however think about the design choices you are changing.
16+
17+
Technology | Description
18+
---------- | -----------
19+
Acceptance Test Driven Development | ATDD involves team members with different perspectives (customer, development, testing) collaborating to write acceptance cases.
20+
Resource Objects | Design pattern like Page Object, represent each endpoint as resource
21+
Code as commit | Everything about test automation should be committed, including CI
22+
23+
Tools | Description
24+
--- | ---
25+
superagent | Request is a library for making HTTP requests. This will be used for making the HTTP requests in the tests
26+
jest | Jest is a test executor that is running async. It includes assertion library.
27+
eslint | Static code analysis tool for Javascript
28+
husky | Regulate code commit (with linter in this case)
29+
express | Express is popular HTTP framework for NodeJS which will be used for creating the System Under Test.
1030

1131
## Setup
1232
First need to create your own configurations.
@@ -15,15 +35,15 @@ Copy the sample.env and rename to `.env`
1535

1636
```npm install```
1737

18-
- Run tests in local
19-
20-
```npm test```
21-
2238
In case you want to run against sample api *Vegetables*,
2339
run the server with
2440

2541
```npm start```
2642

43+
Run tests in local
44+
45+
```npm test```
46+
2747
## Test Suites and Example usage
2848
These are example usages of library. From 1 to 3 abstraction of endpoints increases.
2949

@@ -51,6 +71,40 @@ Uses resource object, this is a similar method used in selenium with **page Obje
5171
- usage of superagent/requests encapsulated, however still usable look at tc#3
5272
- Pre-initialized resource-objects, it serve as a facade to service under test.
5373

74+
## Familiarizing Yourself with the System Under Test
75+
76+
It's always necessary to get to know the code you are testing.
77+
Let us examine the API that we are testing. The purpose of the API is to be an interface with a vegetable database.
78+
Supports the following operations:
79+
80+
- Adding a vegetable
81+
- Deleting a vegetable
82+
- Getting all vegetables
83+
84+
The API supports adding and deleting individual vegetables. You can also get all vegetables in the database. Here are the API routes:
85+
86+
* GET /vegetables
87+
* Description
88+
* Get all the vegetables in the database
89+
* Query Parameters
90+
* upperCase
91+
* If set to "true" the vegetable's name will be return uppercase
92+
* Default is false
93+
* optional
94+
* If set to "true", return will include optional: `origin`
95+
* Default is true
96+
97+
* POST /vegetables
98+
* Description
99+
* Add a vegetable to the database
100+
101+
* DELETE /vegetables/:id
102+
* Description
103+
* Delete a vegetable from the database
104+
* Url Parameters
105+
* name
106+
* The name of the vegetable to delete
107+
54108
## ToDO
55109
- Allure reporting
56110
- Jenkinsfile

0 commit comments

Comments
 (0)