From 5f89777b163b3a59809073759acf00371b084aeb Mon Sep 17 00:00:00 2001 From: AmiableAnil <ani2824@gmail.com> Date: Wed, 27 Jul 2022 11:08:15 +0530 Subject: [PATCH] Issue #SB-30119 test: Added the Collections and Reports for content v2 APIs. --- ...ontent V2 API Test.postman_collection.json | 1044 +++++-- .../Content V2 API Test.postman_test_run.json | 2574 +++++++++++++++++ 2 files changed, 3395 insertions(+), 223 deletions(-) create mode 100644 content-api/api-tests/Reports/Content V2 API Test.postman_test_run.json diff --git a/content-api/api-tests/Collections/Content V2 API Test.postman_collection.json b/content-api/api-tests/Collections/Content V2 API Test.postman_collection.json index 77efae5c8..583e76895 100644 --- a/content-api/api-tests/Collections/Content V2 API Test.postman_collection.json +++ b/content-api/api-tests/Collections/Content V2 API Test.postman_collection.json @@ -14,7 +14,7 @@ "name": "Content Create ", "item": [ { - "name": "Content Create - with minimal required attribute", + "name": "200 - With minimal required attribute", "event": [ { "listen": "test", @@ -93,7 +93,174 @@ "response": [] }, { - "name": "Content Create - Special character in name", + "name": "200 - With identifier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id', 'versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "// Result", + "pm.test(`identifier should be equal to ${JSON.parse(request.data).request.content.identifier}`, () => {", + " pm.expect(jsonResponse.result.identifier).to.eql(`${JSON.parse(request.data).request.content.identifier}`);", + "});", + "pm.test(`node_id should be equal to ${JSON.parse(request.data).request.content.identifier}`, () => {", + " pm.expect(jsonResponse.result.node_id).to.eql(`${JSON.parse(request.data).request.content.identifier}`);", + "});", + "", + "// Set global variable", + "pm.globals.set(\"content_id\", jsonResponse.result.identifier);", + "pm.globals.set(\"versionKey\", jsonResponse.result.versionKey);", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"identifier\": \"some_identifier\",\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/create", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "create" + ] + }, + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "200 - With external fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id', 'versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + "});", + "", + "//Validation", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "// Set global variable", + "pm.globals.set(\"content_id\", jsonResponse.result.identifier);", + "pm.globals.set(\"versionKey\", jsonResponse.result.versionKey);", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/create", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "create" + ] + }, + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "200 - Special character in name", "event": [ { "listen": "test", @@ -177,7 +344,7 @@ "name": "Content Read", "item": [ { - "name": "Content Read", + "name": "200 - Get all data except external data", "event": [ { "listen": "test", @@ -267,7 +434,7 @@ "response": [] }, { - "name": "Content Read - fields query params", + "name": "200 - Get specific attributes by sending fields query params", "event": [ { "listen": "test", @@ -328,7 +495,7 @@ } ], "url": { - "raw": "{{host}}/api/content/v2/read/{{content_id}}?fields=name,primaryCategory", + "raw": "{{host}}/api/content/v2/read/{{content_id}}?fields=name,primaryCategory,body", "host": [ "{{host}}" ], @@ -342,7 +509,8 @@ "query": [ { "key": "fields", - "value": "name,primaryCategory" + "value": "name,primaryCategory,body", + "description": "Fields param is used to get the external data in response, by default read API doesn't return external data. Also fields can be used to get the specific data only in response instead of getting all the data." } ] }, @@ -376,7 +544,100 @@ "name": "Content Update", "item": [ { - "name": "Content Update", + "name": "200 - Update existing data or add new data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id', 'versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + "});", + "", + "//Validation", + "pm.test(\"id should be api.content.update\", () => {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"ver should be 4.0\", () => {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"identifier should be equal to \" + pm.globals.get(\"content_id\"), () => {", + " pm.expect(jsonResponse.result.identifier).to.eql(pm.globals.get(\"content_id\"));", + "});", + "pm.test(\"node_id should be equal to \" + pm.globals.get(\"content_id\"), () => {", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.globals.get(\"content_id\"));", + "});", + "", + "// Set global variable", + "pm.globals.set(\"versionKey\", jsonResponse.result.versionKey);", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "// pm.globals.set('content_id');" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionKey}}\",\n \"description\": \"dsd\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/update/{{content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "update", + "{{content_id}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "200 - Special character in name", "event": [ { "listen": "test", @@ -392,54 +653,498 @@ "});", "", "//Validation", - "pm.test(\"id should be api.content.update\", () => {", - " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", - "});", - "pm.test(\"ver should be 4.0\", () => {", - " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "pm.test(\"id should be api.content.update\", () => {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"ver should be 4.0\", () => {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"identifier should be equal to \" + pm.globals.get(\"content_id\"), () => {", + " pm.expect(jsonResponse.result.identifier).to.eql(pm.globals.get(\"content_id\"));", + "});", + "pm.test(\"node_id should be equal to \" + pm.globals.get(\"content_id\"), () => {", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.globals.get(\"content_id\"));", + "});", + "", + "// Set global variable", + "pm.globals.set(\"versionKey\", jsonResponse.result.versionKey);", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionKey}}\",\n \"description\": \"dsd\",\n \"name\": \"~`S!@#$%^&*()_+=:;\\\"'<,>.?/\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/update/{{content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "update", + "{{content_id}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "//Verification", + "pm.test(\"Status code is 200\", () => {", + " pm.response.to.have.status(200)", + "});", + "//code name contains a string", + "tests[\"Status code name has string OK\"] = responseCode.name.has(\"OK\");", + "", + "// pm.test(\"Content-Encoding header is present\", () => {", + "// pm.response.to.have.header(\"Content-Encoding\");", + "// });", + "// pm.test(\"Content-Encoding header is gzip\", () => {", + "// pm.expect(pm.response.headers.get('Content-Encoding')).to.eql('gzip');", + "// });", + "", + "pm.test(\"Verify keys and data type of the params in positive scenario\", () => {", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.null;", + " pm.expect(jsonResponse.params.err).to.be.null;", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.errmsg).to.be.null;", + "});", + "", + "pm.test(\"params.status should be \\\"successful\\\"\", () => {", + " pm.expect(jsonResponse.params.status).to.eql(\"successful\");", + "});", + "pm.test(\"responseCode should be OK\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"OK\");", + "});" + ] + } + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Content Create", + "item": [ + { + "name": "400 - missing channel", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata channel not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata channel not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/create", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "create" + ] + }, + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "400 - empty channel", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata channel not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata channel not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/create", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "create" + ] + }, + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "400 - missing name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/api/content/v2/create", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "content", + "v2", + "create" + ] + }, + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "400 - name: invalid datatype", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");", "});", "", - "pm.test(\"identifier should be equal to \" + pm.globals.get(\"content_id\"), () => {", - " pm.expect(jsonResponse.result.identifier).to.eql(pm.globals.get(\"content_id\"));", + "// Params", + "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", "});", - "pm.test(\"node_id should be equal to \" + pm.globals.get(\"content_id\"), () => {", - " pm.expect(jsonResponse.result.node_id).to.eql(pm.globals.get(\"content_id\"));", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", "});", "", - "// Set global variable", - "pm.globals.set(\"versionKey\", jsonResponse.result.versionKey);", + "// Result", + "pm.test(\"result body should include messages \\\"Metadata name should be a/an String value\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Metadata name should be a/an String value');", + "});", "" ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "// pm.globals.set('content_id');" - ], - "type": "text/javascript" - } } ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Content-Type", - "value": "application/json", - "type": "text" + "value": "application/json" }, { "key": "X-Authenticated-User-token", - "value": "{{keycloak_access_token}}", - "type": "text" + "value": "{{keycloak_access_token}}" }, { "key": "Authorization", - "value": "{{kong_api_key}}", - "type": "text" + "value": "{{kong_api_key}}" }, { "key": "X-Channel-Id", @@ -449,10 +1154,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionKey}}\",\n \"lastUpdatedBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\",\n \"description\": \"dsd\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": 423432,\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/api/content/v2/update/{{content_id}}", + "raw": "{{host}}/api/content/v2/create", "host": [ "{{host}}" ], @@ -460,16 +1165,15 @@ "api", "content", "v2", - "update", - "{{content_id}}" + "create" ] }, - "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [] }, { - "name": "Content Update - Special character in name", + "name": "400 - name empty", "event": [ { "listen": "test", @@ -478,64 +1182,36 @@ "let jsonResponse = pm.response.json()", "", "//Verification", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404)", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400)", "});", "//code name contains a string", - "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");", - "", - "pm.test(\"Content-Type header is present\", () => {", - " pm.response.to.have.header(\"Content-Type\");", - "});", - "pm.test(\"Content-Type header is application/json\", () => {", - " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');", - "});", - "pm.test(\"Content-Encoding header should not present\", () => {", - " pm.response.to.have.header(\"Content-Encoding\");", - "});", - "pm.test(\"Content-Encoding header is gzip\", () => {", - " pm.expect(pm.response.headers.get('Content-Encoding')).to.eql('gzip');", - "});", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");", "", "pm.test(\"Verify keys and data type of the response result\", () => {", - " pm.expect(jsonResponse).to.be.an(\"object\").that.has.all.keys('id', 'ver', 'ts', 'params', 'responseCode', 'result');", - " pm.expect(jsonResponse.id).to.be.a(\"string\");", - " pm.expect(jsonResponse.ver).to.be.a(\"string\");", - " pm.expect(jsonResponse.ts).to.be.a(\"string\");", - " pm.expect(jsonResponse.responseCode).to.be.a(\"string\");", - " pm.expect(jsonResponse.params).to.be.an(\"object\").that.has.all.keys('resmsgid', 'msgid', 'err', 'status', 'errmsg');", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", - " pm.expect(jsonResponse.params.msgid).to.be.null;", - " pm.expect(jsonResponse.params.err).to.be.a(\"string\");", - " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"string\");", " pm.expect(jsonResponse.result).to.be.an(\"object\");", " pm.expect(jsonResponse.result).to.have.all.keys('messages');", - " pm.expect(jsonResponse.result.messages).to.be.null;", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", "});", "", "//Validation", "// Response body", - "pm.test(\"id should be api.content.update\", () => {", - " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", - "});", - "pm.test(\"ver should be 4.0\", () => {", - " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", - "});", - "pm.test(\"params.err should be \\\"404\\\"\", () => {", - " pm.expect(jsonResponse.params.err).to.eql(\"404\");", - "});", - "pm.test(\"params.status should be \\\"failed\\\"\", () => {", - " pm.expect(jsonResponse.params.status).to.eql(\"failed\");", + "pm.test(\"responseCode should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");", "});", - "pm.test(\"params.errmsg should be \\\"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\\\"\", () => {", - " pm.expect(jsonResponse.params.errmsg).to.eql(\"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\");", + "", + "// Params", + "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", "});", - "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {", - " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", "});", - "pm.test(\"messages should be null\", () => {", - " pm.expect(jsonResponse.result.messages).to.eql(null);", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", "});", "" ], @@ -543,23 +1219,25 @@ } } ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Content-Type", - "value": "application/json", - "type": "text" + "value": "application/json" }, { "key": "X-Authenticated-User-token", - "value": "{{keycloak_access_token}}", - "type": "text" + "value": "{{keycloak_access_token}}" }, { "key": "Authorization", - "value": "{{kong_api_key}}", - "type": "text" + "value": "{{kong_api_key}}" }, { "key": "X-Channel-Id", @@ -569,10 +1247,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionKey}}\",\n \"description\": \"dsd\",\n \"name\": \"~`S!@#$%^&*()_+=:;\\\"'<,>.?/\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/api/content/v2/update/{{content_id}}", + "raw": "{{host}}/api/content/v2/create", "host": [ "{{host}}" ], @@ -580,95 +1258,15 @@ "api", "content", "v2", - "update", - "{{content_id}}" + "create" ] }, - "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "let jsonResponse = pm.response.json();", - "", - "//Verification", - "pm.test(\"Status code is 200\", () => {", - " pm.response.to.have.status(200)", - "});", - "//code name contains a string", - "tests[\"Status code name has string OK\"] = responseCode.name.has(\"OK\");", - "", - "// pm.test(\"Content-Encoding header is present\", () => {", - "// pm.response.to.have.header(\"Content-Encoding\");", - "// });", - "// pm.test(\"Content-Encoding header is gzip\", () => {", - "// pm.expect(pm.response.headers.get('Content-Encoding')).to.eql('gzip');", - "// });", - "", - "pm.test(\"Verify keys and data type of the params in positive scenario\", () => {", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", - " pm.expect(jsonResponse.params.msgid).to.be.null;", - " pm.expect(jsonResponse.params.err).to.be.null;", - " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", - " pm.expect(jsonResponse.params.errmsg).to.be.null;", - "});", - "", - "pm.test(\"params.status should be \\\"successful\\\"\", () => {", - " pm.expect(jsonResponse.params.status).to.eql(\"successful\");", - "});", - "pm.test(\"responseCode should be OK\", () => {", - " pm.expect(jsonResponse.responseCode).to.eql(\"OK\");", - "});" - ] - } - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Content Create", - "item": [ - { - "name": "Content Create - 400 - missing name", + "name": "400 - missing code", "event": [ { "listen": "test", @@ -677,7 +1275,7 @@ "let jsonResponse = pm.response.json()", "", "//Verification", - "pm.test(\"Status code is 400\", () => {", + "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400)", "});", "//code name contains a string", @@ -704,9 +1302,9 @@ "});", "", "// Result", - "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + "pm.test(\"result body should include messages \\\"Required Metadata code not set\\\"\", () => {", " pm.expect(jsonResponse.result.messages).to.have.length(1)", - " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata code not set');", "});", "" ], @@ -742,7 +1340,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" }, "url": { "raw": "{{host}}/api/content/v2/create", @@ -761,7 +1359,7 @@ "response": [] }, { - "name": "Content Create - 400 - name empty", + "name": "400 - missing mimeType", "event": [ { "listen": "test", @@ -797,9 +1395,9 @@ "});", "", "// Result", - "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + "pm.test(\"result body should include messages \\\"Required Metadata mimeType not set\\\"\", () => {", " pm.expect(jsonResponse.result.messages).to.have.length(1)", - " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata mimeType not set');", "});", "" ], @@ -835,7 +1433,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" }, "url": { "raw": "{{host}}/api/content/v2/create", @@ -854,7 +1452,7 @@ "response": [] }, { - "name": "Content Create - 400 - missing code", + "name": "400 - invalid mimeType", "event": [ { "listen": "test", @@ -890,9 +1488,9 @@ "});", "", "// Result", - "pm.test(\"result body should include messages \\\"Required Metadata code not set\\\"\", () => {", + "pm.test(\"result body should include messages \\\"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\\\"\", () => {", " pm.expect(jsonResponse.result.messages).to.have.length(1)", - " pm.expect(jsonResponse.result.messages).to.include('Required Metadata code not set');", + " pm.expect(jsonResponse.result.messages).to.include('Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]');", "});", "" ], @@ -928,7 +1526,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"some-mimeType\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" }, "url": { "raw": "{{host}}/api/content/v2/create", @@ -947,7 +1545,7 @@ "response": [] }, { - "name": "Content Create - 400 - missing mimeType", + "name": "400 - missing primaryCategory", "event": [ { "listen": "test", @@ -956,7 +1554,7 @@ "let jsonResponse = pm.response.json()", "", "//Verification", - "pm.test(\"Status code is 400\", function () {", + "pm.test(\"Status code is 400\", () => {", " pm.response.to.have.status(400)", "});", "//code name contains a string", @@ -964,8 +1562,6 @@ "", "pm.test(\"Verify keys and data type of the response result\", () => {", " pm.expect(jsonResponse.result).to.be.an(\"object\");", - " pm.expect(jsonResponse.result).to.have.all.keys('messages');", - " pm.expect(jsonResponse.result.messages).to.not.be.empty;", "});", "", "//Validation", @@ -975,17 +1571,17 @@ "});", "", "// Params", - "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", - " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "pm.test(\"params.err should be \\\"VALIDATION_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"VALIDATION_ERROR\");", "});", - "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", - " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "pm.test(\"params.errmsg should be \\\"primaryCategory is a mandatory parameter\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"primaryCategory is a mandatory parameter\");", "});", "", "// Result", - "pm.test(\"result body should include messages \\\"Required Metadata mimeType not set\\\"\", () => {", - " pm.expect(jsonResponse.result.messages).to.have.length(1)", - " pm.expect(jsonResponse.result.messages).to.include('Required Metadata mimeType not set');", + "pm.test(\"result body should be empty\", () => {", + " pm.expect(jsonResponse.result).to.eql({});", + " pm.expect(jsonResponse.result).to.be.empty;", "});", "" ], @@ -1021,7 +1617,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\"\n }\n }\n}" }, "url": { "raw": "{{host}}/api/content/v2/create", @@ -1040,7 +1636,7 @@ "response": [] }, { - "name": "Content Create - 400 - missing primaryCategory", + "name": "400 - Invalid subject", "event": [ { "listen": "test", @@ -1057,6 +1653,8 @@ "", "pm.test(\"Verify keys and data type of the response result\", () => {", " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", "});", "", "//Validation", @@ -1066,17 +1664,17 @@ "});", "", "// Params", - "pm.test(\"params.err should be \\\"VALIDATION_ERROR\\\"\", () => {", - " pm.expect(jsonResponse.params.err).to.eql(\"VALIDATION_ERROR\");", + "pm.test(\"params.err should be \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", "});", - "pm.test(\"params.errmsg should be \\\"primaryCategory is a mandatory parameter\\\"\", () => {", - " pm.expect(jsonResponse.params.errmsg).to.eql(\"primaryCategory is a mandatory parameter\");", + "pm.test(\"params.errmsg should be \\\"Validation Errors.\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors.\");", "});", "", "// Result", - "pm.test(\"result body should be empty\", () => {", - " pm.expect(jsonResponse.result).to.eql({});", - " pm.expect(jsonResponse.result).to.be.empty;", + "pm.test(\"result body should include messages \\\"subject range data is empty from the given framework.\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('subject range data is empty from the given framework.');", "});", "" ], @@ -1112,7 +1710,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12-erwe\",\n \"subject\": [\"test\"],\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" }, "url": { "raw": "{{host}}/api/content/v2/create", @@ -1131,7 +1729,7 @@ "response": [] }, { - "name": "Content Create - 404 - Invalid primaryCategory", + "name": "404 - Invalid primaryCategory", "event": [ { "listen": "test", @@ -1254,7 +1852,7 @@ "name": "Content Read", "item": [ { - "name": "Content Read - 404 - Not Found", + "name": "404 - Not Found", "event": [ { "listen": "test", @@ -1374,7 +1972,7 @@ "name": "Content Update", "item": [ { - "name": "Content Update - 400 - Invalid versionKey", + "name": "400 - Invalid versionKey", "event": [ { "listen": "test", @@ -1429,7 +2027,7 @@ "listen": "prerequest", "script": { "exec": [ - "pm.globals.set('versionKey', '3534534543');", + "pm.globals.set('invalid-versionKey', '3534534543');", "// pm.globals.set(\"content_id\", '');" ], "type": "text/javascript" @@ -1462,7 +2060,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionKey}}\",\n \"lastUpdatedBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\",\n \"description\": \"dsd\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{invalid-versionKey}}\",\n \"lastUpdatedBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\",\n \"description\": \"dsd\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" }, "url": { "raw": "{{host}}/api/content/v2/update/{{content_id}}", @@ -1482,7 +2080,7 @@ "response": [] }, { - "name": "Content Update - 400 - Empty name", + "name": "400 - Empty name", "event": [ { "listen": "test", @@ -1574,7 +2172,7 @@ "response": [] }, { - "name": "Content Update - 404 - Invalid content id", + "name": "404 - Invalid content id", "event": [ { "listen": "test", @@ -1605,8 +2203,8 @@ "pm.test(\"params.err should be NOT_FOUND\", () => {", " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");", "});", - "pm.test(`params.errmsg should be \\\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"content_id\")}\\\"`, () => {", - " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"content_id\")}`);", + "pm.test(`params.errmsg should be \\\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"invalid_content_id\")}\\\"`, () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"invalid_content_id\")}`);", "});", "", "// Result", @@ -1622,7 +2220,7 @@ "listen": "prerequest", "script": { "exec": [ - "pm.globals.set(\"content_id\", 'do_21357909972698726412211');" + "pm.globals.set(\"invalid_content_id\", 'do_21357909972698726412211');" ], "type": "text/javascript" } @@ -1657,7 +2255,7 @@ "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionKey}}\",\n \"lastUpdatedBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\",\n \"description\": \"dsd\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/api/content/v2/update/{{content_id}}", + "raw": "{{host}}/api/content/v2/update/{{invalid_content_id}}", "host": [ "{{host}}" ], @@ -1666,7 +2264,7 @@ "content", "v2", "update", - "{{content_id}}" + "{{invalid_content_id}}" ] }, "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." @@ -1674,7 +2272,7 @@ "response": [] }, { - "name": "Content Update - 404 - Invalid primaryCategory", + "name": "404 - Invalid primaryCategory", "event": [ { "listen": "test", diff --git a/content-api/api-tests/Reports/Content V2 API Test.postman_test_run.json b/content-api/api-tests/Reports/Content V2 API Test.postman_test_run.json new file mode 100644 index 000000000..aff0883c2 --- /dev/null +++ b/content-api/api-tests/Reports/Content V2 API Test.postman_test_run.json @@ -0,0 +1,2574 @@ +{ + "id": "489956f4-e5fd-4c92-8408-6a4598e10940", + "name": "Content V2 API Test", + "timestamp": "2022-07-27T05:30:40.864Z", + "collection_id": "1419050-58a713b4-b8bb-4885-9909-b23d253f8f31", + "folder_id": 0, + "environment_id": "1419050-b1be6ead-50b9-49a1-b0e2-95f479990dad", + "totalPass": 328, + "totalFail": 0, + "results": [ + { + "id": "2383265f-a48f-47dc-9538-e3c7a16b1d98", + "name": "200 - With minimal required attribute", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 229, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 229 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true + } + ] + }, + { + "id": "fdb1f5bc-f5b3-4c3c-b622-bd86a8f92b40", + "name": "200 - With identifier", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 61, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "identifier should be equal to some_identifier": true, + "node_id should be equal to some_identifier": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to some_identifier": { + "pass": 1, + "fail": 0 + }, + "node_id should be equal to some_identifier": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 61 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "identifier should be equal to some_identifier": true, + "node_id should be equal to some_identifier": true + } + ] + }, + { + "id": "67644d61-7797-4f54-82cf-d4b7711b5282", + "name": "200 - With external fields", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 84, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 84 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true + } + ] + }, + { + "id": "4fa811d0-1e33-493c-95fe-39bac77bae42", + "name": "200 - Special character in name", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 67, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 67 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.create": true, + "ver should be 4.0": true + } + ] + }, + { + "id": "5f38fbf3-1dd6-4f5a-8796-6ca07d837d25", + "name": "200 - Get all data ecxept external data", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/read/do_2135897074718965761132", + "time": 111, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true, + "objectType should be Content": true, + "visibility should be Default": true, + "compatibilityLevel should be 1": true, + "status should be Draft": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.read": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2135897074718965761132": { + "pass": 1, + "fail": 0 + }, + "objectType should be Content": { + "pass": 1, + "fail": 0 + }, + "visibility should be Default": { + "pass": 1, + "fail": 0 + }, + "compatibilityLevel should be 1": { + "pass": 1, + "fail": 0 + }, + "status should be Draft": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 111 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true, + "objectType should be Content": true, + "visibility should be Default": true, + "compatibilityLevel should be 1": true, + "status should be Draft": true + } + ] + }, + { + "id": "6cad6c08-f73b-4d00-9395-b8cbcb3cafe0", + "name": "200 - Get specific attributes by sending fields query params", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/read/do_2135897074718965761132?fields=name,primaryCategory,body", + "time": 69, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.read": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2135897074718965761132": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 69 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true + } + ] + }, + { + "id": "bcd0f26d-ca6b-4eb7-815a-e85c4044a829", + "name": "200 - Update existing data or add new data", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/update/do_2135897074718965761132", + "time": 558, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true, + "node_id should be equal to do_2135897074718965761132": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2135897074718965761132": { + "pass": 1, + "fail": 0 + }, + "node_id should be equal to do_2135897074718965761132": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 558 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true, + "node_id should be equal to do_2135897074718965761132": true + } + ] + }, + { + "id": "1d43c4ab-ea8b-449c-8dca-aa7eda247bfa", + "name": "200 - Special character in name", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/update/do_2135897074718965761132", + "time": 575, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true, + "node_id should be equal to do_2135897074718965761132": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in positive scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"successful\"": { + "pass": 1, + "fail": 0 + }, + "responseCode should be OK": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2135897074718965761132": { + "pass": 1, + "fail": 0 + }, + "node_id should be equal to do_2135897074718965761132": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 575 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Status code is 200": true, + "Verify keys and data type of the params in positive scenario": true, + "params.status should be \"successful\"": true, + "responseCode should be OK": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "identifier should be equal to do_2135897074718965761132": true, + "node_id should be equal to do_2135897074718965761132": true + } + ] + }, + { + "id": "6d2a8074-8afe-40ba-9e29-2376fc3db053", + "name": "400 - missing channel", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 21, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata channel not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 21 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "59690e87-ff4d-4d1d-b549-0156afa7611b", + "name": "400 - empty channel", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 71, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata channel not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 71 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "dd956c1e-35b6-4525-baaf-0b2a8ab5ab57", + "name": "400 - missing name", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 69, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata name not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 69 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "c6c1b7fd-a278-4ef3-9d2e-6c76a53d1c33", + "name": "400 - name: invalid datatype", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 49, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata name should be a/an String value\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Metadata name should be a/an String value\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 49 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata name should be a/an String value\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "a1ac9342-84c0-4395-aa52-b8248007722d", + "name": "400 - name empty", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 48, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata name not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 48 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "37e04040-1676-4dca-a674-54210b5990e2", + "name": "400 - missing code", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 67, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata code not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata code not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 67 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata code not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "077b803b-7fbb-4264-823c-c41c0bac597d", + "name": "400 - missing mimeType", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 45, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata mimeType not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata mimeType not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 45 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata mimeType not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "6a365695-00de-4d90-ab6f-4726e59b1898", + "name": "400 - invalid mimeType", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 69, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 69 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "174eb09b-0d2d-4ef4-9109-e74e75472d28", + "name": "400 - missing primaryCategory", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 48, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"VALIDATION_ERROR\"": true, + "params.errmsg should be \"primaryCategory is a mandatory parameter\"": true, + "result body should be empty": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"VALIDATION_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"primaryCategory is a mandatory parameter\"": { + "pass": 1, + "fail": 0 + }, + "result body should be empty": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 48 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"VALIDATION_ERROR\"": true, + "params.errmsg should be \"primaryCategory is a mandatory parameter\"": true, + "result body should be empty": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "136c3218-e05b-418e-886a-d10129c996ba", + "name": "400 - Invalid subject", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 50, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors.\"": true, + "result body should include messages \"subject range data is empty from the given framework.\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors.\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"subject range data is empty from the given framework.\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 50 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors.\"": true, + "result body should include messages \"subject range data is empty from the given framework.\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "c4a3ef78-c5f3-4a82-ac3e-88ba8e2cc4b3", + "name": "404 - Invalid primaryCategory", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/create", + "time": 75, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 404": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:aabaa_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"404\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:aabaa_content_all {}\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 75 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Status code is 404": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:aabaa_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "59f831d2-df67-4297-9641-2304cea74637", + "name": "404 - Not Found", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/read/do_42353245436534", + "time": 65, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "Status code is 404": true, + "Test data type of the response and keys": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_42353245436534\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.read": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_42353245436534\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 65 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "Status code is 404": true, + "Test data type of the response and keys": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_42353245436534\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "8be3bf77-e65e-4dab-9053-cf7400fd5aa5", + "name": "400 - Invalid versionKey", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/update/do_2135897074718965761132", + "time": 77, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Content-Encoding header should not present": true, + "Verify keys and data type of the response result": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be CLIENT_ERROR": true, + "params.status should be failed": true, + "params.errmsg should be \"Invalid version Key\"": true, + "messages should be null": true, + "Status code name has string Bad Request": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Content-Encoding header should not present": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.status should be failed": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Invalid version Key\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 77 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Content-Encoding header should not present": true, + "Verify keys and data type of the response result": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be CLIENT_ERROR": true, + "params.status should be failed": true, + "params.errmsg should be \"Invalid version Key\"": true, + "messages should be null": true, + "Status code name has string Bad Request": true + } + ] + }, + { + "id": "d705cd83-e917-4be6-a755-e9c7d377c9c6", + "name": "400 - Empty name", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/update/do_2135897074718965761132", + "time": 42, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata name not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 42 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 400": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "13158c62-e311-458c-a9ef-fabe24c065f6", + "name": "404 - Invalid content id", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/update/do_21357909972698726412211", + "time": 36, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 404": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be NOT_FOUND": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_21357909972698726412211\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_21357909972698726412211\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 36 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 404": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be NOT_FOUND": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_21357909972698726412211\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "d05ba7e2-041f-4a54-9370-e5ecfd286a62", + "name": "404 - Invalid primaryCategory", + "url": "https://dev.knowlg.sunbird.org/api/content/v2/update/do_2135897074718965761132", + "time": 109, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 404": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Content-Type header is present": { + "pass": 1, + "fail": 0 + }, + "Content-Type header is application/json": { + "pass": 1, + "fail": 0 + }, + "Validate keys and data type of the response body": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the params in negative scenario": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"404\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 109 + ], + "allTests": [ + { + "Content-Type header is present": true, + "Content-Type header is application/json": true, + "Validate keys and data type of the response body": true, + "Verify keys and data type of the params in negative scenario": true, + "params.status should be \"failed\"": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Status code is 404": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + } + ], + "count": 1, + "totalTime": 2695, + "collection": { + "requests": [ + { + "id": "2383265f-a48f-47dc-9538-e3c7a16b1d98", + "method": "POST" + }, + { + "id": "fdb1f5bc-f5b3-4c3c-b622-bd86a8f92b40", + "method": "POST" + }, + { + "id": "67644d61-7797-4f54-82cf-d4b7711b5282", + "method": "POST" + }, + { + "id": "4fa811d0-1e33-493c-95fe-39bac77bae42", + "method": "POST" + }, + { + "id": "5f38fbf3-1dd6-4f5a-8796-6ca07d837d25", + "method": "GET" + }, + { + "id": "6cad6c08-f73b-4d00-9395-b8cbcb3cafe0", + "method": "GET" + }, + { + "id": "bcd0f26d-ca6b-4eb7-815a-e85c4044a829", + "method": "PATCH" + }, + { + "id": "1d43c4ab-ea8b-449c-8dca-aa7eda247bfa", + "method": "PATCH" + }, + { + "id": "6d2a8074-8afe-40ba-9e29-2376fc3db053", + "method": "POST" + }, + { + "id": "59690e87-ff4d-4d1d-b549-0156afa7611b", + "method": "POST" + }, + { + "id": "dd956c1e-35b6-4525-baaf-0b2a8ab5ab57", + "method": "POST" + }, + { + "id": "c6c1b7fd-a278-4ef3-9d2e-6c76a53d1c33", + "method": "POST" + }, + { + "id": "a1ac9342-84c0-4395-aa52-b8248007722d", + "method": "POST" + }, + { + "id": "37e04040-1676-4dca-a674-54210b5990e2", + "method": "POST" + }, + { + "id": "077b803b-7fbb-4264-823c-c41c0bac597d", + "method": "POST" + }, + { + "id": "6a365695-00de-4d90-ab6f-4726e59b1898", + "method": "POST" + }, + { + "id": "174eb09b-0d2d-4ef4-9109-e74e75472d28", + "method": "POST" + }, + { + "id": "136c3218-e05b-418e-886a-d10129c996ba", + "method": "POST" + }, + { + "id": "c4a3ef78-c5f3-4a82-ac3e-88ba8e2cc4b3", + "method": "POST" + }, + { + "id": "59f831d2-df67-4297-9641-2304cea74637", + "method": "GET" + }, + { + "id": "8be3bf77-e65e-4dab-9053-cf7400fd5aa5", + "method": "PATCH" + }, + { + "id": "d705cd83-e917-4be6-a755-e9c7d377c9c6", + "method": "PATCH" + }, + { + "id": "13158c62-e311-458c-a9ef-fabe24c065f6", + "method": "PATCH" + }, + { + "id": "d05ba7e2-041f-4a54-9370-e5ecfd286a62", + "method": "PATCH" + } + ] + } +} \ No newline at end of file -- GitLab