refactor(bruno): migrate API tests to Bruno DSL format
- Convert all existing .bru files from JSON to Bruno DSL format - Remove obsolete files (conflicts/api.bru, kobo/Kobo Initialization.bru) - Update auth configuration to use 'inherit' instead of explicit bearer tokens - Add comprehensive documentation to all test files - Improve test scripts with proper assertions and error handling
This commit is contained in:
@@ -1,21 +1,61 @@
|
||||
meta {
|
||||
name: "Get Device Sidecar Config"
|
||||
name: Get Device Sidecar Config
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/devices/{{device_id}}/sidecar
|
||||
auth: {
|
||||
type: bearer
|
||||
bearer: {{user_token}}
|
||||
}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
response.status == 200
|
||||
response.body.version == "1.0"
|
||||
response.body.bookhoard exists()
|
||||
response.body.books exists()
|
||||
response.body.collections exists()
|
||||
headers {
|
||||
Authorization: Bearer {{user_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const body = res.getBody();
|
||||
tests('Version is 1.0', body.version === "1.0");
|
||||
tests('Has bookhoard config', body.bookhoard !== undefined);
|
||||
tests('Has books array', body.books !== undefined);
|
||||
tests('Has collections array', body.collections !== undefined);
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Device Sidecar Config
|
||||
|
||||
Retrieves sidecar configuration for a specific device.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/devices/{device_id}/sidecar
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `device_id` (string): Device UUID
|
||||
|
||||
**Response:**
|
||||
- `version` (string): Sidecar version (e.g., "1.0")
|
||||
- `bookhoard` (object): Bookhoard configuration
|
||||
- `books` (array): Array of book configurations
|
||||
- `collections` (array): Array of collection configurations
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Device not found
|
||||
- 500: Internal server error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user