* {{> grabCookie }} * * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
(name)
| 1899 | * Returns cookie in JSON format. If name not passed returns all cookies for this domain. |
| 1900 | */ |
| 1901 | async grabCookie(name) { |
| 1902 | const cookies = await this.page.cookies() |
| 1903 | if (!name) return cookies |
| 1904 | const cookie = cookies.filter(c => c.name === name) |
| 1905 | if (cookie[0]) return cookie[0] |
| 1906 | } |
| 1907 | |
| 1908 | /** |
| 1909 | * {{> waitForCookie }} |
no test coverage detected