Skip to content

Commit

Permalink
Merge pull request #2201 from bcgov/2177-postman-test-edits-2
Browse files Browse the repository at this point in the history
[GWELLS-2177] TESTS** Postman Test edits
  • Loading branch information
LocalNewsTV authored Mar 21, 2024
2 parents 9d4f913 + ce367b2 commit 002c17d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 63 deletions.
12 changes: 6 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,6 @@ def apiTest (String stageName, String stageUrl, String envSuffix) {
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./exports_api_tests.json \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
"""

if ("dev".equalsIgnoreCase("${envSuffix}")) {
Expand All @@ -312,6 +306,12 @@ def apiTest (String stageName, String stageUrl, String envSuffix) {
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./exports_api_tests.json \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
"""
}

Expand Down
38 changes: 32 additions & 6 deletions Jenkinsfile.ocp4
Original file line number Diff line number Diff line change
Expand Up @@ -209,66 +209,80 @@ def apiTest (String stageName, String stageUrl, String envSuffix) {
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./registries_v2_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./wells_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./wells_v2_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./submissions_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./submissions_v2_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./aquifers_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./aquifers_v2_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./cities_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./configuration_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./utilities_api_tests.json \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./exports_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
Expand All @@ -279,12 +293,24 @@ def apiTest (String stageName, String stageUrl, String envSuffix) {
if ("dev".equalsIgnoreCase("${envSuffix}")) {
sh """
newman run ./wells_search_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./wells_search_v2_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
--global-var client_secret=\$GWELLS_API_TEST_CLIENT_SECRET \
-r cli,junit,html
newman run ./exports_api_tests.json \
--color on \
--disable-unicode \
--global-var base_url=\$BASE_URL \
--global-var auth_server=\$GWELLS_API_TEST_AUTH_SERVER \
--global-var client_id=\$GWELLS_API_TEST_CLIENT_ID \
Expand Down
4 changes: 2 additions & 2 deletions tests/api-tests/aquifers_v2_api_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1617,8 +1617,8 @@
"",
"pm.test(\"Responses contains search term\", () => {",
" jsonData.forEach((entry) => {",
" const stringified = JSON.stringify(entry)",
" pm.expect(stringified.includes('Aquifer')).to.be.true;",
" const stringified = JSON.stringify(entry).toLowerCase()",
" pm.expect(stringified.includes('aquifer')).to.be.true;",
" })",
"})"
],
Expand Down
49 changes: 0 additions & 49 deletions tests/api-tests/wells_v2_api_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,55 +380,6 @@
},
"response": []
},
{
"name": "Wells Location Curated Search",
"event": [
{
"listen": "test",
"script": {
"exec": [
"",
"pm.test(\"Response 200\", () => {",
" pm.expect(pm.response.code).to.equal(200)",
"})",
"",
"pm.test(\"Response Object correct\", () => {",
" let response = pm.response.json();",
" pm.expect(response.hasOwnProperty('count')).to.be.true;",
" pm.expect(response.hasOwnProperty('next')).to.be.true;",
" pm.expect(response.hasOwnProperty('previous')).to.be.true;",
" pm.expect(response.hasOwnProperty('offset')).to.be.true;",
" response.results.forEach((result) => {",
" pm.expect(result.hasOwnProperty('street_address')).to.be.true;",
" pm.expect(result.hasOwnProperty('longitude')).to.be.true;",
" pm.expect(result.hasOwnProperty('latitude')).to.be.true;",
" pm.expect(result.hasOwnProperty('well_tag_number')).to.be.true;",
" })",
"})"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v2/wells/locations",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v2",
"wells",
"locations"
]
}
},
"response": []
},
{
"name": "Create a new Aquifer",
"event": [
Expand Down

0 comments on commit 002c17d

Please sign in to comment.