(failureContext)
| 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 | * |
no test coverage detected