diff --git a/lib/actor.js b/lib/actor.js index 5b4332b68..a53a03fe4 100644 --- a/lib/actor.js +++ b/lib/actor.js @@ -13,15 +13,18 @@ const output = require('./output'); */ class Actor { /** - * add print comment method` + * Print the comment on log. Also, adding a step in the `Test.steps` object * @param {string} msg * @param {string} color * @inner * * ⚠️ returns a promise which is synchronized internally by recorder */ - say(msg, color = 'cyan') { - return recorder.add(`say ${msg}`, () => { + async say(msg, color = 'cyan') { + const step = new Step('say', 'say'); + step.status = 'passed'; + return recordStep(step, [msg]).then(() => { + // this is backward compatibility as this event may be used somewhere event.emit(event.step.comment, msg); output.say(msg, `${color}`); }); diff --git a/lib/step.js b/lib/step.js index f57dc2dc8..c9184fad3 100644 --- a/lib/step.js +++ b/lib/step.js @@ -119,7 +119,9 @@ class Step { } let result; try { - result = this.helper[this.helperMethod].apply(this.helper, this.args); + if (this.helperMethod !== 'say') { + result = this.helper[this.helperMethod].apply(this.helper, this.args); + } this.setStatus('success'); } catch (err) { this.setStatus('failed');