Skip to content

Commit d4460ad

Browse files
author
Marc Rooding
committed
Filter out empty after steps added by the screenshot hook
1 parent f95a9c7 commit d4460ad

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/html_formatter.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ module.exports = (function () {
2929
});
3030
}
3131

32+
/**
33+
* Checks if the step is an empty After step
34+
* @param step - object which contains step data
35+
* @returns boolean
36+
*/
37+
function isEmptyAfterStep(step) {
38+
return step.keyword.trim() === 'After' && step.name === undefined;
39+
}
40+
3241
/**
3342
* Checks if the step is an After step containing a screenshot
3443
* @param step - object which contains step data
@@ -168,6 +177,10 @@ module.exports = (function () {
168177
for (var k = 0; k < testResults[i].elements[j].steps.length; k++) {
169178
step = testResults[i].elements[j].steps[k];
170179

180+
if(isEmptyAfterStep(step)) {
181+
continue;
182+
}
183+
171184
if (isAfterStepWithScreenshot(step)) {
172185
stepsHtml += getAfterScreenshotStep(step);
173186
} else {

0 commit comments

Comments
 (0)