Skip to main content

ReportPortal integration client lib

Project description

Description

This library is Report Portal connector that allows you to integrate Report Portal with your Python Behave BDD testing framework

Your automation framework will run just as it does now unless you choose to run with Report Portal Integration

The library was updated to work with Report Portal API v5+ and the reportportal-client lib v5

Installation

Manual

  1. Clone the repository
  2. Enter the folder and run pip install .

Using pip and pypi.org

pip install reportportal-behave-client

NOTE: Use version >= 1.0.3 for ReportPortal v5

Sending reports to Report Portal

In order to enable the Report Portal Integration add the -D rp_enable=True:

behave -D rp_enable=True

For step based reporting you need to also add the step based flag -D step_based=True:

behave -D rp_enable=True -D step_based=True

Integrating the lib in your framework

In your environments.py file add the service in each method. For e.g.:

def before_all(context):
    tags = ', '.join([tag for tags in context.config.tags.ands for tag in tags])
    rp_enable = context.config.userdata.getbool('rp_enable', False)
    step_based = context.config.userdata.getbool('step_based', True)
    context.requested_browser = context.config.userdata.get('browser', "chrome")
    rp_token = os.environ.get("RP_TOKEN")
    add_screenshot = context.config.userdata.getbool('add_screenshot', False)
    launch_name = f"Execution using tags: {tags}"
    launch_description = f"BDD Tests for: {tags}"
    context.behave_integration_service = BehaveIntegrationService(rp_endpoint=rp_endpoint,
                                                                  rp_project=rp_project,
                                                                  rp_token=rp_token,
                                                                  rp_launch_name=launch_name,
                                                                  rp_launch_description=launch_description,
                                                                  rp_enable=rp_enable,
                                                                  step_based=step_based,
                                                                  add_screenshot=add_screenshot,
                                                                  verify_ssl=False)
    context.launch_id = context.behave_integration_service.launch_service(tags=tags)


def before_feature(context, feature):
    context.feature_id = context.behave_integration_service.before_feature(feature)


def before_scenario(context, scenario):
    context.scenario_id = context.behave_integration_service.before_scenario(scenario,
                                                                             feature_id=context.feature_id)


def before_step(context, step):
    context.step_id = context.behave_integration_service.before_step(step, scenario_id=context.scenario_id)


def after_step(context, step):
    context.behave_integration_service.after_step(step, context.step_id)


def after_scenario(context, scenario):
    context.behave_integration_service.after_scenario(scenario, context.scenario_id)


def after_feature(context, feature):
    context.behave_integration_service.after_feature(feature, context.feature_id)


def after_all(context):
    context.behave_integration_service.after_all(context.launch_id)

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

reportportal-behave-client-custom-1.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file reportportal-behave-client-custom-1.2.tar.gz.

File metadata

  • Download URL: reportportal-behave-client-custom-1.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/2.7.17

File hashes

Hashes for reportportal-behave-client-custom-1.2.tar.gz
Algorithm Hash digest
SHA256 1519841091bbb71b5c81996319a8a8c1e5ce868bf9f97a7f96b130c7cb4566f3
MD5 6a1105ad4f068a682bc84e104ba2481b
BLAKE2b-256 d836f08da1dd852663c2c4b449d9d0c8331f6eac7d7e65f05f1688e96479a39c

See more details on using hashes here.

File details

Details for the file reportportal_behave_client_custom-1.2-py3-none-any.whl.

File metadata

  • Download URL: reportportal_behave_client_custom-1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/2.7.17

File hashes

Hashes for reportportal_behave_client_custom-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7f39b2d700e37ba97a70d1fdfc00f05d08773cb12c5ad0ecc7b458dc61e950ff
MD5 0d43112cb8a92b5e5782c271b59ec111
BLAKE2b-256 13c60ee82bd45dbf7789a2b61933a408571499ebccbc3a2c791f79746b96ae5f

See more details on using hashes here.

Supported by

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