npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

newman-reporter-aiotests

v1.1.0

Published

Newman Custom reporter to report results to AIO Tests - Jira

Downloads

339

Readme

AIO Tests for Jira Newman Reporter

AIO Tests for Jira is a Jira-native test management app covering the entire QA lifecycle with Test Cases, Cycles, Reports, Automation, Dashboards, providing a one stop shop for all your testing needs.

With it's Newman reporter, AIO Tests simplifies reporting of results from the automated Postman tests to AIO Tests for Jira.

How does the AIO Tests Reporter work

By using Newman's event emitters, the AIO Tests Newman Reporter reports results in the beforeDone event, at the end of a collection run. The reporter can create a new cycle for the executions or reuse existing cycles, based on the configuration done either via command line options or through the reporter config when using newman programmatically.

How to get started?

npm install newman-reporter-aiotests

Use

Creating and Mapping Postman tests in AIO Tests

Creation of Cases

The first time the results are reported, if AIO Tests case keys have not been mapped, then new cases are created.

Field mapping (Postman → AIO Tests)

Refer Field Mapping to see how the fields of Postman request are translated into a new case in AIO Tests

Mapping of Cases

The AIO Tests Case key can be added to the name of the API. If there are multiple case keys in a single description, then the result of one test will be updated to multiple cases.

Please note that the case key can appear anywhere in the name

The image below shows case keys in names of requests. For APIs, where no key is specified, a new case will be created. The newly created case will be identified using automation key.

img_1.png

Configure

AIO Tests can be configured for both Newman's programmatic as well as CLI runs. For both options, the authorization needs to be set. For Cloud, the AIO Tests API Token needs to be generated and for Jira Server/DC, a PAT token is required. More details on Authorization for both types can be found here.

Newman Programmatic run

Newman can be easily used within your JavaScript projects as a Node.js module. The entire set of Newman CLI functionality is available for programmatic use as well. If running Newman programmatically, the AIO Tests config can be set as below:

var newman = require('newman');

newman.run({
   collection: '/path/to/collection.json',
   reporters: 'aiotests',
   reporter: {
     aiotests: {
        //enableReporting controls, if for this run, results have to be reported or not
        'enableReporting': true, 
        
        // Jira Project Key
        'jiraProjectId': 'PROJ1', 
        
        // Uncooment below : Jira Server URL and Jira PAT is required if on Jira Server/DC
        // 'jiraServer': 'https://jira8.aioreports.com', 
        // 'jiraPat': '<PATToken>', 
        
        //AIO Tests API Key
        'aioApiToken': '<AIO API Key>',
        
        //createNewCycle - defaults to true, Set to true if new cycle needs to be created
        'createNewCycle': false, 
        
        //newCycleTitle - defaults to collection name, if createNewCycle true, newCyclePrefix would be used to create new cycle, else cycleKey would be used to update existing cycle
        'newCycleTitle': '',
        
        //cycleKey - if createNewCycle is false, then set cycleKey to report to existing cycle
        'cycleKey': 'NVTES-CY-403',
        
        //createNewRun - defaults to false, set to true to create new run for each execution
        'createNewRun': true, 
        
        //createCase - defaults to true, Set to false, if new cases should not be created for requests with no cake key mapped
        'createCase': true, 
        
        //bddForceUpdateCase - defaults to true, updates step changes in AIO Case with changes in request data
        'bddForceUpdateCase': true 
     }
   }
});

Depending on the Jira hosting, the authentication information needs to be provided as below.

Newman Command Line

If Newman is being run from the command line, then use the reporter with the -r option. Specify -r aiotests to use the AIO Tests Reporter. The rest of the configuration option can go as --reporter-aiotests-optionName optionValue as below: Please refer to the Programmatic section below to understand the usage of each option.

newman run /path/to/collection.json -r aiotests 
    --reporter-aiotests-enableReporting true
    --reporter-aiotests-jiraProjectId 'PROJ1'
    --reporter-aiotests-aioApiToken 'youapitoken'
    --reporter-aiotests-jiraServer 'youapitoken'
    --reporter-aiotests-jiraPat '<jiraPatToken>'
    --reporter-aiotests-createNewCycle 'true'
    --reporter-aiotests-newCycleTitle 'Daily API Smoke'
    --reporter-aiotests-cycleKey 'PROJ1-CY-221'
    --reporter-aiotests-createNewRun 'true'
    --reporter-aiotests-createCase 'true'
    --reporter-aiotests-bddForceUpdateCase 'true'
    

Logging

AIO Tests Newman Reporter logs can be seen in the run logs as below for successful updates

img.png

Errors received while updating will appear in a similar way

img_2.png

Queries/Suggestions?

For any queries, suggestions or issues, please feel free to reach out @ [email protected]

AIO Tests Overview

AIO Tests Automation