Skip to content

Commit

Permalink
fix: CDR-1401 adjust tests for OAUTH
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed May 30, 2024
1 parent 274a95a commit 4b21a5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/runRobotTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ env=0
suite='TEST'
serverBase=${EHRBASE_BASE_URL:-http://ehrbase:8080}
serverNodeName=${SERVER_NODENAME:-local.ehrbase.org}
keycloakBase=${KEYCLOAK_URL:-http://keycloak:8081}
keycloakBase=${KEYCLOAK_URL:-http://keycloak:8080}
POSITIONAL_ARGS=()

############################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Suite Setup Set Library Search Order For Tests

*** Variables ***
${SUT} ADMIN-TEST
&{TEMP_OAUTH_ACCESS_GRANT} client_id=HIP-CDR-EHRbase-Service
... grant_type=password client_secret=bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va
... username=ehrbase-admin password=EvenMoreSecretPassword1!
## the same configuration as in sut_config.py, ADMIN_TEST_CONFIG


*** Test Cases ***
Expand All @@ -22,7 +26,7 @@ ${SUT} ADMIN-TEST
Create Session keycloak ${KEYCLOAK_URL}
${resp} R.Get On Session keycloak /
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal ${OAUTH_ACCESS_GRANT['username']} ehrbase-admin
Should Be Equal ${TEMP_OAUTH_ACCESS_GRANT['username']} ehrbase-admin

2. cdr-core-sanity-check realm exists - OAUTH Admin User
${resp} R.Get On Session keycloak /realms/cdr-core-sanity-check
Expand All @@ -31,7 +35,7 @@ ${SUT} ADMIN-TEST
Log Token service URL: ${resp.json()["token-service"]} console=yes

3. Test Get Token - OAUTH Admin User
Request Access Token ${OAUTH_ACCESS_GRANT}
Request Access Token ${TEMP_OAUTH_ACCESS_GRANT}
Status Should Be 200

4. Upload Template - OAUTH Admin User Creds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ${SUT} TEST
&{TEMP_OAUTH_ACCESS_GRANT} client_id=HIP-CDR-EHRbase-Service
... grant_type=password client_secret=bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va
... username=ehrbase-admin password=EvenMoreSecretPassword1!
## the same configuration as in sut_config.py, ADMIN_TEST_CONFIG


*** Test Cases ***
Expand Down Expand Up @@ -95,9 +96,6 @@ ${SUT} TEST
${err_msg} Run Keyword And Expect Error *
... (admin) delete stored query ${resp_qualified_query_name_version}
Should Contain ${err_msg} Expected status: 403 != 200
&{OAUTH_ACCESS_GRANT} Create Dictionary client_id=HIP-CDR-EHRbase-Service
... grant_type=password client_secret=bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va
... username=ehrbase-admin password=EvenMoreSecretPassword1!
Request Access Token ${TEMP_OAUTH_ACCESS_GRANT}
Status Should Be 200
&{authorization} Create Dictionary
Expand Down

0 comments on commit 4b21a5b

Please sign in to comment.