Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@reportportal/newman-reporter-agent-js-postman
Advanced tools
Newman runtime reporter for ReportPortal which provides information about collection run.
ReportPortal
ReportPortal on GitHub
The installation should be global if newman is installed globally, otherwise - local (replace -g from the command below with -S for a local installation).
$ npm install -g @reportportal/newman-reporter-agent-js-postman
There are two ways to enable this reporter - with command line or programmatically.
To enable this reporter you have to specify agent-js-postman
in Newman's -r
or --reporters
option.
$ newman run https://postman-echo.com/status/200 \
-r @reportportal/agent-js-postman \
--reporter-@reportportal/agent-js-postman-debug=true \
--reporter-@reportportal/agent-js-postman-endpoint=http://your-instance.com:8080/api/v1 \
--reporter-@reportportal/agent-js-postman-token=00000000-0000-0000-0000-000000000000 \
--reporter-@reportportal/agent-js-postman-launch=LAUNCH_NAME \
--reporter-@reportportal/agent-js-postman-project=PROJECT_NAME \
--reporter-@reportportal/agent-js-postman-description=LAUNCH_DESCRIPTION \
--reporter-@reportportal/agent-js-postman-attributes=launchKey:launchValue;launchValueTwo \
-x
Pay attention that you must add -x or --suppress-exit-code parameter while running newman using CLI.
const newman = require("newman");
newman.run(
{
collection: "./collections/newman-test_collection.json",
reporters: "@reportportal/agent-js-postman",
reporter: {
"@reportportal/agent-js-postman": {
endpoint: "http://your-instance.com:8080/api/v1",
token: "00000000-0000-0000-0000-000000000000",
launch: "LAUNCH_NAME",
project: "PROJECT_NAME",
description: "LAUNCH_DESCRIPTION",
attributes: [
{
"key": "launchKey",
"value": "launchValue"
},
{
"value": "launchValue"
},
],
mode: 'DEFAULT',
debug: true
}
}
},
function(err) {
if (err) {
throw err;
}
console.log("collection run complete!");
}
);
Both CLI and programmatic runs support following options:
Parameter | Description |
---|---|
token | User's Report Portal token from which you want to send requests. It can be found on the profile page of this user. |
endpoint | URL of your server. For example 'https://server:8080/api/v1'. |
launch | Name of launch at creation. |
project | The name of the project in which the launches will be created. |
description | Text description of launch. |
attributes | Attributes of launch. Programmatically - [{ "key": "YourKey", "value": "YourValue" }] with CLI - "YourKey:YourValue;YourValueTwo" |
rerun | Enable rerun |
rerunOf | UUID of launch you want to rerun. If not specified, report portal will update the latest launch with the same name. |
debug | Determines whether newman's run should be logged in details. |
mode | Launch mode. Allowable values DEFAULT (by default) or DEBUG. |
VARIABLE | INITIAL VALUE | CURRENT VALUE |
---|---|---|
rp.attributes | keySuiteOne:valueSuiteOne | keySuiteOne:valueSuiteOne |
pm.environment.set
Parameter | Required | Description | Examples |
---|---|---|---|
namespace | true | "string" - namespace, must be equal to the rp.attributes | "rp.attributes" |
attributes | true | "string" - contains set of pairs key:value | "keyOne:valueOne;valueTwo;keyThree:valueThree" |
pm.environment.set("rp.attributes", "keyOne:valueOne;valueTwo;keyThree:valueThree");
Both suites and tests support description. For reporting with description you should click on Edit in your collection and in the description column enter the text you need
status must be equal to one of the following values: passed, failed, stopped, skipped, interrupted, cancelled, info, warn.
VARIABLE | INITIAL VALUE | CURRENT VALUE |
---|---|---|
rp.launchStatus (for launch) rp.status (for suite) | your status | your status |
pm.environment.set("rp.status", "status");
pm.variables.set("rp.status", "status");
It is important that the code line above has to start from the new line and you shouldn't forget about semicolon after it
For both tests or steps, this is true
Parameter | Required | Description | Examples |
---|---|---|---|
namespace | true | "string" - namespace, must be equal to the rp.status | "rp.status" |
status | true | "string" - status | "passed" |
You can use the following methods to report logs with different log levels:
Parameter | Required | Description | Examples |
---|---|---|---|
namespace | true | "string" - namespace, must be equal to the launch, suite or test depends on where you want to report | "test" |
message | true | "string" - message | "your message" |
VARIABLE | INITIAL VALUE | CURRENT VALUE |
---|---|---|
rp.testCaseId | yourSuiteTestCaseId | yourSuiteTestCaseId |
pm.environment.set("rp.testCaseId", "yourTestCaseId");
pm.variables.set("rp.testCaseId", "stepTestCaseId");
It is important that the code line above has to start from the new line and you shouldn't forget about semicolon after it
For both tests or steps, this is true
Parameter | Required | Description | Examples |
---|---|---|---|
namespace | true | "string" - namespace, must be equal to the rp.testCaseId | "rp.testCaseId" |
testCaseId | true | "string" - test case id value | "yourTestCaseId" |
Licensed under the Apache 2.0 license (see the LICENSE.txt file).
FAQs
ReportPortal reporter for newman
The npm package @reportportal/newman-reporter-agent-js-postman receives a total of 5,597 weekly downloads. As such, @reportportal/newman-reporter-agent-js-postman popularity was classified as popular.
We found that @reportportal/newman-reporter-agent-js-postman demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.