Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
ares-helper
Advanced tools
Readme
Simplifies communication from Node.js to the API for the www.testastra.com/ares dashboard
ARES (TOOL AGNOSTIC TEST AUTOMATION DASHBOARD) is a Dashboard for test reports. It is a nice Dashboard with a REST-api.
The REST api has its downsides - non-consequent naming of properties (camelcase and underscore) mixed, and many properties that are mandatory to send even if they often are empty/unnecessary.
That's the reason for this module - it's simplifies communication with ARES from Node.js.
In order to report your test to ARES you must first create an account at https://www.testastra.com/ares.
You then tell ARES to start a test run, start a module within that test run, report test results within that module, end reports within that module and end the test run.
(If you want to can set up your system to run several modules in parallell.)
Install this module:
npm install ares-helper
and then use it in your scripts:
const ares = require('ares-helper');
You could call the json file ares-config.json and put it at root level in your Node.js project. The structure of the file should look like this
{
"userToken": "user token copied from the ARES website",
"workspaceName": "workspace name copied from the ARES website",
"projectKey": "project key copied from the ARES website",
"projectName": "project name copied from the ARES website"
}
ares.setProjectInfo('ares-config.json');
Sets the basic project info by pointing to a JSON file.
(Alternatively you can send the json data directly to the method.)
Start a test run:
await ares.startTests();
Start a module within the test run:
await ares.startModule({
moduleName: 'A name of your own choice',
totalTests: 3 // Total number of tests in the module
})
Save a test result for a test within a module:
await ares.testResult({
moduleName: 'A name of a module you have started',
title: 'The name of the test',
passed: false, // true = passed or false = failed
errorMessage: 'Provide an errormessge if failed'
});
Please note: You can provide much more info if you want. Additional properties you can use are: testData, failStacktrace, testBrowser, testMachine, testDevice, testOs, testSuite, imageLink, videoLink, runBy, errorMessage, executionMode and failType.
When you have reported all test results within a module:
await ares.endModule({
moduleName: 'The name of the module you want to end'
});
When the whole test run is done:
await ares.endTests()
If you want to debug what happens in the communication between your application and the ARES server:
ares.debug = true;
This will output a verbose log to the console.
This is some example code to quickly test that communication works. (However normally, in a real-life scenario, you would spread your calls to ares throughout different test steps and files...)
const ares = require('ares-helper');
async function tryItOut(){
ares.debug = true;
ares.setProjectInfo('ares-config.json');
await ares.startTests();
await ares.startModule({
moduleName: 'Dummy module 1',
totalTests: 3
});
await ares.testResult({
moduleName: 'Dummy module 1',
title: 'Test 1',
passed: true
});
await ares.testResult({
moduleName: 'Dummy module 1',
title: 'Test 2',
passed: false,
errorMessage: 'Could not compute!'
});
await ares.testResult({
moduleName: 'Dummy module 1',
title: 'Test 3',
passed: true
});
await ares.endModule({
moduleName: 'Dummy module 1',
});
await ares.endTests();
}
tryItOut();
FAQs
Simplifies communication from Node.js to the API for the www.testastra.com/ares dashboard
We found that ares-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).