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

Function wireOnStep

lib/plugin/screenshot.js:137–151  ·  view source on GitHub ↗
(options, filter)

Source from the content-addressed store, hash-verified

135}
136
137function wireOnStep(options, filter) {
138 let currentTest = null
139 let stepCount = 0
140 event.dispatcher.on(event.test.before, test => {
141 currentTest = test
142 stepCount = 0
143 })
144 event.dispatcher.on(event.step.after, step => {
145 if (!currentTest) return
146 if (!filter(step)) return
147 stepCount++
148 const name = `${testToFileName(currentTest, { suffix: '', unique: options.uniqueScreenshotNames })}.step_${stepCount}.png`
149 scheduleScreenshot(currentTest, name, options)
150 })
151}
152
153function wireOnUrl(options, pattern) {
154 let currentTest = null

Callers 1

screenshot.jsFile · 0.85

Calls 2

testToFileNameFunction · 0.90
scheduleScreenshotFunction · 0.85

Tested by

no test coverage detected