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

ODS-1932 - Verify user can edit a S3 data connection #846

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

Check warning

Code scanning / Robocop

Keyword '{{ keyword_name }}' has too many arguments ({{ arguments_count }}/{{ max_allowed_count }})

Keyword 'Edit S3 Data Connection' has too many arguments (9/5)
[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}
DataConnections.Click Action From Actions Menu ${dc_name} Edit data connection
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
Expand All @@ -66,25 +56,25 @@ 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

Check warning

Code scanning / Robocop

Keyword name '{{ keyword_name }}' does not follow case convention

Keyword name 'Run keyword And Continue On Failure' does not follow case convention
... ${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

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

Check warning

Code scanning / Robocop

Keyword name '{{ keyword_name }}' does not follow case convention

Keyword name 'Run keyword And Continue On Failure' does not follow case convention
... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${name}"]]

Get Openshift Secret From Data Connection
Expand All @@ -98,3 +88,64 @@ 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}


Fixed Show fixed Hide fixed
Get Data Connection Form Values
[Arguments] ${dc_name}
DataConnections.Click Action From Actions Menu ${dc_name} Edit data connection
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}

# robocop: disable=too-many-calls-in-keyword,line-too-long
Click Action From Actions Menu
Fixed Show fixed Hide fixed
bdattoma marked this conversation as resolved.
Show resolved Hide resolved
[Documentation] Click an action from Actions menu (3-dots menu on the right)
[Arguments] ${data_connection_name} ${action}
Wait Until Page Contains Element xpath://table//tr[td[h3[div[text()='${data_connection_name}']]]]//td[contains(@class, 'pf-c-table__action')]/div
Capture Page Screenshot
Click Element xpath://table//tr[td[h3[div[text()='${data_connection_name}']]]]//td[contains(@class, 'pf-c-table__action')]/div
Capture Page Screenshot
Wait Until Page Contains Element //table//tr[td[h3[div[text()='${data_connection_name}']]]]//td[contains(@class, 'pf-c-table__action')]/div/ul/li/button[contains(text(), '${action}')]
Capture Page Screenshot
Click Element //table//tr[td[h3[div[text()='${data_connection_name}']]]]//td[contains(@class, 'pf-c-table__action')]/div/ul/li/button[contains(text(), '${action}')]
Capture Page Screenshot

Original file line number Diff line number Diff line change
Expand Up @@ -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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you edit the name too?

... 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
Expand Down