Skip to main content
PyPI version Python updates TP for kiwitcms/robotframework-plugin (master) Tidelift Kiwi TCMS on Twitter

This package allows you execute your Robot Framework test suite and report the results into Kiwi TCMS.

Installation

pip install kiwitcms-robotframework-plugin

Configuration and environment

Minimal config file ~/.tcms.conf:

[tcms]
url = https://tcms.server/xml-rpc/
username = your-username
password = your-password

For more info see tcms-api docs.

Each RF suite may define the following variables:

  • ${plan_id}: Existing TestPlan ID for storing test execution results. WARNING: this plugin will create a new TestRun whenever plan_id changes! If subsequent test scenarios, aka .robot files don’t override plan_id the current one will be used!

  • ${product}: Existing product name when creating a new TestPlan

  • ${build_user_email}: Email for an existing user, override with TCMS_DEFAULT_TESTER_ID!

Documentation from test suite(s) is used when creating new TestRun(s).

Each RF test case may also specify the TC-xyz tag to map to an existing TestCase in the database. For example:

*** Settings ***
Documentation   An example test suite
Library         OperatingSystem

*** Variables ***
${plan_id}      234

*** Test Cases ***
Scenario Maps To Existing TestCase
    [Tags]    TC-607  arbitrary_tag_here
    Should Be Equal    "Hello"    "Hello"

Hello World Scenario
    [Documentation]    This will be the text of the new TC created in DB
    Should Be Equal    "Hello"    "Hello"

Documentation from test cases is used when creating new TestCase records in the database.

Usage

robot --listener zealand.listener.KiwiTCMS

Extension and customization

You can customize the behavior of this plugin by extending the listener and backend classes and overriding some of their methods. For example save the following in acme_tools.py:

from zealand.listener import KiwiTCMS
from zealand.listener import RFBackend


class JenkinsBackend(RFBackend):
    def get_run_id(self):
        """
            If ${node_name} is specified then tag the TR with "node: X" tag!

            This is done right after a new TR is created!
        """
        run_id = super().get_run_id()

        node_name = self.built_in.get_variable_value('${node_name}')
        if node_name:
            self.rpc.TestRun.add_tag(run_id, 'node: %s' % node_name)
        return run_id

    def finish_test_run(self):
        """
            Do not set TR.stop_date !!!

            If ${jenkins_tag} is specified then tag the TR with it!

            This is executed at the end of each TestRun after all
            execution results have been reported.
        """
        # do not call the inherited method b/c we want to keep these
        # test runs open for inspection by a human !!!
        # super().finish_test_run()

        jenkins_tag = self.built_in.get_variable_value('${jenkins_tag}')
        if jenkins_tag:
            self.rpc.TestRun.add_tag(self.run_id, jenkins_tag)

class AcmeCorpListener(KiwiTCMS):
    backend_class = JenkinsBackend

    def end_test(self, name, attrs):
        """
            You may also find it more appropriate to override a
            listener class instead.
        """
        super().end_test(name, attrs)

        for tag in attrs['tags']:
            if tag.startswith('JIRA-'):
                # hyperlink the results between Kiwi TCMS, Jenkins & JIRA
                # by posting comments everywhere

then instruct Robot Framework to use the overriden listener instead of the default one:

robot --listener path/to/acme_tools.py

Changelog

v12.7 (10 Dec 2023)

  • Update robotframework from 5.0 to 6.1.1

  • Update tcms-api from 11.2 to 12.7

  • Relax tcms-api dependency to be >=. Closes Issue #63

  • Build and test with Python 3.11

v11.2 (15 May 2022)

  • Update robotframework from 4.1.2 to 5.0

  • Update tcms-api from 11.0 to 11.2

  • Ignore 403 errors when searching for user by email

  • Created records are annotated with plugin name and version

v11.0 (06 Dec 2021)

  • Forward compatible with upcoming Kiwi TCMS v11.0

  • Update robotframework from 3.2.2 to 4.1.2

  • Update tcms-api from 10.0 to 11.0

  • Pylint fixes

v10.0 (02 Mar 2021)

  • Compatible with Kiwi TCMS v10.0

  • Update tcms-api to 10.0

v9.0 (13 Jan 2020)

  • Compatible with Kiwi TCMS v9.0

  • Update tcms-api to 9.0

v1.1.0 (28 Oct 2020)

  • Update tcms-api to 8.6.0

  • Update robotframework to 3.2.2

v1.0.0 (04 May 2020)

  • Initial release

  • Original implementation by Aniello Barletta

Metadata

Release files for kiwitcms-robotframework-plugin 12.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kiwitcms-robotframework-plugin 12.7
File Size Uploaded
kiwitcms-robotframework-plugin-12.7.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kiwitcms-robotframework-plugin 12.7
File Interpreter ABI Platform
kiwitcms_robotframework_plugin-12.7-py3-none-any.whl Python 3 none any Details

Total release size: 38.2 kB

Release files / kiwitcms-robotframework-plugin-12.7.tar.gz

Download URL kiwitcms-robotframework-plugin-12.7.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a5d5fe32405862d80c96a14b73651353574dee3dedf213193be36004007693a4
BLAKE2b-256 checksum
How to use checksums
789898f1995701fdb3fe3219929710689209acf5995394d3789cf792f224fae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / kiwitcms_robotframework_plugin-12.7-py3-none-any.whl

Download URL kiwitcms_robotframework_plugin-12.7-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
800b125149cd36ee2770c88e59cd2f58a9e3057a9116278fb476faba82fdc1ea
BLAKE2b-256 checksum
How to use checksums
efe56f584cf9ed066f086d6cb69d62945c5a71edc40fcbd2801b27c274fe7773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

12.7 This release

2 release files

11.2

2 release files

11.0

2 release files

10.0

2 release files

9.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page