File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ module.exports = (text) => {
28
28
29
29
const runSteps = async ( steps ) => {
30
30
for ( const step of steps ) {
31
- event . emit ( event . bddStep . before , step ) ;
32
31
const metaStep = new Step . MetaStep ( null , step . text ) ;
33
32
metaStep . actor = step . keyword . trim ( ) ;
34
33
const setMetaStep = ( step ) => {
@@ -44,10 +43,19 @@ module.exports = (text) => {
44
43
if ( step . argument . type === 'DataTable' ) metaStep . comment = `\n${ transformTable ( step . argument ) } ` ;
45
44
if ( step . argument . content ) metaStep . comment = `\n${ step . argument . content } ` ;
46
45
}
46
+ step . startTime = Date . now ( ) ;
47
+ step . match = fn . line ;
48
+ event . emit ( event . bddStep . before , step ) ;
47
49
event . dispatcher . on ( event . step . before , setMetaStep ) ;
48
50
try {
49
51
await fn ( ...fn . params ) ;
52
+ step . status = 'passed' ;
53
+ } catch ( err ) {
54
+ step . status = 'failed' ;
55
+ step . err = err ;
56
+ return err ;
50
57
} finally {
58
+ step . endTime = Date . now ( ) ;
51
59
event . dispatcher . removeListener ( event . step . before , setMetaStep ) ;
52
60
}
53
61
event . emit ( event . bddStep . after , step ) ;
You can’t perform that action at this time.
0 commit comments