Added test requests for cookies and related changes in testbench server

In bruno-testbench(packages/bruno-tests) server
- Added support for customising response status-code in
`POST /api/echo/custom` API using `statusCode` field
- Added `/api/echo/trace` API which returns all the request details as
  an JSON response
- Added SSL support for `localhost` in dev env to test HTTPS requests
This commit is contained in:
ramki-bruno
2025-05-19 16:03:15 +05:30
parent 178773d63a
commit 8cf8321087
17 changed files with 339 additions and 8 deletions

View File

@@ -0,0 +1,4 @@
meta {
name: test secure+https,http
seq: 3
}

View File

@@ -0,0 +1,31 @@
meta {
name: set and verify
type: http
seq: 2
}
post {
url: {{remote_host}}/api/echo/custom
body: json
auth: inherit
}
body:json {
{
"type": "text/plain",
"headers": {
"set-cookie": [
"secure-https=val; Secure",
"nosecure-https-key2=val"
],
"location": "/api/echo/trace"
},
"statusCode": 302,
"content": "hello"
}
}
assert {
res.body.headers.cookie: contains secure-https=val
res.body.headers.cookie: contains nosecure-https-key2=val
}

View File

@@ -0,0 +1,16 @@
meta {
name: verify the cookie with http
type: http
seq: 3
}
post {
url: {{remote_host_http}}/api/echo/trace
body: none
auth: inherit
}
assert {
res.body.headers.cookie: notContains secure-https=val
res.body.headers.cookie: contains nosecure-https-key2=val
}