MCPcopy
hub / github.com/vercel/next.js / addCookie

Method addCookie

test/lib/browsers/playwright.ts:397–407  ·  view source on GitHub ↗
(opts: { name: string; value: string })

Source from the content-addressed store, hash-verified

395 )
396 }
397 addCookie(opts: { name: string; value: string }) {
398 return this.startOrPreserveChain(async () =>
399 context!.addCookies([
400 {
401 path: '/',
402 domain: await page.evaluate('window.location.hostname'),
403 ...opts,
404 },
405 ])
406 )
407 }
408 deleteCookies() {
409 return this.startOrPreserveChain(async () => context!.clearCookies())
410 }

Calls 3

startOrPreserveChainMethod · 0.95
addCookiesMethod · 0.80
evaluateMethod · 0.45

Tested by 2

testsFunction · 0.64
runTestsFunction · 0.64