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

Method healFailedStep

lib/ai.js:187–202  ·  view source on GitHub ↗
(failureContext)

Source from the content-addressed store, hash-verified

185 }
186
187 async healFailedStep(failureContext) {
188 if (!this.isEnabled) return []
189 if (!failureContext.html) throw new Error('No HTML context provided')
190
191 await this.setHtmlContext(failureContext.html)
192
193 if (!this.minifiedHtml) {
194 debug('HTML context is empty after removing non-interactive elements & minification')
195 return []
196 }
197
198 const response = await this.createCompletion(this.prompts.healStep(this.minifiedHtml, failureContext))
199 if (!response) return []
200
201 return this.config.response(response)
202 }
203
204 /**
205 *

Callers 2

heal.jsFile · 0.80
ai_test.jsFile · 0.80

Calls 4

setHtmlContextMethod · 0.95
createCompletionMethod · 0.95
debugFunction · 0.85
healStepMethod · 0.80

Tested by

no test coverage detected