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-testrail

v1.0.52

Published

TestRail reporter for Newman

Downloads

13,755

Readme

newman-reporter-testrail

TestRail reporter for Newman.

Installation

npm install newman-reporter-testrail --global

Usage

Prefix all test assertions you wish to map with the test number.

Include the letter C. You may map more than one test case to an assertion.

pm.test("C226750 C226746 Status code is 200", function () {
    pm.response.to.have.status(200);
});

Export the following environment variables.

REQUIRED Environment Variables

| Name | Description | | --- | --- | | TESTRAIL_DOMAIN | TestRail domain. Do not include protocol. | | TESTRAIL_USERNAME | TestRail username / email. | | TESTRAIL_APIKEY | TestRail API key. | | TESTRAIL_PROJECTID | TestRail project id. |

OPTIONAL Environment Variables

| Name | Description | |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | TESTRAIL_RUNID | TestRail run id. Update a specific run instead of creating a new run. Can use the string "latest" to update latest run. | | TESTRAIL_SUITEID | TestRail suite id. Mandatory in multi-suite projects. Do not use in single-suite projects. | | TESTRAIL_MILESTONEID | Milestone to link test to. | TESTRAIL_PLANID | Test Plan Id to add run to. NOTE: Requires TESTRAIL_SUITEID to be set even in single-suite projects. | | TESTRAIL_VERSION | Version of API tested. | | TESTRAIL_TITLE | Title of test run to create.
| TESTRAIL_REFS | Ref of test run to create. | | TESTRAIL_INCLUDEALL | Whether to include all tests in run, regardless of whether actually run by Newman. Defaults to true. | | TESTRAIL_CLOSE_RUN | Whether to close the TestRail run after completion of the Newman run. Defaults to false. | | TESTRAIL_CUSTOM_* | A fixed testrail field, where * is the field key | | TESTRAIL_LOGGING | Output logging. Options are full, headers, none. Defaults to full. Use the none or headers option if you are getting a "Request Entity Too Large" error. | | TESTRAIL_PASSED_ID | The ID of a custom status to use for Passed. Defaults to 1 which is the value for the Passed status. | | TESTRAIL_FAILED_ID | The ID of a custom status to use for Failed. Defaults to 5 which is the value for the Failed status. | | TESTRAIL_SKIPPED_ID | The ID of a custom status to use for Skipped. Defaults to 4 which is the value for the Skipped status. | | TESTRAIL_STEPS | Project uses test steps. Test cases that share the same case id are assumed to be steps for the same test case. Defaults to false. | | TESTRAIL_STEPRESULT_KEY | If TESTRAIL_STEPS is set to true and your TestRail configuration changed the Step Results field to another value then you can set this env variable to the correct name. By default this is set to "step_results". | | TESTRAIL_TITLE_MATCHING | Attempt to fetch test cases from server and match via case name instead of id | | TESTRAIL_BETA_API | Set to true to add additional X-API-IDENT: BETA header. Can be needed in order to use reporter with older TestRail versions (before Feb. 21, 2021). Defaults to false. |

You can use direnv to easily maintain directory-specific options.

You may also set some or all of these variables using bash exports or by declaring directly in the run command.

Run newman with the reporter option

-r testrail

Example:

TESTRAIL_DOMAIN=example.testrail.com TESTRAIL_USERNAME=exampleuser 
TESTRAIL_APIKEY=yourkey TESTRAIL_PROJECTID=99 TESTRAIL_TITLE="Dev-API Regression" 
newman run my-collection.postman_collection.json -r testrail,cli