test(bruno): Add API tests for Kobo, Koreader, OPDS, collections

- Add Kobo bookmark/markup sync tests
- Add Koreader progress/bookmark sync tests
- Add OPDS feed tests
- Add collection tests
- Add sync tests for book linking
This commit is contained in:
2026-01-31 22:32:56 -05:00
parent 0a97b679a6
commit d6d208c3d1
33 changed files with 936 additions and 0 deletions
@@ -0,0 +1,39 @@
meta {
name: "KOReader Sync Annotations - Per-Annotation SHA-256"
type: http
seq: 4
}
post {
url: {{base_url}}/api/v1/koreader/sync/bookmarks
body: json({
"book_uuid": "{{book_uuid}}",
"highlights": [
{
"text": "Quote from book 1",
"pos0": "/6/4[chap1ref]!/4/2/1:0",
"pos1": "/6/4[chap1ref]!/4/2/1:50",
"color": "#ffff00",
"page": 10,
"book_sha256": "{{book_sha256}}"
},
{
"text": "Quote from book 2 (different book)",
"pos0": "/6/4[chap1ref]!/4/2/1:0",
"pos1": "/6/4[chap1ref]!/4/2/1:50",
"color": "#00ff00",
"page": 15,
"book_sha256": "{{another_book_sha256}}"
}
]
})
auth: {
type: bearer
bearer: {{koreader_device_token}}
}
}
assert {
response.status == 200
response.body.highlights_synced >= 0
}
@@ -0,0 +1,47 @@
meta {
name: "KOReader Sync Bookmarks - Enhanced with SHA-256"
type: http
seq: 3
}
post {
url: {{base_url}}/api/v1/koreader/sync/bookmarks
body: json({
"book_sha256": "{{book_sha256}}",
"bookmarks": [
{
"text": "Important passage about chapter 3",
"pos0": "/6/4[chap3ref]!/4/2/1:0",
"page": 45,
"type": "bookmark"
}
],
"notes": [
{
"notes": "My note about this section",
"pos0": "/6/4[chap3ref]!/4/2/1:100",
"page": 47,
"text": "Quoted text from the book"
}
],
"highlights": [
{
"text": "This is highlighted text",
"pos0": "/6/4[chap3ref]!/4/2/1:50",
"pos1": "/6/4[chap3ref]!/4/2/1:100",
"color": "#ffff00",
"page": 50
}
]
})
auth: {
type: bearer
bearer: {{koreader_device_token}}
}
}
assert {
response.status == 200
response.body.sync_status == "completed"
response.body.total_synced >= 0
}
@@ -0,0 +1,29 @@
meta {
name: "KOReader Sync Progress - Priority Matching (SHA-256 only)"
type: http
seq: 2
}
post {
url: {{base_url}}/api/v1/koreader/sync/progress
body: json({
"sync_mode": "immediate",
"books": [
{
"sha256": "{{book_sha256}}",
"file_path": "/mnt/onboard/Unknown%20Book.epub",
"percentage": 0.45,
"page": 89,
"total_pages": 200
}
]
})
auth: {
type: bearer
bearer: {{koreader_device_token}}
}
}
assert {
response.status == 200 || response.status == 202
}
@@ -0,0 +1,37 @@
meta {
name: "KOReader Sync Progress - Enhanced with SHA-256"
type: http
seq: 1
}
post {
url: {{base_url}}/api/v1/koreader/sync/progress
body: json({
"sync_mode": "immediate",
"books": [
{
"uuid": "{{book_uuid}}",
"sha256": "{{book_sha256}}",
"file_path": "/mnt/onboard/The%20Hobbit.epub",
"percentage": 0.65,
"chapter": 5,
"page": 142,
"total_pages": 310,
"epubcfi": "/6/4[chap1ref]!/4/2/1:0",
"last_read": "2026-01-31T12:00:00Z",
"title": "The Hobbit",
"authors": ["J.R.R. Tolkien"]
}
]
})
auth: {
type: bearer
bearer: {{koreader_device_token}}
}
}
assert {
response.status == 200 || response.status == 202
response.body.sync_status exists()
response.body.books_synced >= 0
}