[](https://pypi.com/project/robotframework-webservice/) [](https://pypi.python.org/pypi/robotframework-webservice/) [](https://pypi.python.org/pypi/robotframework-webservice/)
# Robot Task Webservice
A web service managing Robot Framework tasks.
# Goal
This web service shall start Robot Framework tasks and return and cache the according reports.
# Installation and Execution
*Default docker image does not support variable files, yet*
## Docker
```
docker pull ghcr.io/marketsquare/robotframework-webservice:master
```
After that you can run the image and map your test cases in to the webservice with a volumen:
```
docker run -v <host directory of test cases>:/robot/tests --env SUITE_FOLDER=tests rf-webservice:latest
```
## Podman
Almost as Docker, but you might need to attach the webservice to the host network:
```
podman run --network host -v ./tasks:/robot/tasks --env SUITE_FOLDER=tasks rf-webservice:latest
```
## Local
```
pip install robotframework-webservice
```
and execute from command line:
```
python -m RobotFrameworkService.main -p 5003 -t path_to_my_taskfolder
```
# Usage
There are 2 types of endpoints:
1. Execution
2. Reporting
## Execution
Endpoints that trigger execution of a robot task, for instance:
Call robot task:
http://localhost:5003/robotframework/run/mytask
Call robot task with variables:
http://localhost:5003/robotframework/run/mytask?myVariable1=42&anotherVariable=Mustermann
Response contains a header field `x-request-id` that can be used to retrieve logs and reports of this execution asynchronously (see reporting endpoints)
There are endpoints for synchronous and asynchronous request:
```
# connection remains open for duration of my task
http://localhost:5003/robotframework/run/mytask
# connection closes immediately - result must be requested with the x-request-id
http://localhost:5003/robotframework/run/mytask/async
```
**There is no limitation on executed Robot processes! It is easy to push the webservice in DOS with too many requests at once**
## Reporting
Endpoints that provide `log.html` and `report.html` for a specific task execution. You require the `x-request-id` from a previous response that triggered the execution.
# Start web service
The web service starts automatically with uvicorn inside. Simply call:
python -m RobotFrameworkService.main
You can check available options with
python -m RobotFrameworkService.main --help
## Example:
python -m RobotFrameworkService.main -p 5003 -t path_to_my_taskfolder
## Example - Variablefiles:
You can provide variable files that are passed to all robot suites on execution:
python -m RobotFrameworkService.main -p 5003 -t path_to_my_taskfolder --variablefiles config/env/test.py
# Custom WSGI server
You can start RobotFrameworkService with bare WSGI servers:
uvicorn RobotFrameworkService.main:app --port 5003
Or start web service with other WSGI server, i.e waitress:
waitress-serve --port 5003 RotbotFrameworkService.main:app
# SwaggerUi
Swagger-UI is available under `http://localhost:5003/docs`
# Demo-Tasks
This project contains some tasks for demonstration. They are located in ``tasks`` folder. You may add
your own task suites in that directory, if you like.
# Task name with spaces in URL
Tasks may contain spaces, URL must not. Luckily, Robot Framework supports CamelCase as well as snake_case syntax.
Meaning: "Another Task" can be trigger in url with parameter `AnotherTask` or ``another_task``
Raw data
{
"_id": null,
"home_page": "https://github.com/MarketSquare/robotframework-webservice",
"name": "robotframework-webservice",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Markus Stahl",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/d4/48/2d42244038b9d1a47ce3df0b1104c8102fc76907997324595db4b3ed8cb4/robotframework-webservice-0.10.0.tar.gz",
"platform": null,
"description": "[](https://pypi.com/project/robotframework-webservice/) [](https://pypi.python.org/pypi/robotframework-webservice/) [](https://pypi.python.org/pypi/robotframework-webservice/) \n\n# Robot Task Webservice\n\nA web service managing Robot Framework tasks.\n\n# Goal\n\nThis web service shall start Robot Framework tasks and return and cache the according reports.\n\n# Installation and Execution\n*Default docker image does not support variable files, yet*\n\n## Docker\n```\ndocker pull ghcr.io/marketsquare/robotframework-webservice:master\n```\nAfter that you can run the image and map your test cases in to the webservice with a volumen:\n```\ndocker run -v <host directory of test cases>:/robot/tests --env SUITE_FOLDER=tests rf-webservice:latest\n```\n\n## Podman\nAlmost as Docker, but you might need to attach the webservice to the host network:\n```\npodman run --network host -v ./tasks:/robot/tasks --env SUITE_FOLDER=tasks rf-webservice:latest\n```\n\n## Local\n```\npip install robotframework-webservice\n```\n\nand execute from command line:\n\n```\npython -m RobotFrameworkService.main -p 5003 -t path_to_my_taskfolder\n```\n\n# Usage\nThere are 2 types of endpoints: \n1. Execution\n2. Reporting\n\n## Execution\nEndpoints that trigger execution of a robot task, for instance:\n\nCall robot task:\n\n http://localhost:5003/robotframework/run/mytask\n\nCall robot task with variables:\n\n http://localhost:5003/robotframework/run/mytask?myVariable1=42&anotherVariable=Mustermann\n\nResponse contains a header field `x-request-id` that can be used to retrieve logs and reports of this execution asynchronously (see reporting endpoints)\n\nThere are endpoints for synchronous and asynchronous request:\n\n```\n# connection remains open for duration of my task\nhttp://localhost:5003/robotframework/run/mytask\n\n# connection closes immediately - result must be requested with the x-request-id\nhttp://localhost:5003/robotframework/run/mytask/async\n```\n\n**There is no limitation on executed Robot processes! It is easy to push the webservice in DOS with too many requests at once**\n\n## Reporting\nEndpoints that provide `log.html` and `report.html` for a specific task execution. You require the `x-request-id` from a previous response that triggered the execution.\n\n\n# Start web service\n\nThe web service starts automatically with uvicorn inside. Simply call:\n\n python -m RobotFrameworkService.main\n\nYou can check available options with\n\n python -m RobotFrameworkService.main --help\n\n## Example:\n\n python -m RobotFrameworkService.main -p 5003 -t path_to_my_taskfolder\n\n## Example - Variablefiles:\n\nYou can provide variable files that are passed to all robot suites on execution:\n\n python -m RobotFrameworkService.main -p 5003 -t path_to_my_taskfolder --variablefiles config/env/test.py\n\n# Custom WSGI server\n\nYou can start RobotFrameworkService with bare WSGI servers:\n \n uvicorn RobotFrameworkService.main:app --port 5003\n\nOr start web service with other WSGI server, i.e waitress:\n\n waitress-serve --port 5003 RotbotFrameworkService.main:app\n\n# SwaggerUi\nSwagger-UI is available under `http://localhost:5003/docs`\n\n\n# Demo-Tasks\n\nThis project contains some tasks for demonstration. They are located in ``tasks`` folder. You may add\nyour own task suites in that directory, if you like.\n\n# Task name with spaces in URL\n\nTasks may contain spaces, URL must not. Luckily, Robot Framework supports CamelCase as well as snake_case syntax.\nMeaning: \"Another Task\" can be trigger in url with parameter `AnotherTask` or ``another_task``\n",
"bugtrack_url": null,
"license": "",
"summary": "Webservice for running Robot Framework tasks",
"version": "0.10.0",
"project_urls": {
"Homepage": "https://github.com/MarketSquare/robotframework-webservice"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3e8b652b49dbb30c9a9c685ddc42346bd399a87b457a2c2200740f02cf108d1",
"md5": "677ad9ce40c9d41960adf5853b0323c5",
"sha256": "9229631dbabf5e343b728ff0583a9e810c3a9dc0ce857907a8980c90de12e20f"
},
"downloads": -1,
"filename": "robotframework_webservice-0.10.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "677ad9ce40c9d41960adf5853b0323c5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11706,
"upload_time": "2023-11-09T10:07:47",
"upload_time_iso_8601": "2023-11-09T10:07:47.688308Z",
"url": "https://files.pythonhosted.org/packages/b3/e8/b652b49dbb30c9a9c685ddc42346bd399a87b457a2c2200740f02cf108d1/robotframework_webservice-0.10.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d4482d42244038b9d1a47ce3df0b1104c8102fc76907997324595db4b3ed8cb4",
"md5": "c1e153efbdf182b6bb855b75ae23644b",
"sha256": "e7c553e2b720440c85cb315a3a85d37697a659c55b5596de971668cc4131e390"
},
"downloads": -1,
"filename": "robotframework-webservice-0.10.0.tar.gz",
"has_sig": false,
"md5_digest": "c1e153efbdf182b6bb855b75ae23644b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12396,
"upload_time": "2023-11-09T10:07:48",
"upload_time_iso_8601": "2023-11-09T10:07:48.744387Z",
"url": "https://files.pythonhosted.org/packages/d4/48/2d42244038b9d1a47ce3df0b1104c8102fc76907997324595db4b3ed8cb4/robotframework-webservice-0.10.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-09 10:07:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MarketSquare",
"github_project": "robotframework-webservice",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "robotframework-webservice"
}