PyTest

Guidelines for pytest-handshakes reporter

BETA

NEW

This is the documentation for adding the handshake reporter to your pytest automation framework.

Possibilities


Setup


  1. Download Handshakes: pip install handshakes

  2. Run your pytest suite, and pytest will recognize our plugin once "handshakes" are installed

PYPI Package - https://pypi.org/project/handshakes/#description

Extras


  1. Excel Exporter - pip install handshakes[excel-export] - Allows users to export the test results to Excel

  2. Print Tables - pip install handshakes[print-tables] - Allows Users to query the handshakes

If you need all of the extras, please try this command for installation pip install handshakes[all]

Configuration


For configuring Handshake Reporter, you can refer to the general configuration from here:

for the pytest-specific. Please refer to the sample file here:

https://github.com/RahulARanger/handshake/blob/master/test_pytest_reporter/pytest.ini
[pytest]
asyncio_mode = auto
asyncio_default_fixture_loop_scope = session
save_results_in=../TestResults
save_handshake_config_dir=../
projectName="Sample Project"
disable_handshakes=
handshake_port=6966
enable_assertion_pass_hook=true
handshake_tag_PROJECT_TYPE_FOR=pytest_reporter

In the Above file, you can configure the handshake reporter according to your needs:

  • projectName - name of the project, you can group the test runs based on this label

  • disable_handshakes - if empty, reports the test run; else if it has any value then it will not report (Recommended for local runs)

  • save_handshake_config_dir - saves the handshake.json file relative to the mentioned path from pytest.ini file.

  • save_results_in - saves the TestResults In the mentioned relative path (Relative Path to this ini's config file)

  • enable_assertion_pass_hook - make it true to let handshakes collect the assertions reporter else it will not be able to collect it

  • handshake_port - Port at which the handshake must serve (default: 6969)

  • handshake_tag_[TAG_DESCRIPTION]=[TAG_DESC] - these are generic options to let users to add tags through ini files.

Last updated