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 () {
48
48
name: ' testcookie' ,
49
49
value: ' 1' ,
50
50
sameSite: ' Strict' ,
51
- domain: ' 127.0.0.1 ' ,
51
+ domain: ' httpbin.org ' ,
52
52
path: ' /' ,
53
53
httpOnly: true ,
54
54
secure: true ,
@@ -58,7 +58,7 @@ export default async function () {
58
58
name: ' testcookie2' ,
59
59
value: ' 2' ,
60
60
sameSite: ' Lax' ,
61
- domain: ' 127.0.0.1 ' ,
61
+ domain: ' httpbin.org ' ,
62
62
path: ' /' ,
63
63
expires: dayAfter,
64
64
},
@@ -67,11 +67,18 @@ export default async function () {
67
67
name: ' testcookie3' ,
68
68
value: ' 3' ,
69
69
sameSite: ' Lax' ,
70
- domain: ' 127.0.0.1 ' ,
70
+ domain: ' httpbin.org ' ,
71
71
path: ' /' ,
72
72
expires: dayBefore
73
73
}
74
74
]);
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"}}
75
82
} finally {
76
83
page .close ();
77
84
}
You can’t perform that action at this time.
0 commit comments