Analytics: - Reading stats endpoint tests - Device usage tests - Popular books tests Books: - Bulk delete tests - Bulk update tests Collections: - Bulk add books to collections tests Conflicts: - Bulk resolve conflicts tests - Bulk dismiss conflicts tests - Bulk resolve highest progress tests All tests cover no user, user, and admin contexts
50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
{
|
|
"meta": {
|
|
"name": "Bulk Add Books to Collections",
|
|
"type": "http",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"// Test bulk add to collections response",
|
|
"if (response.status === 200) {",
|
|
" tests['Bulk add successful'] = true;",
|
|
" const body = JSON.parse(response.body);",
|
|
" tests['Has results array'] = Array.isArray(body.results);",
|
|
" tests('All operations processed', body.results.length > 0);",
|
|
"} else {",
|
|
" tests['Bulk add failed'] = false;",
|
|
"}"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"req": {
|
|
"url": "{{baseUrl}}/api/collections/bulk-add-books",
|
|
"method": "POST",
|
|
"headers": {
|
|
"Content-Type": "application/json",
|
|
"Authorization": "Bearer {{authToken}}"
|
|
},
|
|
"body": {
|
|
"operations": [
|
|
{
|
|
"collection_id": "{{collectionId1}}",
|
|
"book_ids": [
|
|
"{{bookId1}}",
|
|
"{{bookId2}}"
|
|
]
|
|
},
|
|
{
|
|
"collection_id": "{{collectionId2}}",
|
|
"book_ids": [
|
|
"{{bookId3}}"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|