Skip to main content

Python script for converting a Robot Framework file to a reStructuredText (.rst) file

Project description

Build status Documentation Contributions welcome

Documentation robot2rst

This script can convert your .robot files from Robot Framework to reStructuredText (.rst) files with traceable items.

Goal

This script allows you to connect your requirements to test cases via the mlx.traceability Sphinx extension. Test cases get converted to traceable items. The documentation of each test gets used to generate the body of the item. Test case names get converted to item IDs with a configurable prefix. Tags can be used to link to other traceable items.

Usage

robot2rst -i example.robot -o test_plan.rst --prefix ITEST_MY_LIB- --tags SWRQT- SYSRQT- --relationships validates ext_toolname

$ robot2rst --help

usage: robot2rst [-h] -i ROBOT_FILE -o RST_FILE [-p PREFIX]
                 [-r [RELATIONSHIPS [RELATIONSHIPS ...]]]
                 [-t [TAGS [TAGS ...]]] [--trim-suffix]

Convert robot test cases to reStructuredText with traceable items.

optional arguments:
  -h, --help            show this help message and exit
  -i ROBOT_FILE, --robot ROBOT_FILE
                        Input robot file
  -o RST_FILE, --rst RST_FILE
                        Output RST file
  -p PREFIX, --prefix PREFIX
                        Overrides the default 'ITEST-' prefix.
  -r [RELATIONSHIPS [RELATIONSHIPS ...]], --relationships [RELATIONSHIPS [RELATIONSHIPS ...]]
                        Name(s) of the relationship(s) used to link to items
                        in Tags section. The default value is 'validates'.
  -t [TAGS [TAGS ...]], --tags [TAGS [TAGS ...]]
                        Regex(es) for matching tags to add a relationship link
                        for. All tags get matched by default.
  --trim-suffix         If the suffix of any prefix or --tags argument ends
                        with '_-' it gets trimmed to '-'.

Configuration

To include the script’s output in your documentation you want to add the aforementioned extension to your extensions list in your conf.py like so:

extensions = [
    'mlx.traceability',
]

Please read the documentation of mlx.traceability for additional configuration steps.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlx.robot2rst-2.0.1.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

mlx.robot2rst-2.0.1-py2.py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page