MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / _failed

Method _failed

lib/helper/Playwright.js:3083–3112  ·  view source on GitHub ↗
(test)

Source from the content-addressed store, hash-verified

3081 }
3082
3083 async _failed(test) {
3084 await this._withinEnd()
3085
3086 if (!test.artifacts) {
3087 test.artifacts = {}
3088 }
3089
3090 if (this.options.recordVideo && this.page && this.page.video()) {
3091 test.artifacts.video = saveVideoForPage(this.page, `${test.title}.failed`)
3092 for (const sessionName in this.sessionPages) {
3093 if (sessionName === '') continue
3094 test.artifacts[`video_${sessionName}`] = saveVideoForPage(this.sessionPages[sessionName], `${sessionName}_${test.title}.failed`)
3095 }
3096 }
3097
3098 if (this.options.trace) {
3099 test.artifacts.trace = await saveTraceForContext(this.browserContext, `${test.title}.failed`)
3100 for (const sessionName in this.sessionPages) {
3101 if (sessionName === '') continue
3102 const sessionPage = this.sessionPages[sessionName]
3103 const sessionContext = sessionPage.context()
3104 if (!sessionContext || !sessionContext.tracing) continue
3105 test.artifacts[`trace_${sessionName}`] = await saveTraceForContext(sessionContext, `${sessionName}_${test.title}.failed`)
3106 }
3107 }
3108
3109 if (this.options.recordHar) {
3110 test.artifacts.har = this.currentRunningTest.artifacts.har
3111 }
3112 }
3113
3114 async _passed(test) {
3115 if (this.options.recordVideo && this.page && this.page.video()) {

Callers

nothing calls this directly

Calls 3

_withinEndMethod · 0.95
saveVideoForPageFunction · 0.85
saveTraceForContextFunction · 0.85

Tested by

no test coverage detected