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

Method clearCookie

lib/helper/Puppeteer.js:1946–1954  ·  view source on GitHub ↗

* {{> clearCookie }}

(name)

Source from the content-addressed store, hash-verified

1944 * {{> clearCookie }}
1945 */
1946 async clearCookie(name) {
1947 const cookies = await this.page.cookies()
1948 if (!name) {
1949 return this.page.deleteCookie.apply(this.page, cookies)
1950 }
1951 const cookie = cookies.filter(c => c.name === name)
1952 if (!cookie[0]) return
1953 return this.page.deleteCookie(cookie[0])
1954 }
1955
1956 /**
1957 * If a function returns a Promise, tt will wait for its resolution.

Callers 5

_afterMethod · 0.95
testsFunction · 0.45

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected