Skip to content
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

Added the Folder level descriptions #253

Merged
merged 2 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ node_modules
/out/
/newman/
/reports/
/.temp/
/local-dev/node_modules
/local-dev/package-lock.json
/local-dev/report.html
/.temp/
5 changes: 1 addition & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ node_modules
/out/
/newman/
/reports/
/.temp/
/local-dev/node_modules
/local-dev/package-lock.json
/local-dev/report.html
/.temp/
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

-----------------------------------------------------------------------

## [1.17.4] - 2020-07-22

### Added

- Added the Folder level descriptions
- Included the names of the Folders used with the `folder` Newman flag in the Summary

-----------------------------------------------------------------------

## [1.17.3] - 2020-07-12

### Added
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ newman run collection.json -r htmlextra
| `--reporter-htmlextra-skipSensitiveData` | An optional flag that will exclude all the `Request/Response Headers` and the `Request/Response bodies`, from each request in the final report. This will only show the main request info and the Test Results. This is `false` by default. | `newman run collection.json -r htmlextra --reporter-htmlextra-skipSensitiveData`|
| `--reporter-htmlextra-showMarkdownLinks` | An optional flag which allows you render Markdown links from the test names and `pm.expect()` statements, in the final report. This could be useful if you use an external bug tracker. | `newman run collection.json -r htmlextra --reporter-htmlextra-showMarkdownLinks`|
| `--reporter-htmlextra-noSyntaxHighlighting` | An optional flag which allows you disable the code syntax highlighting. This _could_ enhance the performance of opening larger reports. | `newman run collection.json -r htmlextra --reporter-htmlextra-noSyntaxHighlighting`|
| `--reporter-htmlextra-showFolderDescription` | An optional flag which allows you to show all the folder descriptions, in the final report | `newman run collection.json -r htmlextra --reporter-htmlextra-showFolderDescription`|
| `--reporter-htmlextra-timezone` | An optional flag which allows you to set the timezone on the final report's timestamp | `newman run collection.json -r htmlextra --reporter-htmlextra-timezone "Australia/Sydney"`|

Custom templates can be passed to the `htmlextra` reporter via the `--reporter-htmlextra-template <path>` flag. The [default template](./lib/dashboard-template.hbs) is used in all other cases.
Expand Down Expand Up @@ -134,6 +135,7 @@ newman.run({
// skipGlobalVars: ["API_TOKEN"],
// skipSensitiveData: true,
// showMarkdownLinks: true,
// showFolderDescription: true,
// timezone: "Australia/Sydney"
}
}
Expand Down Expand Up @@ -212,4 +214,4 @@ This software is licensed under Apache-2.0. Copyright Postdot Technologies, Inc.

