-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to get content in describe block alone in reports? #92
Comments
@SwathiJayabharathi protractor-beautiful-reporter cannot do that out of box. |
if we use JUnitXmlReporter, it will display testcase name too. but here I want only test Suite details. |
@SwathiJayabharathi var fs = require('fs');
var path = require('path');
var filterxml = require('filterxml');
var baseDir = path.resolve(__dirname, "./reports-tmp/"); // change to your path with xml files
var files = fs.readdirSync(baseDir).filter(function (f) {
return f.endsWith(".xml");
});
var output = "";
files.forEach(function (file) {
var xmlIn = fs.readFileSync(path.join(baseDir, file)).toString();
var output = "";
filterxml(xmlIn, ['//testcase'], {}, function (err, xmlOut) {
output += xmlOut + "\n";
});
var outFile = path.join(baseDir, path.basename(file,".xml") + "-suite-only.xml");
fs.writeFileSync(outFile,output);
console.log(output);
}); After that for each xml file the will antother one with "-suite-only.xml" that looks like this: <?xml version="1.0" encoding="UTF-8"?>
<testsuites disabled="0" errors="0" failures="0" tests="47" time="17.166">
<testsuite name="second top level" timestamp="2018-09-10T21:25:00" hostname="localhost" time="4.305" errors="0" tests="1" skipped="0" disabled="0" failures="0">
</testsuite>
<testsuite name="second top level.nested deeply spec level 1" timestamp="2018-09-10T21:25:01" hostname="localhost" time="3.448" errors="0" tests="2" skipped="0" disabled="0" failures="0">
</testsuite>
<testsuite name="second top level.nested deeply spec level 1.nested deeply spec level 2" timestamp="2018-09-10T21:25:01" hostname="localhost" time="3.282" errors="0" tests="2" skipped="0" disabled="0" failures="0">
</testsuite>
<testsuite name="second top level.nested deeply spec level 1.nested deeply spec level 2.nested deeply spec level 3" timestamp="2018-09-10T21:25:01" hostname="localhost" time="3.138" errors="0" tests="2" skipped="0" disabled="0" failures="0">
</testsuite>
<testsuite name="second top level.nested deeply spec level 1.nested deeply spec level 2.nested deeply spec level 3.nested deeply spec level 4" timestamp="2018-09-10T21:25:01" hostname="localhost" time="2.993" errors="0" tests="40" skipped="0" disabled="0" failures="0">
</testsuite>
</testsuites> |
i need a summary of test execution. i am trying to get content present in describe block in all the suites and print in reports.
Eg: i am executing 25 spec files at a time. my report provides both suite and testcase status. But i want one summary stating whether the particular suite passed or failed.
first_spec.js
describe('Suite1', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
});
});
second_spec.js
describe('Suite2', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
});
});
third_spec.js
describe('Suite3', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
});
});
Report.html should be
Is that possible in protractor-beautiful-reporter?
The text was updated successfully, but these errors were encountered: