Skip to main content

pytest plugin for creating TestRail runs and adding results self

Project description

Build Status PyPI version

This is a pytest plugin for creating/editing testplans or testruns based on pytest markers. The results of the collected tests will be updated against the testplan/testrun in TestRail.

Installation

pip install pytest-testrail

Configuration

Config for Pytest tests

Add a marker to the tests that will be picked up to be added to the run.

from pytest_testrail.plugin import testrail

@testrail('C1234', 'C5678')
def test_foo():
    # test code goes here

# OR

from pytest_testrail.plugin import pytestrail

@pytestrail.case('C1234', 'C5678')
def test_bar():
    # test code goes here

See a more detailed example here.

Config for TestRail

  • Settings file template config:

[API]
url = https://yoururl.testrail.net/
email = user@email.com
password = <api_key>

[TESTRUN]
assignedto_id = 1
project_id = 2
suite_id = 3

Or

  • Set command line options (see below)

Usage

Basically, the following command will create a testrun in TestRail, add all marked tests to run. Once the all tests are finished they will be updated in TestRail:

py.test --testrail --tr-config=<settings file>.cfg

All available options

--testrail            Create and update testruns with TestRail
--tr-config=TR_CONFIG
                      Path to the config file containing information about
                      the TestRail server (defaults to testrail.cfg)
--tr-url=TR_URL       TestRail address you use to access TestRail with your
                      web browser (config file: url in API section)
--tr-email=TR_EMAIL   Email for the account on the TestRail server (config
                      file: email in API section)
--tr-password=TR_PASSWORD
                      Password for the account on the TestRail server
                      (config file: password in API section)
--tr-testrun-assignedto-id=TR_TESTRUN_ASSIGNEDTO_ID
                      ID of the user assigned to the test run (config file:
                      assignedto_id in TESTRUN section)
--tr-testrun-project-id=TR_TESTRUN_PROJECT_ID
                      ID of the project the test run is in (config file:
                      project_id in TESTRUN section)
--tr-testrun-suite-id=TR_TESTRUN_SUITE_ID
                      ID of the test suite containing the test cases (config
                      file: suite_id in TESTRUN section)
--tr-testrun-suite-include-all
                      Include all test cases in specified test suite when
                      creating test run (config file: include_all in TESTRUN
                      section)
--tr-testrun-name=TR_TESTRUN_NAME
                      Name given to testrun, that appears in TestRail
                      (config file: name in TESTRUN section)
--tr-run-id=TR_RUN_ID
                      Identifier of testrun, that appears in TestRail. If
                      provided, option "--tr-testrun-name" will be ignored
--tr-plan-id=TR_PLAN_ID
                      Identifier of testplan, that appears in TestRail. If
                      provided, option "--tr-testrun-name" will be ignored
--tr-version=TR_VERSION
                      Indicate a version in Test Case result.
--tr-no-ssl-cert-check
                      Do not check for valid SSL certificate on TestRail
                      host
--tr-close-on-complete
                      Close a test plan or test run on completion.
--tr-dont-publish-blocked
                      Do not publish results of "blocked" testcases in
                      TestRail
--tr-skip-missing     Skip test cases that are not present in testrun

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

fd_test_rail-1.0.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fd_test_rail-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file fd_test_rail-1.0.0.tar.gz.

File metadata

  • Download URL: fd_test_rail-1.0.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for fd_test_rail-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1f87088a93afdabb5e570a6d7b1cb4bb83fd362f99e0e129aff8d801fca1f3c4
MD5 24349fb151626deebae6a14d38d5fd19
BLAKE2b-256 7022febd0f3b7c157887ed0d744d3e08b2b4a18a449f9a3e6455f92a66cb7899

See more details on using hashes here.

File details

Details for the file fd_test_rail-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fd_test_rail-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for fd_test_rail-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c04232b9bf0310a48a1e7294f41fdfe7d6f361bdac11e9afb6da2ec7c022f83
MD5 69e45e52b300f5b38fd3ce51fbeb10a9
BLAKE2b-256 c3ec811e1fbbb398c14cb64dc78ca80ee033f86e782d4ea2060c66255f3f2c69

See more details on using hashes here.

Supported by

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