Skip to content

Commit c1bc4e9

Browse files
inancgumuska3de
authored andcommitted
Improve clear cookies example
1 parent 395443e commit c1bc4e9

File tree

1 file changed

+4
-1
lines changed
  • src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser/02 BrowserContext

1 file changed

+4
-1
lines changed

src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser/02 BrowserContext/clearCookies.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ export default async function () {
2929
const context = browser.newContext();
3030
const page = context.newPage();
3131

32-
await page.goto('https://test.k6.io/');
32+
await page.goto('https://httpbin.org/cookies/set?testcookie=testcookievalue');
33+
console.log(context.cookies().length); // prints: 1
34+
3335
context.clearCookies();
36+
console.log(context.cookies().length); // prints: 0
3437
}
3538
```
3639

0 commit comments

Comments
 (0)