AndyWalshe | b412c7b | 2020-02-13 15:05:21 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing PMSH functionality |
| 3 | Library OperatingSystem |
| 4 | Library RequestsLibrary |
| 5 | Library String |
| 6 | |
| 7 | Test Setup Create Session pmsh_session ${PMSH_BASE_URL} |
| 8 | Test Teardown Delete All Sessions |
| 9 | |
| 10 | |
| 11 | *** Variables *** |
| 12 | ${PMSH_BASE_URL} https://${PMSH_IP}:8443 |
| 13 | ${HEALTHCHECK_ENDPOINT} /healthcheck |
| 14 | |
| 15 | |
| 16 | *** Test Cases *** |
| 17 | Verify Health Check returns 200 when a REST GET request to healthcheck url |
| 18 | [Tags] PMSH_01 |
| 19 | [Documentation] Verify Health Check returns 200 when a REST GET request to healthcheck url |
| 20 | [Timeout] 1 minute |
| 21 | ${resp}= Get Request pmsh_session ${HEALTHCHECK_ENDPOINT} |
| 22 | VerifyResponse ${resp.status_code} 200 |
| 23 | |
| 24 | Verify Health Check response includes healthy status |
| 25 | [Tags] PMSH_02 |
| 26 | [Documentation] Verify Health Check response includes healthy status |
| 27 | [Timeout] 1 minute |
| 28 | ${resp}= Get Request pmsh_session ${HEALTHCHECK_ENDPOINT} |
| 29 | VerifyResponseContains ${resp.text} healthy |
| 30 | |
| 31 | *** Keywords *** |
| 32 | VerifyResponse |
| 33 | [Arguments] ${actual_response_value} ${expected_response_value} |
| 34 | Should Be Equal As Strings ${actual_response_value} ${expected_response_value} |
| 35 | |
| 36 | VerifyResponseContains |
| 37 | [Arguments] ${response_content} ${string_to_check_for} |
| 38 | Should Contain ${response_content} ${string_to_check_for} |