Skip to content

Commit 13a8a93

Browse files
committed
Merge branch 'test/cookies-testbench' into feature/playwright
2 parents b612655 + 721fc06 commit 13a8a93

37 files changed

+469
-30
lines changed

.github/workflows/npm-bru-cli.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,18 @@ jobs:
3838

3939
- name: Run tests
4040
run: |
41-
cd packages/bruno-tests/collection
41+
cd packages/bruno-tests
4242
npm install
43-
bru run --env Prod --output junit.xml --format junit
43+
npm run dev 1>/tmp/tesbench-server-logs.txt 2>&1 &
44+
cd collection
45+
bru run --env Prod --cacert ../ssl/localhost.crt --output junit.xml --format junit
46+
47+
- uses: actions/upload-artifact@v4
48+
if: ${{ !cancelled() }}
49+
with:
50+
name: tesbench-server-logs
51+
path: /tmp/tesbench-server-logs.txt
52+
retention-days: 7
4453

4554
- name: Publish Test Report
4655
uses: dorny/test-reporter@v2
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: cookies
3+
seq: 13
4+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
meta {
2+
name: simple cookie response
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: {{host}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": "foo=bar"
18+
},
19+
"content": "hello"
20+
}
21+
}
22+
23+
assert {
24+
res.headers["set-cookie"][0]: eq foo=bar
25+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test secure+https
3+
seq: 3
4+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: {{remote_host}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": [
18+
"secure-https=val; Secure",
19+
"nosecure-https-key2=val"
20+
]
21+
},
22+
"content": "hello"
23+
}
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
meta {
2+
name: verify the cookie in http request
3+
type: http
4+
seq: 3
5+
}
6+
7+
post {
8+
url: {{remote_host_http}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: notContains secure-https=val
15+
res.body.headers.cookie: contains nosecure-https-key2=val
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: {{remote_host}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: contains secure-https=val
15+
res.body.headers.cookie: contains nosecure-https-key2=val
16+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test secure+local-ipv4+http
3+
seq: 6
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: http://127.0.0.1:{{local_http_port}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": "secure-local-ipv4-http=val; Secure"
18+
},
19+
"content": "hello"
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: http://127.0.0.1:{{local_http_port}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: contains secure-local-ipv4-http=val
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test secure+local-ipv4+https
3+
seq: 7
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: https://127.0.0.1:{{local_https_port}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": "secure-local-ipv4-https=val; Secure"
18+
},
19+
"content": "hello"
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: https://127.0.0.1:{{local_https_port}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: contains secure-local-ipv4-https=val
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test secure+localhost+http
3+
seq: 4
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: http://localhost:{{local_http_port}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": "secure-localhost-http=val; Secure"
18+
},
19+
"content": "hello"
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: http://localhost:{{local_http_port}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: contains secure-localhost-http=val
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test secure+localhost+https
3+
seq: 5
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: https://localhost:{{local_https_port}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": "secure-localhost-https=val; Secure"
18+
},
19+
"content": "hello"
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: https://localhost:{{local_https_port}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: contains secure-localhost-https=val
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test secure+non-local+http
3+
seq: 8
4+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: http://internal:{{local_http_port}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": [
18+
"secure-non-local-http=val; Secure",
19+
"secure-non-local-http-key2=val"
20+
]
21+
},
22+
"content": "hello"
23+
}
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: http://internal:{{local_http_port}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: notContains secure-non-local-http=val
15+
res.body.headers.cookie: contains secure-non-local-http-key2=val
16+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta {
2+
name: test set-cookie basic
3+
seq: 1
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
meta {
2+
name: set the cookie
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: {{host}}/api/echo/custom
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type": "text/plain",
16+
"headers": {
17+
"set-cookie": "basic=val"
18+
},
19+
"content": "hello"
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: verify the cookie in request
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: {{host}}/api/echo/trace
9+
body: none
10+
auth: inherit
11+
}
12+
13+
assert {
14+
res.body.headers.cookie: contains basic=val
15+
}

0 commit comments

Comments
 (0)