Metadata-Version: 2.1
Name: robotframework-openapidriver
Version: 0.1.0a5
Summary: A library for contract-testing OpenAPI / Swagger APIs.
Home-page: https://github.com/MarketSquare/robotframework-openapidriver
License: Apache-2.0
Author: Robin Mackaij
Maintainer: Robin Mackaij
Requires-Python: >=3.8,<4.0
Classifier: Framework :: Robot Framework
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Testing :: Acceptance
Requires-Dist: openapi-core
Requires-Dist: openapi-spec-validator
Requires-Dist: prance
Requires-Dist: requests
Requires-Dist: robotframework (>=4)
Requires-Dist: robotframework-datadriver (>=1.5)
Requires-Dist: robotframework-pythonlibcore (>=3)
Description-Content-Type: text/x-rst


===================================================
OpenApiDriver for Robot Framework®
===================================================

OpenDriver is an extension of the Robot Framework® DataDriver library that allows for
generation and execution of test cases based on the information in an OpenAPI document
(also known as Swagger document).
This document explains how to use the OpenApiDriver library.

For more information about Robot Framework®, see http://robotframework.org.
For more information about the DataDriver library, see
https://github.com/Snooz82/robotframework-datadriver.


Installation
------------

If you already have Python >= 3.8 with pip installed, you can simply run:

``pip install --upgrade robotframework-openapidriver``

OpenAPI (aka Swagger)
~~~~~~~~~~~~~~~~~~~~~

The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs.
https://swagger.io/specification/

The openapi module implements a reader class that generates a test case for each
endpoint, method and response that is defined in an OpenAPI document, typically
an openapi.json or openapi.yaml file.


How it works
^^^^^^^^^^^^

If the source file has the .json or .yaml extension, it will be
loaded by the prance module and the test cases will be generated.

.. code :: robotframework

    *** Settings ***
    Library            OpenApiDriver
    ...                    source=openapi.json
    Test Template      Do Nothing


    *** Test Cases ***
    Some OpenAPI test for ${method} on ${endpoint} where ${status_code} is expected

    *** Keywords *** ***
    Do Nothing
        [Arguments]    ${endpoint}    ${method}    ${status_code}
        No Operation

It is also possible to load the openapi.json / openapi.yaml directly from the server
by using the url instead of a local file:

.. code :: robotframework

    *** Settings ***
    Library            OpenApiDriver
    ...                    source=http://127.0.0.1:8000/openapi.json


Since the OpenAPI document is essentially a contract that specifies what operations are
supported and what data needs to be send and will be returned, it is possible to
automatically validate the API against this contract. For this purpose, the openapi
module also implements a number of keywords.


