cucumber-html-reporter
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -0,1 +1,10 @@ | ||
### 0.2.1 (2016-07-12) | ||
#### Enhancements | ||
* Recursively create HTML report directory if does not exists | ||
* Remove outdated chai-fs depedency and use chai-should assertions | ||
* Lighter the background color or Scenario attachments | ||
### 0.2.0 (2016-07-10) | ||
@@ -2,0 +11,0 @@ |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var path = require('path'); | ||
var nodeFs = require('node-fs'); | ||
@@ -46,2 +47,10 @@ var generateReport = function(options) { | ||
var createReportDirectoryIfNotExists = function() { | ||
if (!fs.existsSync(options.output)) { | ||
nodeFs.mkdirSync(path.dirname(options.output), parseInt('0777', 8), true); | ||
} | ||
}; | ||
createReportDirectoryIfNotExists(); | ||
var setStats = function(suite) { | ||
@@ -48,0 +57,0 @@ var featureOutput = suite.features; |
{ | ||
"name": "cucumber-html-reporter", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Generates Cucumber HTML reports in three different themes", | ||
@@ -17,3 +17,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "npm run features", | ||
"test": "npm run features && npm run clean", | ||
"clean": "rm -r test/report/*.html test/report/*.json test/report/screenshot", | ||
"features": "node node_modules/cucumber/bin/cucumber test/features/ -f json:test/report/cucumber_report.json" | ||
@@ -42,9 +43,9 @@ }, | ||
"dependencies": { | ||
"chai": "^1.10.0", | ||
"chai-fs": "^0.1.0", | ||
"chai": "^3.5.0", | ||
"commondir": "^1.0.1", | ||
"js-base64": "^2.1.9", | ||
"jsonfile": "^2.3.1", | ||
"lodash": "^4.13.1" | ||
"lodash": "^4.13.1", | ||
"node-fs": "^0.1.7" | ||
} | ||
} |
'use strict'; | ||
var chai = require('chai'); | ||
chai.use(require('chai-fs')); | ||
var expect = chai.expect; | ||
var fs = require('fs'); | ||
should = chai.should(); | ||
var path = require('path'); | ||
module.exports = function assertHtmlReports() { | ||
module.exports = function assertHtmlReports(outputDirectory) { | ||
var bootstrapHtmlFile = 'test/report/cucumber_report_bootstrap.html'; | ||
var foundationHtmlFile = 'test/report/cucumber_report_foundation.html'; | ||
var simpleHtmlFile = 'test/report/cucumber_report_simple.html'; | ||
function isReportExists(report) { | ||
try { | ||
return fs.statSync(report).isFile(); | ||
} catch (e) { | ||
return false | ||
} | ||
} | ||
expect(bootstrapHtmlFile).to.be.a.path('Bootstrap HTML report was not created'); | ||
expect(foundationHtmlFile).to.be.a.path('Foundation HTML report was not created'); | ||
expect(simpleHtmlFile).to.be.a.path('Simple HTML report was not created'); | ||
var bootstrapHtmlFile = path.join(outputDirectory, 'cucumber_report_bootstrap.html'); | ||
var foundationHtmlFile = path.join(outputDirectory, 'cucumber_report_foundation.html'); | ||
var simpleHtmlFile = path.join(outputDirectory, 'cucumber_report_simple.html'); | ||
isReportExists(bootstrapHtmlFile).should.be.equal(true, 'bootstrapHtmlFile file \'' + bootstrapHtmlFile + '\' does not exist'); | ||
isReportExists(foundationHtmlFile).should.be.equal(true, 'foundationHtmlFile file \'' + foundationHtmlFile + '\' does not exist'); | ||
isReportExists(simpleHtmlFile).should.be.equal(true, 'simpleHtmlFile file \'' + simpleHtmlFile + '\' does not exist'); | ||
}; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var assertHtmlReports = require('../../assert/assertHtmlReports'); | ||
var path = require('path'); | ||
@@ -22,2 +23,4 @@ var hooks = function() { | ||
var outputDirectory = 'test/report/'; | ||
function getOptions(theme) { | ||
@@ -27,3 +30,3 @@ return { | ||
jsonFile: 'test/report/cucumber_report.json', | ||
output: 'test/report/cucumber_report_' + theme + '.html', | ||
output: path.join(outputDirectory, 'cucumber_report_' + theme + '.html'), | ||
reportSuiteAsScenarios: true | ||
@@ -44,3 +47,3 @@ }; | ||
//assert reports | ||
assertHtmlReports(); | ||
assertHtmlReports(outputDirectory); | ||
@@ -47,0 +50,0 @@ callback(); |
@@ -47,3 +47,3 @@ 'use strict'; | ||
this.scenario.attach(JSON.stringify(myJsonObject, undefined, 2)); | ||
callback(); | ||
@@ -50,0 +50,0 @@ }); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
306489
29
598
2
1
0
+ Addednode-fs@^0.1.7
+ Addedassertion-error@1.1.0(transitive)
+ Addedchai@3.5.0(transitive)
+ Addednode-fs@0.1.7(transitive)
+ Addedtype-detect@1.0.0(transitive)
- Removedchai-fs@^0.1.0
- Removedassertion-error@1.0.0(transitive)
- Removedbit-mask@0.0.2-alpha(transitive)
- Removedchai@1.10.0(transitive)
- Removedchai-fs@0.1.0(transitive)
- Removedprime@0.0.5-alpha(transitive)
Updatedchai@^3.5.0