Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tm4j-reporter-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tm4j-reporter-api

python package providing functionality for Jira Test Management (tm4j) Cloud through REST API calls

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

Project summary

Package providing TM4J Cloud REST API for test automation integration.

Install

How to build

python setup.py sdist

How to install

# PyPi
pip install tm4j-reporter-api
# Git
pip install git+https://github.com/Klika-Tech/tm4j_reporter_api.git

Configure

In order to use TM4J Cloud REST API, you need to configure TM4J reporter with tm4j_api.configure_tm4j_api function first:

from tm4j_reporter_api import tm4j_api


def my_test_run_setup(my_access_key, my_project_key):

    tm4j_api.configure_tm4j_api(
        api_access_key=my_access_key,
        project_key=my_project_key
    )
ParamMandatoryDescriptionTypeExample
api_access_keyYesAPI key to access TM4j. To get it see Instructionstr
project_keyYesJira / TM4J project prefix without trailing dashstrQT

Usage

Test cycle

You need TM4J test cycle where to submit test execution results. You could create new TM4J test cycle in your test run setup in order to use its key for test execution results submitting with tm4_api.create_test_cycle function:

from tm4j_reporter_api import tm4j_api


def my_test_run_setup():

    tm4j_test_cycle_key = tm4j_api.create_test_cycle(
        test_cycle_name="My TM4J test cycle"    
    )

    return tm4j_test_cycle_key
ParamMandatoryDescriptionTypeExample
test_cycle_nameYesName of your test cyclestrMy TM4J test cycle
descriptionNoDescription of the test cycle outlining the scopestrSome feature test run
planned_start_dateNoPlanned start date of the test cycle. Format: yyyy-MM-dd'T'HH:mm:ss'Z'str2020-07-15'T'12:00:00'Z'
planned_end_dateNoPlanned end date for the test cycle. Format: yyyy-MM-dd'T'HH:mm:ss'Z'str2020-07-15'T'12:30:00'Z'
jira_project_versionNoID of the version from Jiraint1000
status_nameNoName of a status configured for the projectstrDone
folder_idNoID of a folder to place the test cycle withinint10001
owner_idNoAtlassian Account ID of the owner of the test cyclestr377441B7-835D-4B08-B7F4-219E9E62C015

Test execution results

With TM4J test cycle key you can now submit test execution result. You also could use test cycle key of already existing TM4J test cycle if you want. Pass test cycle key and test execution results to tm4j_api.create_test_execution_result function:

from tm4j_reporter_api import tm4j_api

def my_test_teardown(tm4_test_cycle_key, tm4j_test_case_key, execution_status):

    tm4j_api.create_test_execution_result(
        test_cycle_key=tm4_test_cycle_key,
        test_case_key=tm4j_test_case_key,
        execution_status=execution_status    
    )
ParamMandatoryDescriptionTypeExample
test_cycle_keyYesKey of TM4J test cycle to put test execution tostrTIS
test_case_keyYesKey of test case the execution applies tostrSA-T10
execution_statusYesName of the Test Execution StatusstrPass
test_script_resultsNoList of objects with test steps results: statusName (str), actualEndDate (str, yyyy-MM-dd'T'HH:mm:ss'Z'), actualResult (str). Number of objects should match to steps number in TM4J test script.list[{"statusName": "Pass", "actualEndDate": "2020-07-15'T'12:30:00'Z'", "actualResult": "This step passed"}, {"statusName": "Fail", "actualEndDate": "2020-07-15'T'12:30:10'Z'", "actualResult": "This step failed"}]
actual_end_dateNoDate test was executed. Format: yyyy-MM-dd'T'HH:mm:ss'Z'str2020-07-15'T'12:30:00'Z'
environment_nameNoEnvironment assigned to the test casestrStaging
execution_timeNoActual execution time in millisecondsint121000
executed_by_idNoAtlassian Account ID of the user who executes the teststr377441B7-835D-4B08-B7F4-219E9E62C015
assigned_to_idNoAtlassian Account ID of the user assigned to the teststr377441B7-835D-4B08-B7F4-219E9E62C015
commentNoComment against the overall test executionstrTest failed on step 2, check with Dev team

Exceptions

TM4JConfigurationException

Raised by tm4j_api.configure_tm4j_api and tm4j_api.create_test_execution_result functions if tm4j_api.configure_tm4j_api function was not called before:

tm4j_reporter_api.tm4j_exceptions.tm4j_configuration_exceptions.TM4JConfigurationException: You must configure TM4J reporter API before calling TM4J, call tm4j_api.configure_tm4j_api method first

TM4JResponseException

Raised by tm4j_api.configure_tm4j_api and tm4j_api.create_test_execution_result functions if TM4J Cloud responded with response status code different from 201 Created:

tm4j_reporter_api.tm4j_exceptions.tm4j_response_exceptions.TM4JResponseException: Response status code: 400, response message: Bad Request

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc