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

Function loadCookiesFromFile

lib/plugin/auth.js:413–425  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

411}
412
413function loadCookiesFromFile(config) {
414 for (const name in config.users) {
415 const fileName = path.join(store.outputDir, `${name}_session.json`)
416 if (!fileExists(fileName)) continue
417 const data = fs.readFileSync(fileName).toString()
418 try {
419 store[`${name}_session`] = JSON.parse(data)
420 } catch (err) {
421 throw new Error(`Could not load session from ${fileName}\n${err}`)
422 }
423 output.debug(`Loaded user session for ${name}`)
424 }
425}
426
427function isPlaywrightSession() {
428 return !!container.helpers('Playwright')

Callers 2

auth.jsFile · 0.85
loginFunctionFunction · 0.85

Calls 3

fileExistsFunction · 0.90
debugMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected