kopia lustrzana https://github.com/ahmetkotan/restpi
rodzic
9cdc17502d
commit
fce2e4b878
|
@ -90,7 +90,93 @@
|
||||||
"response": []
|
"response": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Get Pin",
|
"name": "Change Pin Mode",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
"var responseJSON;",
|
||||||
|
"try {",
|
||||||
|
" responseJSON = JSON.parse(responseBody); ",
|
||||||
|
"}catch(e){",
|
||||||
|
" console.log(\"Error.\");",
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"tests[\"Mode changed\"] = responseJSON.operation === true;"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"url": "{{raspi_url}}/pins/api/11",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "Bearer {{token}}",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\n\t\"mode\": 0\n}"
|
||||||
|
},
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Change Pin Value",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
"var responseJSON;",
|
||||||
|
"try {",
|
||||||
|
" responseJSON = JSON.parse(responseBody); ",
|
||||||
|
"}catch(e){",
|
||||||
|
" console.log(\"Error.\");",
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"tests[\"Value changed\"] = responseJSON.operation === true;"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"url": "{{raspi_url}}/pins/api/11",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "Bearer {{token}}",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\n\t\"value\": 1\n}"
|
||||||
|
},
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get Pin Status",
|
||||||
"event": [
|
"event": [
|
||||||
{
|
{
|
||||||
"listen": "test",
|
"listen": "test",
|
||||||
|
@ -124,6 +210,41 @@
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get All Pin Statuses",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
"var responseJSON;",
|
||||||
|
"try {",
|
||||||
|
" responseJSON = JSON.parse(responseBody); ",
|
||||||
|
"}catch(e){",
|
||||||
|
" console.log(\"Error.\");",
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"tests[\"Get all pin is ok\"] = responseCode.code === 200;"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"url": "{{raspi_url}}/pins/api/",
|
||||||
|
"method": "GET",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "Bearer {{token}}",
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {},
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Ładowanie…
Reference in New Issue