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,5 +1,5 @@
|
||||
meta {
|
||||
name: "Kobo Initialization - Enhanced with ContentId Mapping"
|
||||
name: Kobo Initialization
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
@@ -7,15 +7,49 @@ meta {
|
||||
get {
|
||||
url: {{base_url}}/api/v1/kobo/initialization
|
||||
body: none
|
||||
auth: {
|
||||
type: bearer
|
||||
bearer: {{device_token}}
|
||||
}
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
response.status == 200
|
||||
response.body.ContentId exists()
|
||||
response.body.Categories exists()
|
||||
response.body.BookhoardUUID exists()
|
||||
headers {
|
||||
Authorization: Bearer {{device_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const body = res.getBody();
|
||||
tests('Has ContentId', body.ContentId !== undefined);
|
||||
tests('Has Categories', body.Categories !== undefined);
|
||||
tests('Has BookhoardUUID', body.BookhoardUUID !== undefined);
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Kobo Initialization
|
||||
|
||||
Initializes Kobo device sync, returning device resources and account information.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/v1/kobo/initialization
|
||||
|
||||
**Authentication:** Bearer token (device token)
|
||||
|
||||
**Response:**
|
||||
- `ContentId` (string): Device content ID
|
||||
- `Categories` (array): Available categories/collections
|
||||
- `BookhoardUUID` (string): Bookhoard instance UUID
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user