File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser/02 BrowserContext Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export default async function () {
4848 name: ' testcookie' ,
4949 value: ' 1' ,
5050 sameSite: ' Strict' ,
51- domain: ' 127.0.0.1 ' ,
51+ domain: ' httpbin.org ' ,
5252 path: ' /' ,
5353 httpOnly: true ,
5454 secure: true ,
@@ -58,7 +58,7 @@ export default async function () {
5858 name: ' testcookie2' ,
5959 value: ' 2' ,
6060 sameSite: ' Lax' ,
61- domain: ' 127.0.0.1 ' ,
61+ domain: ' httpbin.org ' ,
6262 path: ' /' ,
6363 expires: dayAfter,
6464 },
@@ -67,11 +67,18 @@ export default async function () {
6767 name: ' testcookie3' ,
6868 value: ' 3' ,
6969 sameSite: ' Lax' ,
70- domain: ' 127.0.0.1 ' ,
70+ domain: ' httpbin.org ' ,
7171 path: ' /' ,
7272 expires: dayBefore
7373 }
7474 ]);
75+
76+ const response = await page .goto (' https://httpbin.org/cookies' , {
77+ waitUntil: ' networkidle' ,
78+ });
79+ console .log (response .json ());
80+ // prints:
81+ // {"cookies":{"testcookie":"1","testcookie2":"2"}}
7582 } finally {
7683 page .close ();
7784 }
You can’t perform that action at this time.
0 commit comments