cucumber-html-reporter
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -0,1 +1,8 @@ | ||
### 0.3.2 (2016-11-21) | ||
### Enhancements | ||
* Show Metadata - additional info about your test environment, browser, platform, app version, mode of execution, stage, and so on. [PR#39](https://github.com/gkushang/cucumber-html-reporter/pull/39) | ||
### 0.3.1 (2016-11-18) | ||
@@ -2,0 +9,0 @@ |
@@ -29,3 +29,3 @@ 'use strict'; | ||
console.log('Invalid Cucumber JSON file found under ' + options.jsonDir + ': ' + file); | ||
} | ||
} | ||
else { | ||
@@ -32,0 +32,0 @@ cucumberJson.map(collect) |
@@ -64,3 +64,3 @@ 'use strict'; | ||
function format(min, sec) { | ||
sec = sec + 's'; | ||
sec = sec + 's'; | ||
return min > 0 ? min + 'm ' + sec : sec; | ||
@@ -116,3 +116,3 @@ } | ||
} | ||
} else if(options.storeScreenShots && options.storeScreenShots === true) { | ||
} else if (options.storeScreenShots && options.storeScreenShots === true) { | ||
var name = step.name && step.name.split(' ').join('_') || step.keyword.trim(); | ||
@@ -126,4 +126,4 @@ if (!fs.existsSync(screenShotDirectory)) { | ||
step.image = 'screenshot/' + name; | ||
} else if(embedding.mime_type === 'image/png') { | ||
step.image = 'data:image/png;base64,' + embedding.data | ||
} else if (embedding.mime_type === 'image/png') { | ||
step.image = 'data:image/png;base64,' + embedding.data | ||
} | ||
@@ -212,2 +212,4 @@ }); | ||
if (options.metadata) suite.metadata = options.metadata; | ||
return suite; | ||
@@ -231,4 +233,2 @@ }; | ||
// suite.additionalInfo = { "Configuration": "Version", "Platform": "win32", "Browser": "52.0.2743.116", "Angular Edition": "1.5.7", "UI": "1.2.80", "API": "1.2.0.33", "Test Environment": "DEV_EXTERNAL" }; | ||
fs.writeFileSync( | ||
@@ -235,0 +235,0 @@ options.output, |
@@ -6,23 +6,23 @@ 'use strict'; | ||
function searchFileUp (fileName) { | ||
var pathParts = process.cwd().split(path.sep); | ||
function searchFileUp(fileName) { | ||
var pathParts = process.cwd().split(path.sep); | ||
var filePath = pathParts.concat([fileName]).join(path.sep); | ||
var filePath = pathParts.concat([fileName]).join(path.sep); | ||
while (!exists(filePath) && pathParts.length) { | ||
pathParts.pop(); | ||
filePath = pathParts.concat([fileName]).join(path.sep); | ||
} | ||
while (!exists(filePath) && pathParts.length) { | ||
pathParts.pop(); | ||
filePath = pathParts.concat([fileName]).join(path.sep); | ||
} | ||
return filePath; | ||
return filePath; | ||
} | ||
function exists(filePath) { | ||
try { | ||
return fs.statSync(filePath).isFile(); | ||
} catch (err) { | ||
return false; | ||
} | ||
try { | ||
return fs.statSync(filePath).isFile(); | ||
} catch (err) { | ||
return false; | ||
} | ||
} | ||
module.exports = searchFileUp; |
{ | ||
"name": "cucumber-html-reporter", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Generates Cucumber HTML reports in three different themes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,4 +23,5 @@ cucumber-html-reporter | ||
#### More snapshots are availble [here][8] | ||
###### More snapshots are availble [here][8] | ||
## Install | ||
@@ -47,6 +48,18 @@ | ||
reportSuiteAsScenarios: true, | ||
launchReport: true | ||
launchReport: true, | ||
metadata: { | ||
"App Version":"0.3.2", | ||
"Test Environment": "STAGING", | ||
"Browser": "Chrome 54.0.2840.98", | ||
"Platform": "Windows 10", | ||
"Parallel": "Scenarios", | ||
"Executed": "Remote" | ||
} | ||
}; | ||
reporter.generate(options); | ||
//more info on `metadata` is available in `options` section below. | ||
@@ -75,3 +88,6 @@ //to generate consodilated report from multi-cucumber JSON files, please use `jsonDir` option instead of `jsonFile`. More info is available in `options` section below. | ||
## Changelog | ||
[changelog][9] | ||
## Options | ||
@@ -143,3 +159,3 @@ | ||
`true`: Stores all screenShots stores the screenShots to the default directory. It creates a directory 'screehshot' if does not exists. | ||
`true`: Stores the screenShots to the default directory. It creates a directory 'screehshot' if does not exists. | ||
@@ -149,3 +165,27 @@ `false` or `undefined` : Does not store screenShots but attaches screenShots as a step-inline images to HTML report | ||
#### `metadata` | ||
Type: `JSON` (optional) | ||
Default: `undefined` | ||
Print more data to your report, such as _browser info, platform, app info, environments_ etc. Data can be passed as JSON `key-value` pair. Reporter will parse the JSON and will show the _Key-Value_ under `Metadata` section on HTML report. Checkout the below preview HTML Report with Metadata. | ||
Pass the _Key-Value_ pair as per your need, as shown in below example, | ||
```json | ||
metadata: { | ||
"App Version":"0.3.2", | ||
"Test Environment": "STAGING", | ||
"Browser": "Chrome 54.0.2840.98", | ||
"Platform": "Windows 10", | ||
"Parallel": "Scenarios", | ||
"Executed": "Remote" | ||
} | ||
``` | ||
* [HTML Report Preview with Metadata][3] | ||
* [Report Snapshot with Metadata][10] | ||
## Tips | ||
@@ -185,2 +225,3 @@ | ||
## Credits | ||
@@ -198,1 +239,5 @@ | ||
[8]: https://github.com/gkushang/cucumber-html-reporter/blob/develop/samples/snapshots.md | ||
[9]: https://github.com/gkushang/cucumber-html-reporter/blob/develop/CHANGELOG.md | ||
[10]: https://github.com/gkushang/cucumber-html-reporter/blob/develop/samples/snapshots.md#with-metadata | ||
@@ -12,5 +12,9 @@ ## Attach More INFO to report | ||
## With Metadata | ||
![Alt text](/samples/html_report_snapshots/cucumber_report_bootstrap_snapshot_with_metadata.png) | ||
## Sample | ||
![Alt text](/samples/html_report_snapshots/cucumber_report_bootstrap_snapshot.png) |
@@ -52,3 +52,11 @@ 'use strict'; | ||
reportSuiteAsScenarios: true, | ||
launchReport: true | ||
launchReport: true, | ||
metadata: { | ||
"App Version": "0.3.2", | ||
"Test Environment": "STAGING", | ||
"Browser": "Chrome 54.0.2840.98", | ||
"Platform": "Windows 10", | ||
"Parallel": "Scenarios", | ||
"Executed": "Remote" | ||
} | ||
}; | ||
@@ -102,3 +110,3 @@ } | ||
removeReports(); | ||
// | ||
assertJsonFile(); | ||
@@ -105,0 +113,0 @@ |
@@ -13,2 +13,6 @@ 'use strict'; | ||
this.Then(/^Fred runs a passing cucumber step with 2 seconds timeout/, function(callback) { | ||
setTimeout(callback, 2000); | ||
}); | ||
this.Then(/^Fred runs a passing cucumber scenario with the below content$/, function(docString, callback) { | ||
@@ -15,0 +19,0 @@ callback(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1602348
39
2115
237
0