Merge main into nomorebreaking
This commit is contained in:
@@ -90,6 +90,10 @@
|
||||
"key": "avatarFile",
|
||||
"value": "postman/avatar.png"
|
||||
},
|
||||
{
|
||||
"key": "avatarUrl",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "bulkPetId",
|
||||
"value": ""
|
||||
@@ -117,6 +121,10 @@
|
||||
{
|
||||
"key": "bulkInventoryId",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "adoptedPetId",
|
||||
"value": "4"
|
||||
}
|
||||
],
|
||||
"item": [
|
||||
@@ -212,6 +220,7 @@
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"var jsonData = pm.response.json();",
|
||||
"if (jsonData.id !== undefined) pm.collectionVariables.set('userId', jsonData.id);",
|
||||
"if (jsonData.token) pm.collectionVariables.set('customerToken', jsonData.token);"
|
||||
]
|
||||
}
|
||||
@@ -307,7 +316,9 @@
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});"
|
||||
"});",
|
||||
"var jsonData = pm.response.json();",
|
||||
"if (jsonData.id !== undefined) pm.collectionVariables.set('userId', jsonData.id);"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -381,7 +392,8 @@
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"var jsonData = pm.response.json();",
|
||||
"pm.expect(jsonData.avatarUrl).to.be.a('string');"
|
||||
"pm.expect(jsonData.avatarUrl).to.be.a('string');",
|
||||
"pm.collectionVariables.set('avatarUrl', jsonData.avatarUrl);"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -414,7 +426,68 @@
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"var jsonData = pm.response.json();",
|
||||
"pm.expect(jsonData.avatarUrl).to.be.a('string');"
|
||||
"pm.expect(jsonData.avatarUrl).to.be.a('string');",
|
||||
"pm.collectionVariables.set('avatarUrl', jsonData.avatarUrl);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get My Avatar File",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}{{avatarUrl}}",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{customerToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"pm.test('Avatar response is an image', function () {",
|
||||
" pm.expect(pm.response.headers.get('Content-Type')).to.include('image/');",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get User Avatar File As Staff",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/api/v1/users/{{userId}}/avatar/file",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"pm.test('Avatar response is an image', function () {",
|
||||
" pm.expect(pm.response.headers.get('Content-Type')).to.include('image/');",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -662,6 +735,95 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Upload Pet Image",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{petId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "image",
|
||||
"type": "file",
|
||||
"src": "{{avatarFile}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"var jsonData = pm.response.json();",
|
||||
"pm.expect(jsonData.imageUrl).to.be.a('string');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get Pet Image Public",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{petId}}/image"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"pm.test('Pet image response is an image', function () {",
|
||||
" pm.expect(pm.response.headers.get('Content-Type')).to.include('image/');",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Delete Pet Image",
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{petId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Delete Pet",
|
||||
"request": {
|
||||
@@ -769,6 +931,120 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Upload Adopted Pet Image",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{adoptedPetId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "image",
|
||||
"type": "file",
|
||||
"src": "{{avatarFile}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get Adopted Pet Image Public",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{adoptedPetId}}/image"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 403', function () {",
|
||||
" pm.response.to.have.status(403);",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get Adopted Pet Image As Staff",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{adoptedPetId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"pm.test('Pet image response is an image', function () {",
|
||||
" pm.expect(pm.response.headers.get('Content-Type')).to.include('image/');",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Delete Adopted Pet Image",
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"url": "{{baseUrl}}/api/v1/pets/{{adoptedPetId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1015,6 +1291,95 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Upload Product Image",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "{{baseUrl}}/api/v1/products/{{productId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{staffToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "image",
|
||||
"type": "file",
|
||||
"src": "{{avatarFile}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"var jsonData = pm.response.json();",
|
||||
"pm.expect(jsonData.imageUrl).to.be.a('string');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get Product Image",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "{{baseUrl}}/api/v1/products/{{productId}}/image"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});",
|
||||
"pm.test('Product image response is an image', function () {",
|
||||
" pm.expect(pm.response.headers.get('Content-Type')).to.include('image/');",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Delete Product Image",
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"url": "{{baseUrl}}/api/v1/products/{{productId}}/image",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{adminToken}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status code is 200', function () {",
|
||||
" pm.response.to.have.status(200);",
|
||||
"});"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -4468,4 +4833,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user