cucumber-html-reporter
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -29,4 +29,4 @@ /*-----------------------------------------------------------------------------------------*\ | ||
function generateReport(options) { | ||
return reporter.generate(options); | ||
function generateReport(options, callback) { | ||
return reporter.generate(options, callback); | ||
} | ||
@@ -33,0 +33,0 @@ |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var jsonDir = require('./jsonDir'); | ||
var open = require('open'); | ||
var opn = require('opn'); | ||
var searchFileUp = require('./searchFileUp'); | ||
@@ -36,3 +36,6 @@ var hierarchyReporter = require('./hierarchyReporter'); | ||
failed: 0, | ||
ambiguous: 0 | ||
ambiguous: 0, | ||
skipped: 0, | ||
notdefined: 0, | ||
pending: 0 | ||
}; | ||
@@ -83,2 +86,12 @@ | ||
function getColumnLayoutWidth() { | ||
const FULL_WIDTH = 12; | ||
const HALF_WIDTH = 6; | ||
if(options.columnLayout === 1) { | ||
return FULL_WIDTH; | ||
} else { | ||
return HALF_WIDTH; | ||
} | ||
} | ||
/** | ||
@@ -153,6 +166,7 @@ * Make human-readable duration for scenario steps | ||
var getFeaturesTemplate = function (suite) { | ||
return _.template(readFileForRespectiveTemplates('features.tmpl'))({ | ||
return _.template(readFileForRespectiveTemplates('features.html'))({ | ||
suite: suite, | ||
_: _, | ||
calculateDuration: calculateDuration, | ||
columnLayoutWidth: getColumnLayoutWidth(), | ||
decideScenarioTitlePadding: preventOverlappingTheScenarioTitle | ||
@@ -197,2 +211,3 @@ }); | ||
feature.scenarios.ambiguous = 0; | ||
feature.scenarios.count = 0; | ||
feature.time = 0; | ||
@@ -268,2 +283,7 @@ featuresSummary.isFailed = false; | ||
} | ||
} else { | ||
var file = 'data:application/octet-stream;base64,' + embedding.data; | ||
var fileType = embedding.mime_type.split('/')[1]; | ||
step.text = step.text || ''; | ||
step.text = step.text.concat('<a href="'+file+'" download="file.'+fileType+'">download file</a>'); | ||
} | ||
@@ -302,2 +322,4 @@ }); | ||
feature.scenarios.count++; | ||
if (element.failed > 0) { | ||
@@ -353,2 +375,11 @@ feature.scenarios.failed++; | ||
subSuite ? hierarchyReporter.recursivelyIncrementStat(subSuite, 'ambiguous') : suite.ambiguous++; | ||
} else if (feature.scenarios.count === feature.scenarios.skipped) { | ||
featuresSummary.skipped++; | ||
subSuite ? hierarchyReporter.recursivelyIncrementStat(subSuite, 'passed') : suite.passed++; | ||
} else if (feature.scenarios.count === feature.scenarios.notdefined) { | ||
featuresSummary.notdefined++; | ||
subSuite ? hierarchyReporter.recursivelyIncrementStat(subSuite, 'passed') : suite.passed++; | ||
} else if (feature.scenarios.count === feature.scenarios.pending) { | ||
featuresSummary.pending++; | ||
subSuite ? hierarchyReporter.recursivelyIncrementStat(subSuite, 'passed') : suite.passed++; | ||
} else { | ||
@@ -405,3 +436,3 @@ featuresSummary.passed++; | ||
options.output, | ||
_.template(readFile('index.tmpl'))({ | ||
_.template(readFile('index.html'))({ | ||
suite: suite, | ||
@@ -439,3 +470,3 @@ features: getFeaturesTemplate(suite), | ||
if (fs.existsSync(options.output) && (options.launchReport || options.launchReport === 'true')) { | ||
open(options.output); | ||
opn(options.output); | ||
} | ||
@@ -442,0 +473,0 @@ } |
{ | ||
"name": "cucumber-html-reporter", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Generates Cucumber HTML reports in three different themes", | ||
@@ -54,2 +54,26 @@ "main": "index.js", | ||
"url": "https://github.com/klimenko4" | ||
}, | ||
{ | ||
"name": "telaoumatenyanis", | ||
"url": "https://github.com/telaoumatenyanis" | ||
}, | ||
{ | ||
"name": "jingfuxiang", | ||
"url": "https://github.com/jingfuxiang" | ||
}, | ||
{ | ||
"name": "StefanPi-gfk", | ||
"url": "https://github.com/StefanPi-gfk" | ||
}, | ||
{ | ||
"name": "binalabs", | ||
"url": "https://github.com/binalabs" | ||
}, | ||
{ | ||
"name": "rakeshkumar5b4", | ||
"url": "https://github.com/rakeshkumar5b4" | ||
}, | ||
{ | ||
"name": "xywang68", | ||
"url": "https://github.com/xywang68" | ||
} | ||
@@ -85,3 +109,3 @@ ], | ||
"lodash": "^4.17.2", | ||
"open": "0.0.5" | ||
"opn": "5.3.0" | ||
}, | ||
@@ -88,0 +112,0 @@ "devDependencies": { |
@@ -170,2 +170,12 @@ # cucumber-html-reporter | ||
#### `columnLayout` | ||
Available: `[1, 2]` | ||
Type: `Number` | ||
Default: 2 | ||
Select the Column Layout. One column or Two columns | ||
1 = One Column layout (col-xx-12) | ||
2 = Two Columns Layout (col-xx-6) | ||
#### `storeScreenshots` | ||
@@ -172,0 +182,0 @@ Type: `Boolean` |
$('a.toggle').on('click', function() { | ||
if ($(this).text() === 'Screenshot -') { | ||
$(this).text('Screenshot +'); | ||
// $(this).text('Screenshot +'); | ||
$(this).next('a.screenshot').find('img').hide(); | ||
} else { | ||
$(this).text('Screenshot -'); | ||
} else if($(this).text() === 'Screenshot +') { | ||
// $(this).text('Screenshot -'); | ||
$(this).next('a.screenshot').find('img').show(); | ||
} | ||
if ($(this).text().includes(' -')) { | ||
$(this).text($(this).text().replace(' -', ' +')); | ||
} else { | ||
$(this).text($(this).text().replace(' +', ' -')); | ||
} | ||
}); |
@@ -14,6 +14,8 @@ 'use strict'; | ||
Before({tags: '@testPassing'}, function (scenario, callback) { | ||
this.attach('Tests INFO will print here.<br>To attach INFO to Any steps, use scenario.attach function in your step definitions as shown below.<br><br>If you pass HTML\'s to scenario.attach then reporter will format accordingly <br>' + | ||
this.attach('Tests INFO will print here.' + | ||
'<br>To attach INFO to Any steps, use scenario.attach function in your step definitions as shown below.' + | ||
'<br><br>If you pass HTML\'s to scenario.attach then reporter will format accordingly <br>' + | ||
'<br>Simple String : scenario.attach(\'sample data\')' + | ||
'<br>Pretty JSON : scenario.attach(JSON.stringify(json, null, 2))' + | ||
'<br>HTML Link : scenario.attach(\'format the link with html-a tag\'', 'application/json'); | ||
'<br>HTML Link : scenario.attach(\'format the link with html-a tag\''); | ||
@@ -20,0 +22,0 @@ this.attach('some text'); |
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
1978878
2478
299
+ Addedopn@5.3.0
+ Addedis-wsl@1.1.0(transitive)
+ Addedopn@5.3.0(transitive)
- Removedopen@0.0.5
- Removedopen@0.0.5(transitive)