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

Method _init

lib/helper/Puppeteer.js:326–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

324 }
325
326 async _init() {
327 // Load puppeteer dynamically with fallback
328 if (!puppeteer) {
329 try {
330 const puppeteerModule = await import('puppeteer')
331 puppeteer = puppeteerModule.default || puppeteerModule
332 this.debugSection('Puppeteer', `Loaded puppeteer successfully, launch available: ${!!puppeteer.launch}`)
333 } catch (e) {
334 try {
335 const puppeteerModule = await import('puppeteer-core')
336 puppeteer = puppeteerModule.default || puppeteerModule
337 this.debugSection('Puppeteer', `Loaded puppeteer-core successfully, launch available: ${!!puppeteer.launch}`)
338 } catch (e2) {
339 throw new Error('Neither puppeteer nor puppeteer-core could be loaded. Please install one of them.')
340 }
341 }
342 } else {
343 this.debugSection('Puppeteer', `Puppeteer already loaded, launch available: ${!!puppeteer.launch}`)
344 }
345 }
346
347 _beforeSuite() {
348 if (!this.options.restart && !this.options.manualStart && !this.isRunning) {

Callers 3

createHelpersFunction · 0.45
loadSupportObjectFunction · 0.45
check.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected