Skip to content
Snippets Groups Projects
Commit 6c54bcb0 authored by Valery Kalashnikov's avatar Valery Kalashnikov
Browse files

Add postman collection

parent 4f37c00e
No related branches found
No related tags found
1 merge request!14Add postman collection
......@@ -23,4 +23,7 @@ This repository holds the test automation framework based on Java and used for t
### Running
- Run the tests on a remote env: ```gradle regressionSuite -PbaseUrl=https://TestEnv -Dcucumber.tags="@rest, ~@wip" -Dcourgette.threads=10 -Dcourgette.runLevel=Scenario -Dcourgette.rerunFailedScenarios=false -Dcourgette.rerunAttempts=1```
\ No newline at end of file
- Run the tests on a remote env: ```gradle regressionSuite -PbaseUrl=https://TestEnv -Dcucumber.tags="@rest, ~@wip" -Dcourgette.threads=10 -Dcourgette.runLevel=Scenario -Dcourgette.rerunFailedScenarios=false -Dcourgette.rerunAttempts=1```
# Manual execution
To simplify manual tests execution we have a postman collection with the list of supported endpoints, you can find [here](postman/TSA.postman_collection.json)
\ No newline at end of file
{
"info": {
"_postman_id": "0def3f70-92bc-4a30-8cba-c5ea49053ca3",
"name": "Trust Services API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Evaluate hello world policy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const responseJson = pm.response.json();",
"",
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"The evaluation response has all properties\", () => {",
" //parse the response JSON and test three properties",
" const responseJson = pm.response.json();",
" pm.expect(responseJson.evaluationID).to.be.a('string');;",
" pm.expect(responseJson.result.allow).to.eql(true);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\"message\":\"hello world\"}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{policy_base_url}}/policy/:group/:policyName/:version/evaluation",
"host": [
"{{policy_base_url}}"
],
"path": [
"policy",
":group",
":policyName",
":version",
"evaluation"
],
"variable": [
{
"key": "group",
"value": "example"
},
{
"key": "policyName",
"value": "example"
},
{
"key": "version",
"value": "1.0"
}
]
}
},
"response": []
},
{
"name": "Evaluate resolving DID policy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const responseJson = pm.response.json();",
"",
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"The evaluation response has all properties\", () => {",
" //parse the response JSON and test three properties",
" const responseJson = pm.response.json();",
" pm.expect(responseJson.evaluationID).to.be.a('string');;",
" pm.expect(responseJson.result.data.didDocument).to.be.an('object')",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "group",
"value": "example",
"type": "default"
},
{
"key": "policyName",
"value": "resolve",
"type": "default"
},
{
"key": "version",
"value": "1.0",
"type": "default"
}
],
"body": {
"mode": "raw",
"raw": "{\"did\":\"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6\"}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{policy_base_url}}/policy/:group/:policyName/:version/evaluation",
"host": [
"{{policy_base_url}}"
],
"path": [
"policy",
":group",
":policyName",
":version",
"evaluation"
],
"variable": [
{
"key": "group",
"value": "example"
},
{
"key": "policyName",
"value": "resolve"
},
{
"key": "version",
"value": "1.0"
}
]
}
},
"response": []
},
{
"name": "Evaluate cacheSet policy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const responseJson = pm.response.json();",
"",
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"The evaluation response has all properties\", () => {",
" //parse the response JSON and test three properties",
" const responseJson = pm.response.json();",
" pm.expect(responseJson.evaluationID).to.be.a('string');;",
" pm.expect(responseJson.result.data.didDocument).to.be.an('object')",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "group",
"value": "example",
"type": "default"
},
{
"key": "policyName",
"value": "resolve",
"type": "default"
},
{
"key": "version",
"value": "1.0",
"type": "default"
}
],
"body": {
"mode": "raw",
"raw": "{\"did\":\"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6\"}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{policy_base_url}}/policy/:group/:policyName/:version/evaluation",
"host": [
"{{policy_base_url}}"
],
"path": [
"policy",
":group",
":policyName",
":version",
"evaluation"
],
"variable": [
{
"key": "group",
"value": "example"
},
{
"key": "policyName",
"value": "cacheSet"
},
{
"key": "version",
"value": "1.0"
}
]
}
},
"response": []
},
{
"name": "Evaluate cacheGet policy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const responseJson = pm.response.json();",
"",
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"The evaluation response has all properties\", () => {",
" //parse the response JSON and test three properties",
" const responseJson = pm.response.json();",
" pm.expect(responseJson.evaluationID).to.be.a('string');;",
" pm.expect(responseJson.result.data.didDocument).to.be.an('object')",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "group",
"value": "example",
"type": "default"
},
{
"key": "policyName",
"value": "resolve",
"type": "default"
},
{
"key": "version",
"value": "1.0",
"type": "default"
}
],
"body": {
"mode": "raw",
"raw": "{\"did\":\"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6\"}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{policy_base_url}}/policy/:group/:policyName/:version/evaluation",
"host": [
"{{policy_base_url}}"
],
"path": [
"policy",
":group",
":policyName",
":version",
"evaluation"
],
"variable": [
{
"key": "group",
"value": "example"
},
{
"key": "policyName",
"value": "cacheGet"
},
{
"key": "version",
"value": "1.0"
}
]
}
},
"response": []
},
{
"name": "Evaluate task execution policy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const responseJson = pm.response.json();",
"",
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"pm.test(\"The evaluation response has all properties\", () => {",
" //parse the response JSON and test three properties",
" const responseJson = pm.response.json();",
" pm.expect(responseJson.evaluationID).to.be.a('string');;",
" pm.expect(responseJson.result.res.taskID).to.be.a('string')",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "group",
"value": "example",
"type": "default"
},
{
"key": "policyName",
"value": "resolve",
"type": "default"
},
{
"key": "version",
"value": "1.0",
"type": "default"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"exampleTask\",\n \"data\": {\n \"key\": \"value\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{policy_base_url}}/policy/:group/:policyName/:version/evaluation",
"host": [
"{{policy_base_url}}"
],
"path": [
"policy",
":group",
":policyName",
":version",
"evaluation"
],
"variable": [
{
"key": "group",
"value": "example"
},
{
"key": "policyName",
"value": "task"
},
{
"key": "version",
"value": "1.0"
}
]
}
},
"response": []
},
{
"name": "Get the task execution result",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{cache_base_url}}/v1/cache",
"host": [
"{{cache_base_url}}"
],
"path": [
"v1",
"cache"
]
}
},
"response": []
},
{
"name": "(not implemented) Execute the task list - parallel",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "(not implemented) Execute the task list - sequential",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "(not implemented) Trusted info exchange - export",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "(not implemented) Trusted info exchange - import",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "(not implemented) Cache events",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "(not implemented) Signing",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "(not implemented) Verification",
"request": {
"method": "GET",
"header": []
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "policy_base_url",
"value": "http://localhost:8081",
"type": "default"
},
{
"key": "cache_base_url",
"value": "http://localhost:8083",
"type": "default"
}
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment