1.0.24 • Published 4 years ago

simpleapitest v1.0.24

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

SimpleAPITest

Welcome to world's simple and fastest REST API test framework.

First see the demo DEMO

IMAGE ALT TEXT HERE

Why I build this?

Generally, people hate writing test case as it's boring and needs some effect. I believe in a test framework which should take .0001% efforts to test compared to develop the same feature. That's why I build this framework.

How to install?

sudo npm install simpleapitest -g
sudo npm update simpleapitest -g

This command will install the script simpleapitest in the bin.

Writing a test case.

Just create a test file as put the test case. Each line of that file indicates one test case - very clear and super concise.

A sample testcase looks like:

GET  => http://{server}/api/test0/test => 404 - We have not yet support this api
POST => http://{server}/api/test0/create => {"name":"dip","count":1} => success

As you can see, we can test GET and POST call in a single line. In case of GET call, the test case looks like : GET => <URL> => <Expected Output Substring>. In case of POST call, the test case looks like : POST => <URL> => <POST DATA> => <Expected Output Substring>.

Setup and execute.

Some test case requires some setup, as you can only make find only after inserting some entry. We might need to id which is returned by the setup call to test the update rest API. You can user named RE to collect the entry. You can start with a bang(!) to indicate a setup call - not really a test call.

Here is an example:

!POST => http://{server}/api/test0/create => {"name":"dip","count":1} => "_id":"(?<id>.*)"
GET => http://{server}/api/test0/find?id={id}  => Find successfully with 1 items

In the above example, we are inserting an item in the table and collecting the id. and In the test call, we are passing the id as {id} which is return by the setup call. Also note that, i ahve used a ! sign in the setup call.

How to run:

once you have to write testcase, you can execute it easily like:

simpleapitest -s simplestore1.herokuapp.com  -f ./sample.txt
1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago