HttpCtrl library for Robot Framework
====================================
**RobotFramework-HttpCtrl** is a library for Robot Framework that provides HTTP/HTTPS client and HTTP (IPv4 and IPv6) server services
to make REST API testing easy.
**License**: The 3-Clause BSD License
**Documentation**: https://annoviko.github.io/robotframework-httpctrl/
Dependencies
============
**Python version**: >=3.8
Installation
============
Installation using pip3 tool:
.. code:: bash
$ pip3 install robotframework-httpctrl
Brief Overview of the Library Content
=====================================
**HttpCtrl** contains following general libraries:
- **HttpCtrl.Client** - provides API to work with HTTP/HTTPS client [`link client documentation`_].
- **HttpCtrl.Server** - provides API to work with HTTP server [`link server documentation`_].
- **HttpCtrl.Json** - provides API to work Json messages [`link json documentation`_].
- **HttpCtrl.Logging** - provides API to configure the logging system that is used by `HttpCtrl` library [`link logging documentation`_].
.. _link client documentation: https://annoviko.github.io/robotframework-httpctrl/client.html
.. _link server documentation: https://annoviko.github.io/robotframework-httpctrl/server.html
.. _link json documentation: https://annoviko.github.io/robotframework-httpctrl/json.html
.. _link logging documentation: https://annoviko.github.io/robotframework-httpctrl/logging.html
Examples
========
Send GET request to obtain origin IP address and check that is not empty:
.. code:: robotframework
*** Settings ***
Library HttpCtrl.Client
Library HttpCtrl.Json
*** Test Cases ***
Get Origin Address
Initialize Client www.httpbin.org
Send HTTP Request GET /ip
${response status}= Get Response Status
${response body}= Get Response Body
${response body}= Decode Bytes To String ${response body} UTF-8
${expected status}= Convert To Integer 200
Should Be Equal ${response status} ${expected status}
${origin}= Get Json Value From String ${response body} origin
Should Not Be Empty ${origin}
In this example HTTP client sends POST request to HTTP server. HTTP server receives it and checks incoming
request for correctness.
.. code:: robotframework
*** Settings ***
Library String
Library HttpCtrl.Client
Library HttpCtrl.Server
Test Setup Initialize HTTP Client And Server
Test Teardown Terminate HTTP Server
*** Test Cases ***
Receive And Reply To POST
${request body}= Set Variable { "message": "Hello!" }
Send HTTP Request Async POST /post ${request body}
Wait For Request
Reply By 200
${method}= Get Request Method
${url}= Get Request Url
${body}= Get Request Body
${body}= Decode Bytes To String ${body} UTF-8
Should Be Equal ${method} POST
Should Be Equal ${url} /post
Should Be Equal ${body} ${request body}
*** Keywords ***
Initialize HTTP Client And Server
Initialize Client 127.0.0.1 8000
Start Server 127.0.0.1 8000
Terminate HTTP Server
Stop Server
Raw data
{
"_id": null,
"home_page": "https://github.com/annoviko/robotframework-httpctrl",
"name": "robotframework-httpctrl",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "httpctrl http https robotframework client server json test testing",
"author": "Andrei Novikov",
"author_email": "spb.andr@yandex.ru",
"download_url": "https://files.pythonhosted.org/packages/13/47/228d969fec339ca5386dbb68e872039374c6fec60e8dfb74998d2a208942/robotframework-httpctrl-0.3.1.tar.gz",
"platform": "any",
"description": "HttpCtrl library for Robot Framework\n====================================\n\n**RobotFramework-HttpCtrl** is a library for Robot Framework that provides HTTP/HTTPS client and HTTP (IPv4 and IPv6) server services\nto make REST API testing easy.\n\n**License**: The 3-Clause BSD License\n\n**Documentation**: https://annoviko.github.io/robotframework-httpctrl/\n\n\nDependencies\n============\n\n**Python version**: >=3.8\n\n\nInstallation\n============\n\nInstallation using pip3 tool:\n\n.. code:: bash\n\n $ pip3 install robotframework-httpctrl\n\n\nBrief Overview of the Library Content\n=====================================\n\n**HttpCtrl** contains following general libraries:\n\n- **HttpCtrl.Client** - provides API to work with HTTP/HTTPS client [`link client documentation`_].\n\n- **HttpCtrl.Server** - provides API to work with HTTP server [`link server documentation`_].\n\n- **HttpCtrl.Json** - provides API to work Json messages [`link json documentation`_].\n\n- **HttpCtrl.Logging** - provides API to configure the logging system that is used by `HttpCtrl` library [`link logging documentation`_].\n\n.. _link client documentation: https://annoviko.github.io/robotframework-httpctrl/client.html\n.. _link server documentation: https://annoviko.github.io/robotframework-httpctrl/server.html\n.. _link json documentation: https://annoviko.github.io/robotframework-httpctrl/json.html\n.. _link logging documentation: https://annoviko.github.io/robotframework-httpctrl/logging.html\n\n\nExamples\n========\n\nSend GET request to obtain origin IP address and check that is not empty:\n\n.. code:: robotframework\n\n *** Settings ***\n\n Library HttpCtrl.Client\n Library HttpCtrl.Json\n\n *** Test Cases ***\n\n Get Origin Address\n Initialize Client www.httpbin.org\n Send HTTP Request GET /ip\n\n ${response status}= Get Response Status\n ${response body}= Get Response Body\n ${response body}= Decode Bytes To String ${response body} UTF-8\n\n ${expected status}= Convert To Integer 200\n Should Be Equal ${response status} ${expected status}\n\n ${origin}= Get Json Value From String ${response body} origin\n Should Not Be Empty ${origin}\n\n\nIn this example HTTP client sends POST request to HTTP server. HTTP server receives it and checks incoming\nrequest for correctness.\n\n.. code:: robotframework\n\n *** Settings ***\n\n Library String\n Library HttpCtrl.Client\n Library HttpCtrl.Server\n\n Test Setup Initialize HTTP Client And Server\n Test Teardown Terminate HTTP Server\n\n *** Test Cases ***\n\n Receive And Reply To POST\n ${request body}= Set Variable { \"message\": \"Hello!\" }\n Send HTTP Request Async POST /post ${request body}\n\n Wait For Request\n Reply By 200\n\n ${method}= Get Request Method\n ${url}= Get Request Url\n ${body}= Get Request Body\n ${body}= Decode Bytes To String ${body} UTF-8\n\n Should Be Equal ${method} POST\n Should Be Equal ${url} /post\n Should Be Equal ${body} ${request body}\n\n *** Keywords ***\n\n Initialize HTTP Client And Server\n Initialize Client 127.0.0.1 8000\n Start Server 127.0.0.1 8000\n\n Terminate HTTP Server\n Stop Server\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "robotframework-httpctrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services",
"version": "0.3.1",
"split_keywords": [
"httpctrl",
"http",
"https",
"robotframework",
"client",
"server",
"json",
"test",
"testing"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "7455ae98504fd9c83a6de4e7f4e8b8f5",
"sha256": "12aea9007bfd906ba457d89b895476daba1be35a59b68d12271f95504a6a2679"
},
"downloads": -1,
"filename": "robotframework-httpctrl-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "7455ae98504fd9c83a6de4e7f4e8b8f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 19415,
"upload_time": "2022-12-03T12:56:48",
"upload_time_iso_8601": "2022-12-03T12:56:48.844760Z",
"url": "https://files.pythonhosted.org/packages/13/47/228d969fec339ca5386dbb68e872039374c6fec60e8dfb74998d2a208942/robotframework-httpctrl-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-03 12:56:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "annoviko",
"github_project": "robotframework-httpctrl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "robotframework-httpctrl"
}