diff --git a/lib/reporter.js b/lib/reporter.js index 92f3953..ba117ba 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -186,6 +186,23 @@ var generateReport = function (options) { } }; + var parseScenarioHooks = function(data) { + return data.map(step => { + const match = step.match && step.match.location ? step.match : {location: 'can not be determined'}; + + if(step.embeddings == undefined){ + return {} + } + + return { + arguments: step.arguments || [], + result: step.result, + match, + embeddings: step.embeddings || [] + } + }) + }; + var setStats = function (suite) { var featureOutput = suite.features; var topLevelFeatures = []; @@ -218,6 +235,19 @@ var generateReport = function (options) { return; } + if (feature.elements) { + feature.elements.map(scenario => { + const {before, after} = scenario; + + if (before) { + scenario.steps = parseScenarioHooks(before).concat(scenario.steps); + } + if (after) { + scenario.steps = scenario.steps.concat(parseScenarioHooks(after)); + } + }) + } + feature.elements.forEach(function (element) { element.passed = 0; element.failed = 0;