* Print a step * @param {CodeceptJS.Step} step
(step)
| 141 | * @param {CodeceptJS.Step} step |
| 142 | */ |
| 143 | step(step) { |
| 144 | if (outputLevel === 0) return |
| 145 | if (!step) return |
| 146 | // Avoid to print non-gherkin steps, when gherkin is running for --steps mode |
| 147 | if (outputLevel === 1) { |
| 148 | if (typeof step === 'object' && step.hasBDDAncestor()) { |
| 149 | return |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | let stepLine = step.toCliStyled ? step.toCliStyled() : step.toString() |
| 154 | if (step.metaStep && outputLevel >= 1) { |
| 155 | // this.stepShift += 2; |
| 156 | stepLine = colors.dim(truncate(stepLine, output.stepShift)) |
| 157 | } |
| 158 | if (step.comment) { |
| 159 | stepLine += colors.grey(step.comment.split('\n').join('\n' + ' '.repeat(4))) |
| 160 | } |
| 161 | |
| 162 | const _stepLine = shouldMaskData() ? maskData(stepLine, getMaskConfig()) : stepLine |
| 163 | print(' '.repeat(this.stepShift), truncate(_stepLine, this.spaceShift)) |
| 164 | }, |
| 165 | |
| 166 | /** @namespace */ |
| 167 | suite: { |
nothing calls this directly
no test coverage detected