Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement tests for registry-api #494 #311

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
324 changes: 324 additions & 0 deletions docker/postman/postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,330 @@
{
"name": "requirements",
"item": [
{
"name": "NASA-PDS/registry-api#494 querystring supports EQ",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440539\";",
"const minimumExpectedHits = 2; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(hit.properties.product_class[0]).to.eq(\"Product_Bundle\")",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(product_class EQ \"Product_Bundle\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(product_class EQ \"Product_Bundle\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports NE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440540\";",
"const minimumExpectedHits = 36; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(hit.properties.product_class[0]).to.not.eq(\"Product_Bundle\")",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(product_class NE \"Product_Bundle\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(product_class NE \"Product_Bundle\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports GT",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440541\";",
"const minimumExpectedHits = 6; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).gt(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time GT \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time GT \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports LT",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440542\";",
"const minimumExpectedHits = 25; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).lt(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time LT \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time LT \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports GE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440543\";",
"const minimumExpectedHits = 13; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).gte(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time GE \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time GE \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports LE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440544\";",
"const minimumExpectedHits = 32; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).lte(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time LE \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time LE \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#495 querystring supports AND",
"event": [
Expand Down