1.0.52 • Published 1 year ago

newman-reporter-testrail v1.0.52

Weekly downloads
3,633
License
MIT
Repository
github
Last release
1 year ago

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

NameDescription
TESTRAIL_DOMAINTestRail domain. Do not include protocol.
TESTRAIL_USERNAMETestRail username / email.
TESTRAIL_APIKEYTestRail API key.
TESTRAIL_PROJECTIDTestRail project id.

OPTIONAL Environment Variables

NameDescription
TESTRAIL_RUNIDTestRail run id. Update a specific run instead of creating a new run. Can use the string "latest" to update latest run.
TESTRAIL_SUITEIDTestRail suite id. Mandatory in multi-suite projects. Do not use in single-suite projects.
TESTRAIL_MILESTONEIDMilestone to link test to.
TESTRAIL_PLANIDTest Plan Id to add run to. NOTE: Requires TESTRAIL_SUITEID to be set even in single-suite projects.
TESTRAIL_VERSIONVersion of API tested.
TESTRAIL_TITLETitle of test run to create.
TESTRAIL_REFSRef of test run to create.
TESTRAIL_INCLUDEALLWhether to include all tests in run, regardless of whether actually run by Newman. Defaults to true.
TESTRAIL_CLOSE_RUNWhether to close the TestRail run after completion of the Newman run. Defaults to false.
TESTRAILCUSTOM*A fixed testrail field, where * is the field key
TESTRAIL_LOGGINGOutput 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_IDThe ID of a custom status to use for Passed. Defaults to 1 which is the value for the Passed status.
TESTRAIL_FAILED_IDThe ID of a custom status to use for Failed. Defaults to 5 which is the value for the Failed status.
TESTRAIL_SKIPPED_IDThe ID of a custom status to use for Skipped. Defaults to 4 which is the value for the Skipped status.
TESTRAIL_STEPSProject 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_KEYIf 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_MATCHINGAttempt to fetch test cases from server and match via case name instead of id
TESTRAIL_BETA_APISet 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
1.0.52

1 year ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.49

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago