From a47bd553b625ff4c3dd3663890a61752aa650736 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Thu, 17 Oct 2024 17:05:13 -0600 Subject: [PATCH] Add get by IdentificationCode Postman test --- ...GetByExample Tests.postman_collection.json | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json index 0198b46b1..5ddf17c12 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json @@ -1280,6 +1280,8 @@ "script": { "exec": [ "pm.environment.set('supplied:schoolId', 255901001);\r", + "pm.environment.set('supplied:identificationCode', \"255901001\");\r", + "pm.environment.set('supplied:identificationCodeEducationOrganizationIdentificationSystemDescriptor', \"uri://ed-fi.org/EducationOrganizationIdentificationSystemDescriptor#SEA\");\r", "pm.environment.set('supplied:nameOfInstitution', 'Grand Bend Middle School');\r", "pm.environment.set('supplied:shortNameOfInstitution', 'GBES');" ], @@ -1950,6 +1952,106 @@ "response": [] } ] + }, + { + "name": "When filtering by IdentificationCode", + "item": [ + { + "name": "When filtering by an existing identificationCode", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {\r", + " pm.expect(pm.response.code).to.equal(200);\r", + "});\r", + "\r", + "const responseItems = pm.response.json();\r", + "\r", + "pm.test(\"Should return one expected resouce\", () => {\r", + " pm.expect(responseItems.count()).to.equal(1);\r", + " pm.expect(responseItems[0].id).to.equals(pm.environment.get('known:lea_id'));\r", + " pm.expect(responseItems[0].webSite).to.equals(pm.environment.get('supplied:webSite'));\r", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/localEducationAgencies?identificaitonCode={{supplied:identificationCode}}", + "host": [ + "{{ApiBaseUrl}}" + ], + "path": [ + "data", + "v3", + "ed-fi", + "localEducationAgencies" + ], + "query": [ + { + "key": "identificaitonCode", + "value": "{{supplied:identificationCode}}" + } + ] + } + }, + "response": [] + }, + { + "name": "When filtering by a non-existent identificationCode", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {\r", + " pm.expect(pm.response.code).to.equal(200);\r", + "});\r", + "\r", + "pm.test(\"Should return an empty response\", () => {\r", + " const responseItems = pm.response.json();\r", + "\r", + " pm.expect(responseItems.count()).to.equal(0);\r", + "});\r", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/localEducationAgencies?identificationCode=non-existent", + "host": [ + "{{ApiBaseUrl}}" + ], + "path": [ + "data", + "v3", + "ed-fi", + "localEducationAgencies" + ], + "query": [ + { + "key": "identificationCode", + "value": "non-existent" + } + ] + } + }, + "response": [] + } + ] } ] },