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 --coverage 100 66.66

$ robot2rst --help

usage: robot2rst [-h] -i ROBOT_FILE -o RST_FILE [--only EXPRESSION] [-p PREFIX]
                 [-r [RELATIONSHIPS ...]] [-t [TAGS ...]] [--include [INCLUDE ...]]
                 [-c [COVERAGE ...]] [--type TYPE] [--trim-suffix]

Convert robot test cases to reStructuredText with traceable items.

options:
  -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, e.g. my_component_qtp.rst
  --only EXPRESSION     Expression of tags for Sphinx' `only` directive that surrounds all
                        RST content. By default, no `only` directive is generated.
  -p PREFIX, --prefix PREFIX
                        Overrides the default 'QTEST-' prefix.
  -r [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 ...]
                        Zero or more Python regexes for matching tags to treat them as
                        traceable targets via a relationship. All tags get matched by
                        default.
  --include [INCLUDE ...]
                        Zero or more Python regexes for matching tags to filter test cases.
                        If every regex matches at least one of a test case's tags, the test
                        case is included.
  -c [COVERAGE ...], --coverage [COVERAGE ...]
                        Minimum coverage percentages for the item-matrix(es); 1 value per tag
                        in -t, --tags.
  --type TYPE           Give value that starts with 'q' or 'i' (case-insensitive) to
                        explicitly define the type of test: qualification/integration test.
                        The default is 'qualification'.
  --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.

If you use the --only input argument, you should also add 'sphinx_selective_exclude.eager_only' to the extensions list to prevent mlx.traceability from parsing the content and ignoring the effect of the only directive.

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-3.5.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

mlx.robot2rst-3.5.0-py2.py3-none-any.whl (12.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mlx_robot2rst-3.5.0.tar.gz.

File metadata

  • Download URL: mlx_robot2rst-3.5.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for mlx_robot2rst-3.5.0.tar.gz
Algorithm Hash digest
SHA256 acd4bc9c2b5ab8e9304d33f024ec2c6a945e95e96a5752a58cbc68ca06741722
MD5 13d41af69a249f85bbbdc0837e75d6d4
BLAKE2b-256 94dac44546c9c40f5396281a06474b977f7738cc9cfecefc7d56ebe69e29679f

See more details on using hashes here.

File details

Details for the file mlx.robot2rst-3.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mlx.robot2rst-3.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 91e5211940a90f6d337ed3ef8decf23616965dfcb673f1cc977f93e1c1f12f5f
MD5 728cfb7f5f125d2d38d13fa8b21a07b0
BLAKE2b-256 35975fd6fbe6fad65c191850ef8f210230fe940a6e3e1d65816f3b9cd8f98a04

See more details on using hashes here.

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