* {{> clearCookie }}
(name)
| 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. |
no test coverage detected