added postman tests -2

master v1.0
ahmetkotan 2019-02-03 16:29:11 +03:00
rodzic 9cdc17502d
commit fce2e4b878
1 zmienionych plików z 122 dodań i 1 usunięć

Wyświetl plik

@ -90,7 +90,93 @@
"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": [
{
"listen": "test",
@ -124,6 +210,41 @@
"description": ""
},
"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": []
}
]
}