MCPcopy
hub / github.com/codeceptjs/CodeceptJS / step

Function step

lib/output.js:143–164  ·  view source on GitHub ↗

* Print a step * @param {CodeceptJS.Step} step

(step)

Source from the content-addressed store, hash-verified

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: {

Callers

nothing calls this directly

Calls 8

shouldMaskDataFunction · 0.90
maskDataFunction · 0.90
getMaskConfigFunction · 0.90
truncateFunction · 0.85
hasBDDAncestorMethod · 0.80
printFunction · 0.70
toCliStyledMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected