Skip to main content

This package parses a cucumber JSON to a report friendly JSON

Project description

https://secure.travis-ci.org/kpn-digital/test_report_processor.svg?branch=master https://img.shields.io/codecov/c/github/kpn-digital/test_report_processor/master.svg https://img.shields.io/pypi/v/test_report_processor.svg https://readthedocs.org/projects/test_report_processor/badge/?version=latest

This repository is a JSON parser for test reports. It imports a test report generated by pytest (cucumber JSON file). Then is parses the cucumber JSON to any desired JSON report.

When output to Paessler is selected, the new JSON is send to a paessler sensor through a GET request. The Paessler sensor’s are displayed on a Paessler dashboard for DevOps purposes.

Requirements

  • json

  • request

Usage

When using the test report parser, the required input is a test report JSON file. The output can be any of the mentioned outputs.

Input - Cucumber test report (JSON file)

Output - Paessler JSON

Importing the package

Import the package by including the following code::

from test_report_processor.test_report_processor import ReportParser

Starting a new parser

Start the parser by creating a new ReportParser class:

report_parser = ReportParser("/path/cucumber.json", "paessler", "duration")

Input parameters for ReportParser class

Creating a new ReportParser class requires 3 parameters:

  1. Location of the “cucumber.json” file (string)

  2. Desired parser output (string), options:
    • “paessler” for paessler dashboard

  3. Sensor type (string), options:
    • “duration” - test durations of scenario’s and steps in milliseconds

    • “status” - test status of scenario’s and steps in “pass” or “fail”

Debugging

After creating a ReportParser class, you can view the parsed json with this variable:

report_parser.paessler_json

A URL will also be generated which points to the Paessler sensor id where the result will be displayed. View the Paessler URL with this variable:

report_parser.paessler_url

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

test-report-processor-0.10.11.tar.gz (14.1 kB view details)

Uploaded Source

File details

Details for the file test-report-processor-0.10.11.tar.gz.

File metadata

  • Download URL: test-report-processor-0.10.11.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for test-report-processor-0.10.11.tar.gz
Algorithm Hash digest
SHA256 f896c043905c7e7d217f3778d2c6156a88b2384c01dae1c92db25c8287114f3d
MD5 c07702276f85c07d0b4a0166ed047255
BLAKE2b-256 8b5155dedaa9a490cfe7175259b70cc10511417dc62f62502d07d562f99cb8cf

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