This work have been hugely inspired and copied several aspects of the great work done by [Martijn Vander Vlag](https://github.com/martijnvandervlag) to create the [newman-reporter-htmlfull](https://github.com/martijnvandervlag/newman-reporter-htmlfull) package. Check out that package too, this contains many of the same features.

It was also brought together by reviewing the feature requests, from the official Postman HTML reporter.
It was also brought together by reviewing the feature requests, from the official [Postman HTML reporter](https://github.com/postmanlabs/newman-reporter-html).
27 changes: 24 additions & 3 deletions lib/dashboard-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ body.theme-light .card-body .bg-danger {
.backToTop {
display: none;
position: fixed;
bottom: 20px;
right: 30px;
bottom: 10px;
right: 20px;
z-index: 99;
font-size: 18px;
font-size: 15px;
outline: none;
cursor: pointer;
padding: 15px;
Expand Down Expand Up @@ -507,6 +507,9 @@ table.dataTable td, table.dataTable tr {
<div class="card-body">
<h5 class="card-title text-uppercase text-white text-center bg-info">File Information</h5>
<span><i class="fas fa-file-code"></i></span><strong> Collection:</strong> {{collection.name}}<br>
{{/with}}
{{#if folders}}<span><i class="fas fa-folder"></i></span><strong> Specified Folders:</strong> {{folders}}<br>{{/if}}
{{#with summary}}
{{#if environment.name}}<span><i class="fas fa-file-code"></i></span><strong> Environment:</strong> {{environment.name}}<br>{{/if}}
</div>
</div>
Expand Down Expand Up @@ -800,6 +803,24 @@ table.dataTable td, table.dataTable tr {
</html>

{{#*inline "aggregations"}}
{{#if @root.showFolderDescription}}
{{#if parent.description.content}}
<div class="row">
<div class="col-sm-12 mb-3">
<div class="card-deck">
<div class="card border-info" style="width: 50rem;">
<div class="card-body">
<h5 class="card-title text-uppercase text-white text-center bg-info">Folder Description</h5>
<div class="dyn-height">
<code class="renderMarkdown">{{parent.description.content}}</code>
</div>
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{/if}}
{{#each executions}}
<div id="folder-{{cursor.ref}}" class="card-deck iteration-{{cursor.iteration}}">
<div class="row iteration-{{cursor.iteration}}">
Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,13 @@ PostmanHTMLExtraReporter = function (newman, options, collectionRunOptions) {
omitHeaders: options.omitHeaders || false,
showMarkdownLinks: options.showMarkdownLinks || false,
noSyntaxHighlighting: options.noSyntaxHighlighting || false,
showFolderDescription: options.showFolderDescription || false,
browserTitle: options.browserTitle || 'Newman Summary Report',
title: options.title || 'Newman Run Dashboard',
titleSize: options.titleSize || 2,
timestamp: moment().tz(timezone).format('dddd, DD MMMM YYYY HH:mm:ss'),
version: collectionRunOptions.newmanVersion,
folders: collectionRunOptions.folder,
aggregations: aggregations,
summary: {
stats: this.summary.run.stats,
Expand Down
27 changes: 24 additions & 3 deletions lib/only-failures-dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ body.theme-light .card-body .bg-danger {
.backToTop {
display: none;
position: fixed;
bottom: 20px;
right: 30px;
bottom: 10px;
right: 20px;
z-index: 99;
font-size: 18px;
font-size: 15px;
outline: none;
cursor: pointer;
padding: 15px;
Expand Down Expand Up @@ -510,6 +510,9 @@ table.dataTable td, table.dataTable tr {
<div class="card-body">
<h5 class="card-title text-uppercase text-white text-center bg-info">File Information</h5>
<span><i class="fas fa-file-code"></i></span><strong> Collection:</strong> {{collection.name}}<br>
{{/with}}
{{#if folders}}<span><i class="fas fa-folder"></i></span><strong> Specified Folders:</strong> {{folders}}<br>{{/if}}
{{#with summary}}
{{#if environment.name}}<span><i class="fas fa-file-code"></i></span><strong> Environment:</strong> {{environment.name}}<br>{{/if}}
</div>
</div>
Expand Down Expand Up @@ -790,6 +793,24 @@ table.dataTable td, table.dataTable tr {
</html>

{{#*inline "aggregations"}}
{{#if @root.showFolderDescription}}
{{#if parent.description.content}}
<div class="row">
<div class="col-sm-12 mb-3">
<div class="card-deck">
<div class="card border-info" style="width: 50rem;">
<div class="card-body">
<h5 class="card-title text-uppercase text-white text-center bg-info">Folder Description</h5>
<div class="dyn-height">
<code class="renderMarkdown">{{parent.description.content}}</code>
</div>
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{/if}}
{{#each executions}}
{{#gt cumulativeTests.failed 0}}
<div class="card-deck iteration-{{cursor.iteration}}">
Expand Down
15 changes: 0 additions & 15 deletions local-dev/package.json

This file was deleted.

23 changes: 0 additions & 23 deletions local-dev/test.js

This file was deleted.

Loading