File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ module.exports = (function () {
38
38
return step . keyword . trim ( ) === 'After' && step . name === undefined && step . embeddings === undefined ;
39
39
}
40
40
41
+ /**
42
+ * Checks if the step is an empty Before step
43
+ * @param step - object which contains step data
44
+ * @returns boolean
45
+ */
46
+ function isEmptyBeforeStep ( step ) {
47
+ return step . keyword . trim ( ) === 'Before' && step . name === undefined && step . embeddings === undefined ;
48
+ }
49
+
41
50
/**
42
51
* Checks if the step is an After step containing a screenshot
43
52
* @param step - object which contains step data
@@ -62,7 +71,7 @@ module.exports = (function () {
62
71
return compiled ( {
63
72
status : step . result ? step . result . status : '' ,
64
73
errorDetails : step . result ? toHtmlEntities ( step . result . error_message ) : '' ,
65
- name : step . keyword + step . name ,
74
+ name : step . keyword + ( step . name ? step . name : '' ) ,
66
75
dataTable : step . rows ? step . rows : ''
67
76
} ) ;
68
77
}
@@ -178,7 +187,7 @@ module.exports = (function () {
178
187
for ( var k = 0 ; k < testResults [ i ] . elements [ j ] . steps . length ; k ++ ) {
179
188
step = testResults [ i ] . elements [ j ] . steps [ k ] ;
180
189
181
- if ( isEmptyAfterStep ( step ) ) {
190
+ if ( isEmptyAfterStep ( step ) || isEmptyBeforeStep ( step ) ) {
182
191
continue ;
183
192
}
184
193
Original file line number Diff line number Diff line change 16
16
"description" : " " ,
17
17
"type" : " scenario" ,
18
18
"steps" : [
19
+ {
20
+ "keyword" : " Before " ,
21
+ "hidden" : true ,
22
+ "result" : {
23
+ "status" : " passed" ,
24
+ "duration" : 11258903
25
+ },
26
+ "match" : {
27
+ "location" : " ...\\ src\\ test\\ hooks.js:2"
28
+ }
29
+ },
19
30
{
20
31
"name" : " I login as teacher" ,
21
32
"line" : 4 ,
You can’t perform that action at this time.
0 commit comments