diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 40e76a733..3efa7709d 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -16,6 +16,7 @@ ${DC_ADD_BTN_1_XP}= ${DC_SECTION_XP}//button[.="Add data connection"] ${DC_ADD_BTN_2_XP}= xpath=//footer/button[.="Add data connection"] ${S3_BUCKET_DC_INPUT_XP}= xpath=//input[@aria-label="Field list AWS_S3_BUCKET"] ${S3_DC_ADD_BTN}= xpath=//footer/button[.="Add data connection"] +${S3_DC_EDIT_BTN}= xpath=//footer/button[.="Update data connection"] ${DC_WORKBENCH_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li @@ -25,34 +26,23 @@ Create S3 Data Connection [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ... ${aws_s3_endpoint}=${S3.AWS_DEFAULT_ENDPOINT} ${aws_region}=${S3.AWS_DEFAULT_REGION} ... ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} ${aws_bucket_name}=${NONE} - Click Button ${DC_ADD_BTN_1_XP} - Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} - Input Text ${S3_NAME_DC_INPUT_XP} ${dc_name} - Input Text ${S3_KEY_DC_INPUT_XP} ${aws_access_key} - Input Text ${S3_SECRET_DC_INPUT_XP} ${aws_secret_access} - Input Text ${S3_ENDPOINT_DC_INPUT_XP} ${aws_s3_endpoint} - Input Text ${S3_REGION_DC_INPUT_XP} ${aws_region} - ${version_check}= Is RHODS Version Greater Or Equal Than 1.20.0 - IF ${version_check}==True - Input Text ${S3_BUCKET_DC_INPUT_XP} ${aws_bucket_name} - END - IF "${connected_workbench}" == "${NONE}" - Log msg=you are not connecting any workbenchs to ${dc_name} DataConnection - ELSE - Run Keyword And Continue On Failure - ... Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] - FOR ${workbench_title} IN @{connected_workbench} - Set Connection Between Data Connection And Workbench ${workbench_title} - Run Keyword And Continue On Failure Element Should Be Enabled ${S3_DC_ADD_BTN} - END - END - IF ${press_cancel} == ${TRUE} - Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE - Wait Until Element Is Enabled ${S3_DC_ADD_BTN} - Click Button ${S3_DC_ADD_BTN} - END - Wait Until Generic Modal Disappears + Click Button ${DC_ADD_BTN_1_XP} + Fill Data Connection Form ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} + ... ${S3_DC_ADD_BTN} aws_s3_endpoint=${aws_s3_endpoint} aws_region=${aws_region} + ... connected_workbench=${connected_workbench} press_cancel=${press_cancel} + ... aws_bucket_name=${aws_bucket_name} + Wait Until Project Is Open project_title=${project_title} + +Edit S3 Data Connection + [Documentation] Edits a S3 Data Connection from DS Project details page + [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} + ... ${aws_s3_endpoint}=${S3.AWS_DEFAULT_ENDPOINT} ${aws_region}=${S3.AWS_DEFAULT_REGION} + ... ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} ${aws_bucket_name}=${NONE} + Click Action From Actions Menu item_title=${dc_name} item_type=data connection action=Edit + Fill Data Connection Form ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} + ... ${S3_DC_EDIT_BTN} aws_s3_endpoint=${aws_s3_endpoint} aws_region=${aws_region} + ... connected_workbench=${connected_workbench} press_cancel=${press_cancel} + ... aws_bucket_name=${aws_bucket_name} Wait Until Project Is Open project_title=${project_title} Set Connection Between Data Connection And Workbench @@ -66,17 +56,17 @@ Set Connection Between Data Connection And Workbench Data Connection Should Be Listed [Documentation] Checks a Data Connection is listed in DS Project details page [Arguments] ${name} ${type} ${connected_workbench} - Run keyword And Continue On Failure Page Should Contain Element + Run keyword And Continue On Failure Page Should Contain Element ... ${DC_SECTION_XP}//td[@data-label="Name"]/*/div[text()="${name}"] Run keyword And Continue On Failure Page Should Contain Element ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${name}"]]/td[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element + Run Keyword And Continue On Failure Page Should Contain Element ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${name}"]]/td[text()="No connections"] ELSE FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} Log ${index}: ${workbench_title} - Run Keyword And Continue On Failure Page Should Contain Element + Run Keyword And Continue On Failure Page Should Contain Element ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] END END @@ -84,7 +74,7 @@ Data Connection Should Be Listed Data Connection Should Not Be Listed [Documentation] Checks a Data Connection is not listed in DS Project details page [Arguments] ${name} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${name}"]] Get Openshift Secret From Data Connection @@ -98,3 +88,50 @@ Delete Data Connection [Arguments] ${name} ${press_cancel}=${FALSE} Click Action From Actions Menu item_title=${name} item_type=data connection action=Delete Handle Deletion Confirmation Modal item_title=${name} item_type=data connection press_cancel=${press_cancel} + +Fill Data Connection Form + [Documentation] Data Connection Form can be used in the create or edit + [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${action_btn} + ... ${aws_s3_endpoint}=${S3.AWS_DEFAULT_ENDPOINT} ${aws_region}=${S3.AWS_DEFAULT_REGION} + ... ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} ${aws_bucket_name}=${NONE} + Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} + Input Text ${S3_NAME_DC_INPUT_XP} ${dc_name} + Input Text ${S3_KEY_DC_INPUT_XP} ${aws_access_key} + Input Text ${S3_SECRET_DC_INPUT_XP} ${aws_secret_access} + Input Text ${S3_ENDPOINT_DC_INPUT_XP} ${aws_s3_endpoint} + Input Text ${S3_REGION_DC_INPUT_XP} ${aws_region} + ${version_check}= Is RHODS Version Greater Or Equal Than 1.20.0 + IF ${version_check}==True + Input Text ${S3_BUCKET_DC_INPUT_XP} ${aws_bucket_name} + END + IF "${connected_workbench}" == "${NONE}" + Log msg=you are not connecting any workbenchs to ${dc_name} DataConnection + ELSE + Run Keyword And Continue On Failure + ... Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] + FOR ${workbench_title} IN @{connected_workbench} + Set Connection Between Data Connection And Workbench ${workbench_title} + Run Keyword And Continue On Failure Element Should Be Enabled ${S3_DC_ADD_BTN} + END + END + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Wait Until Element Is Enabled ${action_btn} + Click Button ${action_btn} + END + Wait Until Generic Modal Disappears + Wait Until Project Is Open project_title=${project_title} + + +Get Data Connection Form Values + [Arguments] ${dc_name} + Click Action From Actions Menu item_title=${dc_name} item_type=data connection action=Edit + Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} + ${s3_name} get element attribute ${S3_NAME_DC_INPUT_XP} value + ${s3_key} get element attribute ${S3_KEY_DC_INPUT_XP} value + ${s3_secret} get element attribute ${S3_SECRET_DC_INPUT_XP} value + ${s3_endpoint} get element attribute ${S3_ENDPOINT_DC_INPUT_XP} value + ${s3_region} get element attribute ${S3_REGION_DC_INPUT_XP} value + ${s3_bucket} get element attribute ${S3_BUCKET_DC_INPUT_XP} value + [return] ${s3_name} ${s3_key} ${s3_secret} ${s3_endpoint} ${s3_region} ${s3_bucket} diff --git a/ods_ci/tests/Resources/RHOSi.resource b/ods_ci/tests/Resources/RHOSi.resource index 6d88aedfe..9d7fd08b5 100644 --- a/ods_ci/tests/Resources/RHOSi.resource +++ b/ods_ci/tests/Resources/RHOSi.resource @@ -37,6 +37,8 @@ Resource Common.robot ... Restore Starburst Original License And Verify Deployment ... Create S3 Data Connection ... Create Starburst Enteprise License Secret +... Get Data Connection Form Values +... Fill Data Connection Form *** Keywords *** diff --git a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 5b5cb820e..47fdc31f9 100644 --- a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -507,6 +507,30 @@ Verify User Can Delete A Data Science Project Wait Until Data Science Project Is Deleted project_title=${PRJ_TITLE} # check workbenches and resources get deleted too +Verify User Can Edit A S3 Data Connection + [Tags] Sanity Tier1 ODS-1932 + [Documentation] Verifies users can add a Data connection to AWS S3 + Open Data Science Projects Home Page + Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} + ... resource_name=${PRJ_RESOURCE_NAME} + Open Data Science Projects Home Page + Project Should Be Listed project_title=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} + ... aws_access_key=${DC_S3_AWS_SECRET_ACCESS_KEY} + ... aws_secret_access=${DC_S3_AWS_SECRET_ACCESS_KEY} + ... aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} + Edit S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} + ... aws_access_key=${S3.AWS_ACCESS_KEY_ID}-test aws_secret_access=${S3.AWS_SECRET_ACCESS_KEY}-test + ... aws_bucket_name=ods-ci-ds-pipelines-test aws_region=${DC_S3_REGION} + ... aws_s3_endpoint=${DC_S3_ENDPOINT} + ${s3_name} ${s3_key} ${s3_secret} ${s3_endpoint} ${s3_region} ${s3_bucket} Get Data Connection Form Values ${DC_S3_NAME} + Should Be Equal ${s3_name} ${DC_S3_NAME} + Should Be Equal ${s3_key} ${S3.AWS_ACCESS_KEY_ID}-test + Should Be Equal ${s3_secret} ${S3.AWS_SECRET_ACCESS_KEY}-test + Should Be Equal ${s3_endpoint} ${DC_S3_ENDPOINT} + Should Be Equal ${s3_region} ${DC_S3_REGION} + Should Be Equal ${s3_bucket} ods-ci-ds-pipelines-test *** Keywords *** Project Suite Setup