diff --git a/README.md b/README.md index c5e059789ad428e61cf7d6255bb433a236e20d4c..9346c8c88654e115f1cd94e92787514ae5e6f202 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/postman/TSA.postman_collection.json b/postman/TSA.postman_collection.json new file mode 100644 index 0000000000000000000000000000000000000000..d3cbc351e5f3f14f0584e1a548277240ff1a9e9a --- /dev/null +++ b/postman/TSA.postman_collection.json @@ -0,0 +1,517 @@ +{ + "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