Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
protractor-html-reporter-2
Advanced tools
Readme
This package is inspired by protractor-html-reporter which developed based upon inspiration of cucumber-html-report.
You can use this package to generate HTML report for Protractor test execution with pie charts based on xml file with tests results. For generating xml file with tests results you can use [jasmine-reporters] (https://www.npmjs.com/package/jasmine-reporters).
This reporter can also display screenshots taken on test failure. To get the screenshots you can use jasmine2-protractor-utils module.
repo : https://github.com/abhishekkyd/protractor-html-reporter-2
Additional Changes from protractor-html-reporter:
Added "100%" width for TestSuite rows in CSS
Added report name outputFilename capability for report
outputFilename: 'ProtractorTestReport'
testPlatform: platform
Dashboard view:
Testsuite view:
Testcase view:
Screenshot view:
Converting the xml file to html
var HTMLReport = require('protractor-html-reporter-2');
testConfig = {
reportTitle: 'Protractor Test Execution Report',
outputPath: './',
outputFilename: 'ProtractorTestReport',
screenshotPath: './screenshots',
testBrowser: browserName,
browserVersion: browserVersion
};
new HTMLReport().from('xmlresults.xml', testConfig);
Using with protractor conf.js file
//HTMLReport called once tests are finished
onComplete: function() {
var browserName, browserVersion;
var capsPromise = browser.getCapabilities();
capsPromise.then(function (caps) {
browserName = caps.get('browserName');
browserVersion = caps.get('version');
platform = caps.get('platform');
var HTMLReport = require('protractor-html-reporter-2');
testConfig = {
reportTitle: 'Protractor Test Execution Report',
outputPath: './',
outputFilename: 'ProtractorTestReport',
screenshotPath: './screenshots',
testBrowser: browserName,
browserVersion: browserVersion,
modifiedSuiteName: false,
screenshotsOnlyOnFailure: true,
testPlatform: platform
};
new HTMLReport().from('xmlresults.xml', testConfig);
});
}
In order to obtain results in xml file you can use jasmine-reporters module:
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './',
filePrefix: 'xmlresults'
}));
In order to obtain screenshots on failure you can use this piece of code (you have to put it in onPrepare). The directory with screenshots must be in the same location as html report file (e.g. html file is in report directory so screenshots files must be in directory /report/screenshots/).
var fs = require('fs-extra');
fs.emptyDir('screenshots/', function (err) {
console.log(err);
});
jasmine.getEnv().addReporter({
specDone: function(result) {
if (result.status == 'failed') {
browser.getCapabilities().then(function (caps) {
var browserName = caps.get('browserName');
browser.takeScreenshot().then(function (png) {
var stream = fs.createWriteStream('screenshots/' + browserName + '-' + result.fullName+ '.png');
stream.write(new Buffer(png, 'base64'));
stream.end();
});
});
}
}
});
Or you can use jasmine2-protractor-utils module to get the screenshots:
//In exports.config put this:
plugins: [{
package: 'jasmine2-protractor-utils',
disableHTMLReport: true,
disableScreenshot: false,
screenshotPath:'./screenshots',
screenshotOnExpectFailure:false,
screenshotOnSpecFailure:true,
clearFoldersBeforeTest: true
}],
```
If you want to display your screenshots on report you have to pass testBrowser (it's the name of the browser) in testConfig object, because the screenshot's names are in format "browserName-.png" (e.g. "chrome-.png").
Thanks to @etxebe and all credits to developers of protractor-html-reporter for nice protractor reporting. The protractor-html-reporter-2 is liitle bit html enhancement of this one. I've just fixed few things, some thing were added from pull requests and this reporter is still based on xml file.
FAQs
To generate HTML report for Protractor test execution with pie charts
The npm package protractor-html-reporter-2 receives a total of 40,622 weekly downloads. As such, protractor-html-reporter-2 popularity was classified as popular.
We found that protractor-html-reporter-2 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.