Generate data-driven Robot Framework testcases using Jinja templates
Project description
JingeR: Jinja generator for Robot Framework
Generate data-driven Robot Framework testcases using Jinja templates.
Use Cases
- Generate tests for a REST API
- Static test generation (as opposed to dynamic test generation using the Listener interface)
How to use it
- Install the package
pip install robotframework-jinger
- Save the default template to the current directory
jinger init
Hint: In case your environment does not allow executing jinger, call the Python module directly:
python -m JingeR init
- Modify the template and the testdata
Notes
- Each RF variable in the template that should be replaced by its value must be named according to the following pattern:
${T_foo}
. - The template file is a valid .robot file in order to allow testing the template test case without having to first run Jinja to process the file.
- Generate a Robot Framework testsuite
jinger run testcase.jinja.robot testdata.py testcase.robot
Note: For debugging purposes the variables that were replaced in the template can be printed as comments in the generated .robot file by passing the option --debug
to jinger run
.
How it works
- The .robot template file is converted to a Jinja template. This involves uncommenting the Jinja for-loop and replacing all RF variables of the form
${T_var}
with{{var}}
. - Jinja processes the template.
- The resulting list of testcases is written to the .robot file passed as last argument to
jinger run
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robotframework_jinger-1.0.1.tar.gz
.
File metadata
- Download URL: robotframework_jinger-1.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3df687ba65b2e74c08a763181d3f23576108290948f7748fa78518b64ba6215b |
|
MD5 | 76bcfc7d79458755cfe8c87bbe017065 |
|
BLAKE2b-256 | 2ef2887b78eac9d4ad52bd067a915d979ff638a5cbadee9aeb8ebfb32d2447cc |
File details
Details for the file robotframework_jinger-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: robotframework_jinger-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0aa6d5258617e11ee3ddbe620fc8b7902d5cda5176ec5a5e7f6854dbe444a3d |
|
MD5 | c75f7ee85cb446dd3fd117b4a2fcae9f |
|
BLAKE2b-256 | e5aa69798feaefd0ef72235b1b9c6b790ec0a5946049c0de74c50221fd3627fe |