Metadata-Version: 2.1
Name: behave-restful
Version: 0.1.9
Summary: Implements Gherking language for REST services.
Home-page: https://github.com/behave-restful/behave-restful
Author: Isaac Rodriguez
Author-email: oss.abantos@outlook.com
License: MIT
Keywords: rest bdd behave gherkin test automation testing
Platform: UNKNOWN
Classifier: Development Status :: 1 - Planning
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Testing :: Acceptance
Classifier: Topic :: Software Development :: Testing :: BDD
Requires-Dist: behave (>=1.2.5)
Requires-Dist: jsonpath-rw (>=1.4.0)
Requires-Dist: jsonschema (>=2.6.0)
Requires-Dist: requests (>=2.18.4)


Behave Restful
==============


.. image:: https://travis-ci.org/behave-restful/behave-restful.svg?branch=master
   :target: https://travis-ci.org/behave-restful/behave-restful
   :alt: Build Status


Behave Restful is a Behavior Driven Development (BDD) framework based on 
`behave <https://pythonhosted.org/behave/>`_\ , that implements a language suitable 
to test and validate REST APIs and Services. It leverages the power of the 
`gherkin <https://github.com/cucumber/cucumber/wiki/Gherkin>`_ language to write 
business readable tests that validate the behavior of REST APIs.

Although, Behave Restful is implemented in `python <http://www.python.org>`_ and 
uses `behave <https://pythonhosted.org/behave/>`_ as underlying framework, it can 
test services implemented in any language as easy as:

.. code-block:: gherkin


   Feature: API to add a new book to our collection
       As a user, I want to add a new book to my "to-read" collection.

       Scenario: Add a new book to collection.
           Given a request url http://my.reads/api/books
               And a request json payload
                   """
                   {
                       "category": "reference",
                       "author": "Nigel Rees",
                       "title": "Sayings of the Century",
                       "price": 8.95,
                       "status": "to-read"
                   }
                   """
           When the request sends POST
           Then the response status is CREATED
               And the response json matches
                   """
                   {
                       "title": "BookObject",
                       "type": "object"
                       "properties": {
                           "id": {"type": "number"},
                           "category": {"type": "string"},
                           "author": {"type": "string"},
                           "title": {"type": "string"},
                           "price": {"type": "number"},
                           "status": {"type": "string", "enum": ["to-read", "reading", "read"]}
                       },
                       "required": ["id", "category", "title"]
                   }
                   """
               And the response json at $.id is equal to 100
               And the response json at $.category is equal to "reference"
               And the response json at $.title is equal to "Sayings of the Century"

As you can see in the example, we send a POST request to the specified url with
a JSON payload, and we can validate the result very easy. First, we verify that
the status of the response is CREATED (it succeeds). Then we validate the
response JSON body using the expected `JSON Schema <http://json-schema.org/>`_. 
Finally, we validate specific values in the response using 
`JSONPath <http://goessner.net/articles/JsonPath/>`_


