spira-robot-framework


Namespira-robot-framework JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttp://www.inflectra.com/SpiraTest/Integrations/Unit-Test-Frameworks.aspx
SummaryExports Robot Framework test executions as test runs in Spira (SpiraTest/Team/Plan)
upload_time2024-01-01 18:03:31
maintainer
docs_urlNone
authorInflectra Corporation
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Robot Framework Integration for Spira
This repository contains the source code for the integration between Robot Framework and the Inflectra Spira platform. This plugin lets you execute Robot Framework test suites, and have the results automatically transmitted back to Spira. It can be run locally or as part of a CI/CD pipeline.

## About Robot Framework
[Robot Framework](https://robotframework.org/) is a generic open source automation framework. It can be used for test automation and robotic process automation (RPA).

Robot Framework is supported by Robot Framework Foundation. Many industry-leading companies use the tool in their software development.


## About Spira
Spira is the end-to-end platform from [Inflectra](https://www.inflectra.com) for product creation, from idea to release. Whether you are building software yourself, or deploying third-party systems, Spira is the integrated hub into which you can plug in specialized tools for the rest of the software development lifecycle. 

Spira comes in three flavors:
- [SpiraTest](https://www.inflectra.com/SpiraTest/), powerful requirements and test management
- [SpiraTeam](https://www.inflectra.com/SpiraTeam/), agile planning and test management for teams
- [SpiraPlan](https://www.inflectra.com/SpiraPlan/), enterprise planning and testing platform

## Installing the Integration
This section outlines how to install the Spira plugin for Robot Framework. It assumes that you already have a working installation of Spira v6.0 or later. If you have an earlier version of Spira you will need to upgrade to at least v6.0 before trying to use this plugin. You will also need to have Python (with pip) and Robot Framework installed.

To obtain the latest version of the plugin, simply run the following command:

`pip install spira-robot-framework`

This command will install the latest version of the plugin straight from the Python Package Index (PyPI). Once the Spira plugin is successfully installed, all you need to do is configure the plugin, annotate your Robot Framework test cases with Spira-specific tags, then you can begin testing!

## Using the Integration
The integration consists of a Python module called `robot_spira_integration.py` that is executed after your Robot Framework tests are executed. This module will read the resulsts of the Robot Framework `output.xml` report file and send the results to Spira, mapping each Robot Framework test case to a matching Spira test case.

### Configuring the Spira connection
In your test root folder (the folder you have your Robot Framework tests),
create a file named `spira.cfg` with the following:

```cfg
[credentials]
# Following are required

url = https://myserver/spiraservice.net
username = fredbloggs
token = {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX}
project_id = 1

# Following are optional:
release_id = 5
test_set_id = 1
```

For the plugin to work, you must have the following in the credentials group:

- **url** -- The base url to your Spira installation, without a '/' at
the end.

- **username** -- The username you use to sign into Spira.

- **token** -- Your API Key / RSS Token. Found in your profile page as the "RSS
Token" field, you must have RSS Feeds enabled for this to work.

- **project_id** -- The ID of the project you would like the test runs to
be sent to

- **release_id** -- OPTIONAL -- Use if you would like to associate the
test run with a release.

- **test_set_id** -- OPTIONAL -- Use if you would like to associate the
test run with a test set.

### Tagging the Test Cases
Next, you need to tag each of your Robot Framework test cases with the appropriate Spira test case id (prefixed by TC:). For example, if you had this sample Robot Framework test:

```py
Simple Test Case
    [Documentation]    Shows some assertion keywords
    Should Be Title Case    Robot Framework
    Should Be Equal    Text123    Text123
    Should Be True    5 + 5 == 10
```

You can add the Spira test case ID (TC:2 for example), simply by adding it as one of the Robot Framework test case **tags**:

```py
Simple Test Case
    [Documentation]    Shows some assertion keywords
    [Tags]    TC:2
    Should Be Title Case    Robot Framework
    Should Be Equal    Text123    Text123
    Should Be True    5 + 5 == 10
```
You should then repeat this for all of the other test cases in the test suite. Note: please make sure that all of the test case IDs are inside the Spira project ID you specified earlier in the `spira.cfg` file.

### Executing the Tests
Now you are ready to execute your tests and send the results back so Spira. This happens in two steps:
- Execute the tests and generate the `output.xml` report file
- Parse the `output.xml` report file and send the results to Spira

First run your tests using the standard `robot` command. For example, if we were executing the supplied sample test `tests.robot` you would use:

`robot tests.robot`

OR

`python -m robot tests.robot`

Next, you need to run the Spira results parser module `robot_spira_integration_py` to upload the results to Spira. For example, with the sample tests you can use either:

`python robot_spira_integration.py`

OR

`python robot_spira_integration.py Output.xml spira.cfg`

The second version lets you specify the location of the output file and the Spira configuration file. It's syntax is:

`python robot_spira_integration.py <Output File> <Spira Config File>`

Once that is done, you should see something like:

```
Sending test results to Spira at URL 'https://myserver/spiraservice.net'.
Successfully reported 4 test cases to Spira.
```

If there are any errors or warnings, they will be displayed instead.

### Viewing the Results
Finally, to view the results in Spira, you can go to the **Test Runs** tab to see the list of test runs:

![List of Robot Framework test runs in Spira](images/robot-framework-test-runs.png)

If you click on one of the **passed** test runs, it will display the name of the test case from Robot Framework, together with the status (pass), the test set, release and actual duration:

![A sample passed Robot test run as it looks in Spira](images/robot-framework-passed-test-run-1.png)

If you scroll down to the **Console Output** section, it displays the full name and path of the Robot Framework test case as well as the contents of the **Documentation** attribute and any messages.

![A sample passed Robot test run as it looks in Spira](images/robot-framework-passed-test-run-2.png)

If you click on one of the **failed** test runs, it will display the name of the test case from Robot Framework, together with the status (fail), the test set, release and actual duration:

![A sample failed Robot test run as it looks in Spira](images/robot-framework-failed-test-run-1.png)

If you scroll down to the **Console Output** section, it displays the full name and path of the Robot Framework test case as well as the contents of the **Documentation** attribute and in this case, the details of what caused the test to fail:

![A sample failed Robot test run as it looks in Spira](images/robot-framework-failed-test-run-2.png)

Congratulations, you have now executed your Robot Framework tests and integrated the reporting with Spira.

## Have Questions or Need Assistance?
If you are an Inflectra customer, please contact our customer support at:
- Email: support@inflectra.com
- Help Desk: https://www.inflectra.com/Support/

Otherwise, please feel free to post a question on our public forums:
- [Test Case Integration Forum](https://www.inflectra.com/Support/Forum/integrations/unit-testing/List.aspx)

            

Raw data

            {
    "_id": null,
    "home_page": "http://www.inflectra.com/SpiraTest/Integrations/Unit-Test-Frameworks.aspx",
    "name": "spira-robot-framework",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Inflectra Corporation",
    "author_email": "support@inflectra.com",
    "download_url": "https://files.pythonhosted.org/packages/7f/55/7b5b9b0860ced0969b1e2e0b2bec593eef78fa666ecc85328ca93e75145a/spira-robot-framework-1.0.0.tar.gz",
    "platform": null,
    "description": "# Robot Framework Integration for Spira\r\nThis repository contains the source code for the integration between Robot Framework and the Inflectra Spira platform. This plugin lets you execute Robot Framework test suites, and have the results automatically transmitted back to Spira. It can be run locally or as part of a CI/CD pipeline.\r\n\r\n## About Robot Framework\r\n[Robot Framework](https://robotframework.org/) is a generic open source automation framework. It can be used for test automation and robotic process automation (RPA).\r\n\r\nRobot Framework is supported by Robot Framework Foundation. Many industry-leading companies use the tool in their software development.\r\n\r\n\r\n## About Spira\r\nSpira is the end-to-end platform from [Inflectra](https://www.inflectra.com) for product creation, from idea to release. Whether you are building software yourself, or deploying third-party systems, Spira is the integrated hub into which you can plug in specialized tools for the rest of the software development lifecycle. \r\n\r\nSpira comes in three flavors:\r\n- [SpiraTest](https://www.inflectra.com/SpiraTest/), powerful requirements and test management\r\n- [SpiraTeam](https://www.inflectra.com/SpiraTeam/), agile planning and test management for teams\r\n- [SpiraPlan](https://www.inflectra.com/SpiraPlan/), enterprise planning and testing platform\r\n\r\n## Installing the Integration\r\nThis section outlines how to install the Spira plugin for Robot Framework. It assumes that you already have a working installation of Spira v6.0 or later. If you have an earlier version of Spira you will need to upgrade to at least v6.0 before trying to use this plugin. You will also need to have Python (with pip) and Robot Framework installed.\r\n\r\nTo obtain the latest version of the plugin, simply run the following command:\r\n\r\n`pip install spira-robot-framework`\r\n\r\nThis command will install the latest version of the plugin straight from the Python Package Index (PyPI). Once the Spira plugin is successfully installed, all you need to do is configure the plugin, annotate your Robot Framework test cases with Spira-specific tags, then you can begin testing!\r\n\r\n## Using the Integration\r\nThe integration consists of a Python module called `robot_spira_integration.py` that is executed after your Robot Framework tests are executed. This module will read the resulsts of the Robot Framework `output.xml` report file and send the results to Spira, mapping each Robot Framework test case to a matching Spira test case.\r\n\r\n### Configuring the Spira connection\r\nIn your test root folder (the folder you have your Robot Framework tests),\r\ncreate a file named `spira.cfg` with the following:\r\n\r\n```cfg\r\n[credentials]\r\n# Following are required\r\n\r\nurl = https://myserver/spiraservice.net\r\nusername = fredbloggs\r\ntoken = {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX}\r\nproject_id = 1\r\n\r\n# Following are optional:\r\nrelease_id = 5\r\ntest_set_id = 1\r\n```\r\n\r\nFor the plugin to work, you must have the following in the credentials group:\r\n\r\n- **url** -- The base url to your Spira installation, without a '/' at\r\nthe end.\r\n\r\n- **username** -- The username you use to sign into Spira.\r\n\r\n- **token** -- Your API Key / RSS Token. Found in your profile page as the \"RSS\r\nToken\" field, you must have RSS Feeds enabled for this to work.\r\n\r\n- **project_id** -- The ID of the project you would like the test runs to\r\nbe sent to\r\n\r\n- **release_id** -- OPTIONAL -- Use if you would like to associate the\r\ntest run with a release.\r\n\r\n- **test_set_id** -- OPTIONAL -- Use if you would like to associate the\r\ntest run with a test set.\r\n\r\n### Tagging the Test Cases\r\nNext, you need to tag each of your Robot Framework test cases with the appropriate Spira test case id (prefixed by TC:). For example, if you had this sample Robot Framework test:\r\n\r\n```py\r\nSimple Test Case\r\n    [Documentation]    Shows some assertion keywords\r\n    Should Be Title Case    Robot Framework\r\n    Should Be Equal    Text123    Text123\r\n    Should Be True    5 + 5 == 10\r\n```\r\n\r\nYou can add the Spira test case ID (TC:2 for example), simply by adding it as one of the Robot Framework test case **tags**:\r\n\r\n```py\r\nSimple Test Case\r\n    [Documentation]    Shows some assertion keywords\r\n    [Tags]    TC:2\r\n    Should Be Title Case    Robot Framework\r\n    Should Be Equal    Text123    Text123\r\n    Should Be True    5 + 5 == 10\r\n```\r\nYou should then repeat this for all of the other test cases in the test suite. Note: please make sure that all of the test case IDs are inside the Spira project ID you specified earlier in the `spira.cfg` file.\r\n\r\n### Executing the Tests\r\nNow you are ready to execute your tests and send the results back so Spira. This happens in two steps:\r\n- Execute the tests and generate the `output.xml` report file\r\n- Parse the `output.xml` report file and send the results to Spira\r\n\r\nFirst run your tests using the standard `robot` command. For example, if we were executing the supplied sample test `tests.robot` you would use:\r\n\r\n`robot tests.robot`\r\n\r\nOR\r\n\r\n`python -m robot tests.robot`\r\n\r\nNext, you need to run the Spira results parser module `robot_spira_integration_py` to upload the results to Spira. For example, with the sample tests you can use either:\r\n\r\n`python robot_spira_integration.py`\r\n\r\nOR\r\n\r\n`python robot_spira_integration.py Output.xml spira.cfg`\r\n\r\nThe second version lets you specify the location of the output file and the Spira configuration file. It's syntax is:\r\n\r\n`python robot_spira_integration.py <Output File> <Spira Config File>`\r\n\r\nOnce that is done, you should see something like:\r\n\r\n```\r\nSending test results to Spira at URL 'https://myserver/spiraservice.net'.\r\nSuccessfully reported 4 test cases to Spira.\r\n```\r\n\r\nIf there are any errors or warnings, they will be displayed instead.\r\n\r\n### Viewing the Results\r\nFinally, to view the results in Spira, you can go to the **Test Runs** tab to see the list of test runs:\r\n\r\n![List of Robot Framework test runs in Spira](images/robot-framework-test-runs.png)\r\n\r\nIf you click on one of the **passed** test runs, it will display the name of the test case from Robot Framework, together with the status (pass), the test set, release and actual duration:\r\n\r\n![A sample passed Robot test run as it looks in Spira](images/robot-framework-passed-test-run-1.png)\r\n\r\nIf you scroll down to the **Console Output** section, it displays the full name and path of the Robot Framework test case as well as the contents of the **Documentation** attribute and any messages.\r\n\r\n![A sample passed Robot test run as it looks in Spira](images/robot-framework-passed-test-run-2.png)\r\n\r\nIf you click on one of the **failed** test runs, it will display the name of the test case from Robot Framework, together with the status (fail), the test set, release and actual duration:\r\n\r\n![A sample failed Robot test run as it looks in Spira](images/robot-framework-failed-test-run-1.png)\r\n\r\nIf you scroll down to the **Console Output** section, it displays the full name and path of the Robot Framework test case as well as the contents of the **Documentation** attribute and in this case, the details of what caused the test to fail:\r\n\r\n![A sample failed Robot test run as it looks in Spira](images/robot-framework-failed-test-run-2.png)\r\n\r\nCongratulations, you have now executed your Robot Framework tests and integrated the reporting with Spira.\r\n\r\n## Have Questions or Need Assistance?\r\nIf you are an Inflectra customer, please contact our customer support at:\r\n- Email: support@inflectra.com\r\n- Help Desk: https://www.inflectra.com/Support/\r\n\r\nOtherwise, please feel free to post a question on our public forums:\r\n- [Test Case Integration Forum](https://www.inflectra.com/Support/Forum/integrations/unit-testing/List.aspx)\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Exports Robot Framework test executions as test runs in Spira (SpiraTest/Team/Plan)",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "http://www.inflectra.com/SpiraTest/Integrations/Unit-Test-Frameworks.aspx"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ceea8ad7074b00cfdfa9dae601e56628f1ef857a9aa02cebe10244e082b4f96c",
                "md5": "d4f9747d1020cc5ffd972106b65a5913",
                "sha256": "0b38992ac27a0089e737068b653931b4a9bfda49975df57e32c7827943886d72"
            },
            "downloads": -1,
            "filename": "spira_robot_framework-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4f9747d1020cc5ffd972106b65a5913",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8002,
            "upload_time": "2024-01-01T18:03:29",
            "upload_time_iso_8601": "2024-01-01T18:03:29.509126Z",
            "url": "https://files.pythonhosted.org/packages/ce/ea/8ad7074b00cfdfa9dae601e56628f1ef857a9aa02cebe10244e082b4f96c/spira_robot_framework-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f557b5b9b0860ced0969b1e2e0b2bec593eef78fa666ecc85328ca93e75145a",
                "md5": "accc45f5f67e6d943b05253860e7b5fe",
                "sha256": "d69b5ba773d52dda3e92e32552c57bd2198c7f0a13df68b12ecdf2191f023782"
            },
            "downloads": -1,
            "filename": "spira-robot-framework-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "accc45f5f67e6d943b05253860e7b5fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10879,
            "upload_time": "2024-01-01T18:03:31",
            "upload_time_iso_8601": "2024-01-01T18:03:31.339633Z",
            "url": "https://files.pythonhosted.org/packages/7f/55/7b5b9b0860ced0969b1e2e0b2bec593eef78fa666ecc85328ca93e75145a/spira-robot-framework-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 18:03:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "spira-robot-framework"
}
        
Elapsed time: 0.17485s