
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
reportportal-client
Advanced tools
#ReportPortal js client This Client is to communicate with the Report Portal on node js.
Library is used only for implementors of custom listeners for ReportPortal.
The latest version is available on npm:
npm install reportportal-client
let RPClient = require('reportportal-client');
let rpClient = new RPClient({
token: "00000000-0000-0000-0000-000000000000",
endpoint: "http://your-instance.com:8080/api/v1",
launch: "LAUNCH_NAME",
project: "PROJECT_NAME"
});
rpClient.checkConnect().then((responce) => {
console.log('You have successfully connected to the server.');
console.log(`You are using an account: ${responce.full_name}`);
}, (error) => {
console.log('Error connection to server');
console.dir(error);
});
When creating a client instance, you need to specify the following parameters:
Parameter | Description |
---|---|
token | user's token Report Portal 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, if you visit the page at 'https://server:8080/ui', then endpoint will be equal to 'https://server:8080/api/v1'. |
launch | Name of launch at creation. |
project | The name of the project in which the launches will be created. |
Each method (except checkConnect) returns an object in a specific format:
{
tempId: '4ds43fs', // generated by the client id for further work with the created item
promise: Promise // An object indicating the completion of an operation
}
The client works synchronously, so it is not necessary to wait for the end of the previous requests to send following ones.
checkConnect - asynchronous method for verifying the correctness of the client connection
rpClient.checkConnect().then((responce) => {
console.log('You have successfully connected to the server.');
console.log(`You are using an account: ${responce.full_name}`);
}, (error) => {
console.log('Error connection to server');
console.dir(error);
});
startLaunch - starts a new launch, return temp id that you want to use for all of the items within this launch.
let launchObj = rpClient.startLaunch({
name: "Client test",
start_time: rpClient.helpers.now(),
description: "description of the launch",
tags: ["tag1", "tag2"]
});
console.log(launchObj.tempId);
The method takes one argument:
Parameter | Description |
---|---|
start_time | (optional) start time launch(unix time). Default: rpClient.helpers.now() |
name | (optional) launch name. Default: parameter 'launch' specified when creating the client instance |
mode | (optional) "DEFAULT" or "DEBUG". Default: "DEFAULT" |
description | (optional) description of the launch (supports markdown syntax) |
tags | (optional) array of launch tags |
To know the real launch id wait for the method to finish (the real id is not used by the client)
let launchObj = rpClient.startLaunch();
launchObj.promise.then((responce) => {
console.log(`Launch real id: ${responce.id}`);
}, (error) => {
console.dir(`Error at the start of launch: ${error}`);
})
finishLaunch - finish of the launch. After calling this method, you can not add items to the launch. The request to finish the launch will be sent only after all items within it have finished.
// launchObj - object returned by method 'startLaunch'
let launchFinishObj = rpClient.finishLaunch(launchObj.tempId, {
end_time: rpClient.helpers.now()
});
The method takes two arguments:
Parameter | Description |
---|---|
end_time | (optional) end time of launch. Default: rpClient.helpers.now() |
status | (optional) status of launch, one of "", "PASSED", "FAILED", "STOPPED", "SKIPPED", "RESTED", "CANCELLED". Default: "". |
updateLaunch - updates launch data. Will send a request to the server only after finishing the launch.
// launchObj - object returned by method 'startLaunch'
rpClient.updateLaunch(
launchObj.tempId, {
description: 'new launch description',
tags: ['new_tag1', 'new_tag2'],
mode: 'DEBUG'
}
);
The method takes two arguments:
startTestItem - starts a new test item.
// launchObj - object returned by method 'startLaunch'
let suiteObj = rpClient.startTestItem({
description: makeid(),
name: makeid(),
start_time: rpClient.helpers.now(),
type: "SUITE"
}, launchObj.tempId);
let stepObj = rpClient.startTestItem({
description: makeid(),
name: makeid(),
start_time: rpClient.helpers.now(),
tags: ['step_tag', 'step_tag2', 'step_tag3'],
type: "STEP"
}, launchObj.tempId, suiteObj.tempId);
The method takes three arguments:
Parameter | Description |
---|---|
name | item name |
type | Item type, one of 'SUITE', 'STORY', 'TEST', 'SCENARIO', 'STEP', 'BEFORE_CLASS', 'BEFORE_GROUPS','BEFORE_METHOD', 'BEFORE_SUITE', 'BEFORE_TEST', 'AFTER_CLASS', 'AFTER_GROUPS', 'AFTER_METHOD', 'AFTER_SUITE', 'AFTER_TEST' |
description | (optional) description of the launch (supports markdown syntax) |
start_time | (optional) start time item(unix time). Default: rpClient.helpers.now() |
tags | (optional) array of item tags |
finishTestItem - finish of the item. After calling this method, you can not add items to the item. The request to finish the item will be sent only after all items within it have finished.
// itemObj - object returned by method 'startTestItem'
rpClient.finishTestItem(itemObj.tempId, {
status: "failed"
})
The method takes two arguments:
Parameter | Description |
---|---|
end_time | (optional) end time of launch. Default: rpClient.helpers.now() |
status | (optional) item status, one of "", "PASSED", "FAILED", "STOPPED", "SKIPPED", "RESTED", "CANCELLED". Default: "PASSED". |
issue | (optional) object issue |
Example issue object:
{
comment: "string",
externalSystemIssues: [
{
submitDate: 0,
submitter: "string",
systemId: "string",
ticketId: "string",
url: "string"
}
]
}
sendLog - adds a log to the item
// stepObj - object returned by method 'startTestItem'
rpClient.sendLog(stepObj.tempId, {
level: "INFO",
message: makeid(),
time: rpClient.helpers.now()
})
The method takes three arguments:
Parameter | Description |
---|---|
time | (optional) time of log. Default: rpClient.helpers.now() |
message | (optional) log message. Default: ''. |
status | (optional) log status, one of 'trace', 'debug', 'info', 'warn', 'error', ''. Default "". |
Parameter | Description |
---|---|
name | file name |
type | file mimeType, example "image/png" (support types: 'image/*', application/ ['xml', 'javascript', 'json', 'css', 'php'] , another format will be opened in a new browser tab ), |
content | file |
Licensed under the GPLv3 license (see the LICENSE.txt file).
[5.0.0] - 2020-06-09
reportportal-client
) will no longer supported by reportportal.ioFAQs
ReportPortal client for node.js
The npm package reportportal-client receives a total of 1,326 weekly downloads. As such, reportportal-client popularity was classified as popular.
We found that reportportal-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.