Skip to content

Commit

Permalink
Update README.rst file
Browse files Browse the repository at this point in the history
  • Loading branch information
slaily committed Dec 10, 2019
1 parent af91669 commit 6a96fe1
Showing 1 changed file with 84 additions and 11 deletions.
95 changes: 84 additions & 11 deletions README.rst
Expand Up @@ -2,17 +2,19 @@ pyhttptest: HTTP tests over RESTful APIs✨
##########################################

Pissed about writing test scripts against your RESTFul APIs anytime?

Describe an HTTP Requests test cases in a simplest and widely used format JSON within a file.

Run one command and gain a summary report.

.. image:: https://www.dropbox.com/s/algkq1lswqpfx53/pyhttptest-cli.png?raw=1
.. image:: https://www.dropbox.com/s/znlgozgcyyv98bd/pyhttptest-cli-table-of-results.png?raw=1
:alt: pyhttptest in the command line
:width: 100%
:align: center


Installation
-------------
******************************************

Recommended installation method is to use ``pip``:

Expand All @@ -24,7 +26,7 @@ Python version **3+** is required.


Usage
-------------------
******************************************

.. code-block:: bash
Expand All @@ -34,11 +36,14 @@ See also ``pyhttptest --help``.


Examples
--------
******************************************

Single test case
------------------------------------------

Create a .json file and define a test case like an example:

``FILE: GET_USERS.json``
``FILE: HTTP_GET.json``

.. code-block:: json
Expand All @@ -59,11 +64,79 @@ Execute a test case:

.. code-block:: bash
$ pyhttptest execute FILE_PATH/GET_USERS.json
$ pyhttptest execute FILE_PATH/HTTP_GET.json
Result:

.. image:: https://www.dropbox.com/s/algkq1lswqpfx53/pyhttptest-cli.png?raw=1
:alt: pyhttptest in the command line
:width: 100%
:align: center

Мultiple test cases
------------------------------------------

Create a .json file and define a test cases like an example:

``FILE: requests.json``

.. code-block:: json
[
{
"name":"TEST: List all users",
"verb":"GET",
"endpoint":"api/v1/users",
"host":"http://localhost:8085/",
"headers":{
"Accept-Language":"en-US"
},
"query_string":{
"limit":1
}
},
{
"name":"TEST: Add a new user",
"verb":"POST",
"endpoint":"api/v1/users",
"host":"http://localhost:8085/",
"payload":{
"username":"pyhttptest",
"email":"admin@pyhttptest.com"
}
},
{
"name":"TEST: Modify an existing user",
"verb":"PUT",
"endpoint":"api/v1/users/XeEsscGqweEttXsgY",
"host":"http://localhost:8085/",
"payload":{
"username":"pyhttptest"
}
},
{
"name":"TEST: Delete an existing user",
"verb":"DELETE",
"endpoint":"api/v1/users/XeEsscGqweEttXsgY",
"host":"http://localhost:8085/"
}
]
Execute a test case:

.. code-block:: bash
$ pyhttptest execute FILE_PATH/requests.json
Result:

.. image:: https://www.dropbox.com/s/znlgozgcyyv98bd/pyhttptest-cli-table-of-results.png?raw=1
:alt: pyhttptest in the command line
:width: 100%
:align: center

Dependencies
~~~~~~~~~~~~
******************************************

Under the hood, pyhttptest uses these amazing libraries:

Expand All @@ -80,25 +153,25 @@ Under the hood, pyhttptest uses these amazing libraries:


Contributing
------------
******************************************

See `CONTRIBUTING <https://github.com/slaily/pyhttptest/blob/master/CONTRIBUTING.rst>`_.


Changelog
----------
******************************************

See `CHANGELOG <https://github.com/slaily/pyhttptest/blob/master/CHANGELOG.rst>`_.


Licence
-------
******************************************

BSD-3-Clause: `LICENSE <https://github.com/slaily/pyhttptest/blob/master/LICENSE>`_.


Authors
-------
******************************************

`Iliyan Slavov`_

Expand Down

0 comments on commit 6a96fe1

Please sign in to comment.