Skip to content

Instantly share code, notes, and snippets.

@SyntaxColoring
Forked from mcous/README.md
Last active October 27, 2021 20:49
Show Gist options
  • Save SyntaxColoring/5901b2093c1b391ec377217a7ac64111 to your computer and use it in GitHub Desktop.
Save SyntaxColoring/5901b2093c1b391ec377217a7ac64111 to your computer and use it in GitHub Desktop.
Postman robot-server testing
{
"info": {
"_postman_id": "01d6d4d2-9041-4a27-9c98-68471614b041",
"name": "Protocols",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "GET /protocols",
"request": {
"method": "GET",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"url": {
"raw": "{{hostname}}:31950/protocols",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"protocols"
]
}
},
"response": []
},
{
"name": "POST /protocols",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Protocol ID created\", () => {",
" const body = pm.response.json()",
" const id = body.data.id",
"",
" pm.expect(typeof id).to.equal('string')",
" pm.globals.set(\"protocol_id\", id)",
"})",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "files",
"type": "file",
"src": [],
"disabled": true
}
]
},
"url": {
"raw": "http://{{hostname}}:31950/protocols",
"protocol": "http",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"protocols"
]
}
},
"response": []
},
{
"name": "GET /protocols/:protocol_id",
"request": {
"method": "GET",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"url": {
"raw": "http://{{hostname}}:31950/protocols/{{protocol_id}}",
"protocol": "http",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"protocols",
"{{protocol_id}}"
]
}
},
"response": []
},
{
"name": "DELETE /protocols/:protocol_id",
"request": {
"method": "DELETE",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"url": {
"raw": "http://{{hostname}}:31950/protocols/{{protocol_id}}",
"protocol": "http",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"protocols",
"{{protocol_id}}"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "hostname",
"value": "localhost"
}
]
}
{
"info": {
"_postman_id": "bc68fa28-7690-403f-bca2-8dac5a9f833a",
"name": "Sessions",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "GET /sessions",
"request": {
"method": "GET",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"url": {
"raw": "{{hostname}}:31950/sessions",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"sessions"
]
}
},
"response": []
},
{
"name": "POST /sessions {sessionType: basic}",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Session ID created\", () => {",
" const body = pm.response.json()",
" const id = body.data.id",
"",
" pm.expect(typeof id).to.equal('string')",
" pm.globals.set(\"session_id\", id)",
"})",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": {\n \"sessionType\": \"basic\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:31950/sessions",
"protocol": "http",
"host": [
"localhost"
],
"port": "31950",
"path": [
"sessions"
]
}
},
"response": []
},
{
"name": "GET /sessions/:session_id",
"request": {
"method": "GET",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"url": {
"raw": "http://{{hostname}}:31950/sessions/{{session_id}}",
"protocol": "http",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"sessions",
"{{session_id}}"
]
}
},
"response": []
},
{
"name": "POST /sessions/:session_id/actions { start }",
"request": {
"method": "POST",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": {\n \"actionType\": \"start\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://{{hostname}}:31950/sessions/{{session_id}}/actions",
"protocol": "http",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"sessions",
"{{session_id}}",
"actions"
]
}
},
"response": []
},
{
"name": "DELETE /sessions/:session_id",
"request": {
"method": "DELETE",
"header": [
{
"key": "Opentrons-Version",
"value": "2",
"type": "text"
}
],
"url": {
"raw": "http://{{hostname}}:31950/sessions/{{session_id}}",
"protocol": "http",
"host": [
"{{hostname}}"
],
"port": "31950",
"path": [
"sessions",
"{{session_id}}"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "hostname",
"value": "localhost"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment