Skip to main content

TestRail Api Python Client

Project description

testrail-api-client

testrail-api-client - is a client for provide integration with TestRail

General information about TestRail Api

Requirements

  • requests
  • pytest
  • gherkin-official
  • pytest-bdd

Installation

pip install pytest-testrail-api-client

Configuration Starting from version 0.3 you can configure testrail client credentials with 3 way:

Way 1. Directly set credentials in class constructor

from pytest_testrail_api_client.test_rail import TestRail
test_rail = TestRail('your_host', 'your_username', 'your_token')

Way 2. Set credentials in pytest.ini or in test_rail.ini This files must be in root folder project path Add group [pytest] Add variables:

  • testrail-email
  • testrail-key
  • testrail-url

Example pytest.ini or test_rail.ini

[saucelab]
testrail-email = your_email
testrail-key = your_token
testrail-url = your_host

When you add credentials to ini file:

from pytest_testrail_api_client.test_rail import TestRail
test_rail = TestRail()

Way 3. You can set environment variables:

  • TESTRAIL_EMAIL
  • TESTRAIL_KEY
  • TESTRAIL_URL

When you add credentials to environment variables:

from pytest_testrail_api_client.test_rail import TestRail
test_rail = TestRail()

Features in version: 0.3.1

  • Access to TestRail Api
  • Export feature files to TestRail (use pytest --pytest_testrail_export_test_cases --pytest-testrail-feature-files-relative-path "%RELATIVE_PATH%")
  • Export tests results to TestRail (use pytest --pytest-testrail-export-test-results --pytest-testrail-test-plan-id %PLAN_ID% --pytest-testrail-test-configuration-name %CONFIGURATION%)
  • Scenarios validation (please, see pytest_testrail_api_client/client_config.py)
  • Tags replacing (for example: you have automation status "To Be Automated" and you use tag "to_automate" if feactures you can set it in variable REPLACE_TAGS - it will bind these tags)
  • Priority replace: variable PRIORITY_REPLACE

Usage examples

from pytest_testrail_api_client.test_rail import TestRail
test_rail = TestRail()
case = test_rail.cases.get_case(1)

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

pytest-testrail-api-client-0.3.6.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

pytest_testrail_api_client-0.3.6-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest-testrail-api-client-0.3.6.tar.gz.

File metadata

  • Download URL: pytest-testrail-api-client-0.3.6.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for pytest-testrail-api-client-0.3.6.tar.gz
Algorithm Hash digest
SHA256 6974728d1af2063adbee961cc2f495594724987c888719d4e013a491010aaa55
MD5 91e2474197eb8ff8fdd4895b3e52b5cf
BLAKE2b-256 ba949c6d2df6489533fddd516d3bcf7150984cb229310c8e0949f21fd8136cc9

See more details on using hashes here.

File details

Details for the file pytest_testrail_api_client-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: pytest_testrail_api_client-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for pytest_testrail_api_client-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f598287c00f407f99745bb73fb45e1c24afeb8a302a490aa11246c7d43b5c652
MD5 063443f8fa70824256345f4d214e4b13
BLAKE2b-256 e8fd1201e7cdb4bea4107af701708b2e35ab597cd7c7fc9fbe304d632088894b

See more details on using hashes here.

Supported by

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