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,20 +1,57 @@
|
||||
meta {
|
||||
name: "Get System Configuration"
|
||||
name: Get System Configuration
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/system/config
|
||||
auth: {
|
||||
type: bearer
|
||||
bearer: {{admin_token}}
|
||||
}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
response.status == 200
|
||||
response.body.base_url exists()
|
||||
response.body.opds_base_url exists()
|
||||
response.body.api_base_url exists()
|
||||
headers {
|
||||
Authorization: Bearer {{admin_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const body = res.getBody();
|
||||
tests('Has base_url', body.base_url !== undefined);
|
||||
tests('Has opds_base_url', body.opds_base_url !== undefined);
|
||||
tests('Has api_base_url', body.api_base_url !== undefined);
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get System Configuration
|
||||
|
||||
Retrieves system-wide configuration settings.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/system/config
|
||||
|
||||
**Authentication:** Bearer token (admin only)
|
||||
|
||||
**Response:**
|
||||
- `base_url` (string): Base URL
|
||||
- `opds_base_url` (string): OPDS endpoint URL
|
||||
- `api_base_url` (string): API endpoint URL
|
||||
- Additional configuration fields
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin only)
|
||||
- 500: Internal server error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user