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

Method _before

lib/helper/Puppeteer.js:354–370  ·  view source on GitHub ↗
(test)

Source from the content-addressed store, hash-verified

352 }
353
354 async _before(test) {
355 this.sessionPages = {}
356 this.currentRunningTest = test
357 recorder.retry({
358 retries: test?.opts?.conditionalRetries || 3,
359 when: err => {
360 if (!err || typeof err.message !== 'string') {
361 return false
362 }
363 // ignore context errors
364 return err.message.includes('context')
365 },
366 })
367 if (this.options.restart && !this.options.manualStart) return this._startBrowser()
368 if (!this.isRunning && !this.options.manualStart) return this._startBrowser()
369 return this.browser
370 }
371
372 async _after() {
373 if (!this.isRunning) return

Callers

nothing calls this directly

Calls 3

_startBrowserMethod · 0.95
includesMethod · 0.80
retryMethod · 0.65

Tested by

no test coverage detected