Skip to content

Commit

Permalink
Fix: Dashboard automation errors for 2.6 pt1 (#1132)
Browse files Browse the repository at this point in the history
* fix test ODS-1402: Verify Quick Starts Work When All Steps Are Skipped

* fix test ODS-1305: Verify External Links In Quick Starts Are Not Broken

* fix test ODS-489: Verify Filters Are Working On Resources Page

* test ODS-1661: Verify RHODS Accept Multiple Admin Groups And CRD Gets Updates

* delete pf version from paths and validate ODS-1680

* test ODS-1686: Verify Automatically Detects a Group Selected Is Removed and Notify the User

* add logs to POST Dashboard API requests

* fix test ODS-1825: Verify User Can Create A S3 Data Connection And Connect It To Workbenches

* fix test ODS-1864: Verify User Can Create A Workbench With Environment Variables

* fix test ODS-2202: Verify User Can Access Only Its Owned Projects

* close all browsers befor ODS-1868

* PR fixes

* Fix script issue

* Fix script issue
  • Loading branch information
FedeAlonso authored Jan 24, 2024
1 parent f6b0717 commit b63590e
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Go To ${group_name} Group Page
Create Group
[Documentation] Creates a user group in OCP (if it doesn't exist)
[Arguments] ${group_name}
${res} ${output}= Run And Return Rc And Output
... oc adm groups new ${group_name} --dry-run=client -o yaml | kubectl apply --validate=false -f -
${res} ${output}= Run And Return Rc And Output
... oc adm groups new ${group_name} --dry-run=client -o yaml | oc apply --validate=false -f -
Should Be Equal As Integers ${res} 0 ${output}

Delete Group
[Documentation] Deletes a user group in OCP (if it exists)
[Arguments] ${group_name}
${res} ${output}= Run And Return Rc And Output
${res} ${output}= Run And Return Rc And Output
... oc delete group ${group_name} --ignore-not-found
Should Be Equal As Integers ${res} 0 ${output}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ${ODH_DASHBOARD_SIDEBAR_HEADER_ENABLE_BUTTON}= //*[@class="pf-v5-c-drawe
${ODH_DASHBOARD_SIDEBAR_HEADER_GET_STARTED_ELEMENT}= //*[@class="pf-v5-c-drawer__panel-main"]//*[.='Get started']
${CARDS_XP}= //*[(contains(@class, 'odh-card')) and (contains(@class, 'pf-v5-c-card'))]
${CARD_BUTTON_XP}= ..//input[@class="pf-v5-c-radio__input"][@name="odh-explore-selectable-card"]
${RES_CARDS_XP}= //article[contains(@class, 'pf-v5-c-card')]
${RES_CARDS_XP}= //div[contains(@data-ouia-component-type, "Card")]
${SAMPLE_APP_CARD_XP}= //*[@id="pachyderm-selectable-card-id"]
${HEADER_XP}= div[@class='pf-v5-c-card__header']
${TITLE_XP}= div[@class='pf-v5-c-card__title']//span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Open QuickStart Element in Resource Section By Name
[Documentation] It opens the element by enabling Quick Start filter in Resources Section of ODS Dashboard.
[Arguments] ${element}
Select Checkbox //input[@id="quickstart--check-box"]
Wait Until Page Contains Element ${RES_CARDS_XP}\[@id="${element}"]
Click Link ${RES_CARDS_XP}\[@id="${element}"]//a
Wait Until Page Contains ELement //div[@class="pf-c-drawer__panel-main"] 5
Wait Until Page Contains Element ${RES_CARDS_XP}\[@id="${element}"]//a[text()="Open"]
Click Link ${RES_CARDS_XP}\[@id="${element}"]//a[text()="Open"]
Wait Until Page Contains ELement //div[contains(@class, "-c-drawer__panel-main")] 5

Star QuickStart Tour
Click Button //button[@data-test="Start button"]
Expand All @@ -33,19 +33,19 @@ Get The Count Of QuickStart Steps

Link Text On QuickStart Card Should Be
[Arguments] ${element} ${exp_link_text}
Element Text Should Be ${RES_CARDS_XP}\[@id="${element}"]//a ${exp_link_text}
Element Text Should Be //div[@id="${element}"]//a ${exp_link_text}

QuickStart Status Should Be
[Documentation] Verifies the label on the item card which shows the progress and closes the sidebar.
[Arguments] ${element} ${progress_string}
IF '${progress_string}'=='In Progress'
Element Text Should Be ${RES_CARDS_XP}\[@id="${element}"]//span[@class="pf-c-label pf-m-purple pf-m-outline"]
Element Text Should Be //div[@id="${element}"]//span[contains(@class, "-c-label pf-m-purple pf-m-outline")]
... In Progress
ELSE IF '${progress_string}'=='Complete'
Element Text Should Be ${RES_CARDS_XP}\[@id="${element}"]//span[@class="pf-c-label pf-m-green pf-m-outline"]
Element Text Should Be //div[@id="${element}"]//span[@class="pf-c-label pf-m-green pf-m-outline"]
... Complete
ELSE IF '${progress_string}'=='Failed'
Element Text Should Be ${RES_CARDS_XP}\[@id="${element}"]//span[@class="pf-c-label pf-m-red pf-m-outline"]
Element Text Should Be //div[@id="${element}"]//span[@class="pf-c-label pf-m-red pf-m-outline"]
... Failed
END

Expand Down Expand Up @@ -221,7 +221,7 @@ Verify Links Are Not Broken For Each QuickStart
${quickStartCount}= Get Length ${quickStartElements}
${version_check}= Is RHODS Version Greater Or Equal Than 1.21.0
IF ${version_check}==True
${versioned_title_xp}= Set Variable //div[@class="pf-c-content"]
${versioned_title_xp}= Set Variable //div[contains(@class, "-c-content")]
ELSE
${versioned_title_xp}= Set Variable //div[@class="pf-c-card__title odh-card__doc-title"]
END
Expand All @@ -232,7 +232,7 @@ Verify Links Are Not Broken For Each QuickStart
${Title}= Split To Lines ${Title}
Log ${Title[${0}]} console=yes
Click Element ${quickStartElements[${counter}]}
Wait Until Element Is Visible //button[@class='pf-c-wizard__nav-link']
Wait Until Element Is Visible //button[contains(@class, "-c-wizard__nav-link")]
External URLs Should Not Be Broken
END

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Resource ../../../ODS.robot

*** Variables ***
${TOLERATION_CHECKBOX}= //input[@id="tolerations-enabled-checkbox"]
${GROUP_BTN_XP}= (//*[@class="pf-c-chip-group"])//*[@class="pf-c-chip__text" ]//following-sibling::button[1]
${GROUP_BTN_XP}= //button[@data-ouia-component-id="Remove"]
${SINGLE_MODE_SERVING_CHECK_BOX}= //input[@id="single-model-serving-platform-enabled-checkbox"]
${MULTI_MODE_SERVING_CHECK_BOX}= //input[@id="multi-model-serving-platform-enabled-checkbox"]
${CUSTOM_EMPTY_GROUP}= empty-group
Expand All @@ -16,25 +16,25 @@ ${CUSTOM_EMPTY_GROUP}= empty-group
Add OpenShift Groups To Data Science Administrators
[Documentation] Add OpenShift Groups to Data Science administrators From RHODS Dashboard
[Arguments] @{admin_groups}
Click Button (//button[@class="pf-c-button pf-c-select__toggle-button pf-m-plain"])[${1}]
Click Button (//button[@aria-label="Options menu"])[${1}]
FOR ${admin_group} IN @{admin_groups}
${present}= Run Keyword And Return Status Element Should Be Visible //*[@class="pf-c-select__menu-item pf-m-selected" and contains(text(), "${admin_group}")]
${present}= Run Keyword And Return Status Element Should Be Visible //button[@role="option" and text()="${admin_group}" and @aria-selected="true"]
IF ${present} != True
Click Button //*[@class="pf-c-select__menu-item"and contains(text(), "${admin_group}")]
Click Button //button[@role="option" and text()="${admin_group}"]
END
END
Press Keys None ESC

Add OpenShift Groups To Data Science User Groups
[Documentation] Add OpenShift Groups to Data Science User From RHODS Dashboard
[Arguments] @{user_groups}
Click Button (//button[@class="pf-c-button pf-c-select__toggle-button pf-m-plain"])[${2}]
Click Button (//button[@aria-label="Options menu"])[${2}]

FOR ${user_group} IN @{user_groups}
${present}= Run Keyword And Return Status
... Element Should Be Visible //*[@class="pf-c-select__menu-item pf-m-selected" and contains(text(), "${user_group}")]
... Element Should Be Visible //button[@role="option" and text()="${user_group}" and @aria-selected="true"]
IF ${present} != True
Click Element //*[@class="pf-c-select__menu-item"and contains(text(), "${user_group}")]
Click Element //button[@role="option" and text()="${user_group}"]
END
END
Press Keys None ESC
Expand All @@ -48,7 +48,7 @@ Launch Dashboard And Check User Management Option Is Available For The User
${authorization_required} = Is Service Account Authorization Required
IF ${authorization_required} Authorize jupyterhub service account
Menu.Navigate To Page Settings User management
Wait Until Element Is Visible //*[@class="pf-c-button pf-c-select__toggle-button pf-m-plain"] timeout=20
Wait Until Element Is Visible //button[@aria-label="Options menu"] timeout=20

Remove OpenShift Groups From Data Science User Groups
[Documentation] Remove OpenShift Groups From Data Science User Groups From Dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ${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
${DC_WORKBENCH_SELECTOR_XP}= xpath=//ul[@aria-label="Notebook select"]/li


*** Keywords ***
Expand Down Expand Up @@ -133,7 +133,7 @@ Fill Data Connection Form
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")]
... Element Should Be Enabled xpath=//div[contains(@class,"modal")]//button[@aria-label="Options menu"]
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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Assign ${permission_type} Permissions To User ${username} in Project ${project_t
Open Data Science Project Details Page ${project_title}
Move To Tab Permissions
Assign ${permission_type} Permissions To User ${username}

Change ${username} Permissions To ${permission_type}
[Documentation] Change the level of permission ${permission_type} for the given user ${username}
... in the currently open DS Project in UI
Expand Down Expand Up @@ -71,9 +71,9 @@ Assign ${permission_type} Permissions To Group ${group_name}
Click Action From Actions Menu
[Documentation] Click an action from Actions menu (3-dots menu on the right)
[Arguments] ${username} ${action}
Click Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]/td[contains(@class,"pf-c-table__action")]/div/button[@aria-label="Actions"] # robocop: disable
Wait Until Page Contains Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]/td[contains(@class,"pf-c-table__action")]/div/ul/li/button[text()="${action}"] # robocop: disable
Click Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]/td[contains(@class,"pf-c-table__action")]/div/ul/li/button[text()="${action}"] # robocop: disable
Click Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]//button[@aria-label="Kebab toggle"] # robocop: disable
Wait Until Page Contains Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]//button[@aria-label="Kebab toggle"]/following-sibling::div//li/button/span/span[text()="${action}"] # robocop: disable
Click Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]//button[@aria-label="Kebab toggle"]/following-sibling::div//li/button/span/span[text()="${action}"] # robocop: disable

Get OpenShift RoleBinding
[Documentation] Fetch the RoleBinding object defining the level of permission of a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ Add Environment Variables In Workbench
Log ${pair_idx}-${key}-${value}
Run Keyword And Continue On Failure Wait Until Page Contains Element
... xpath=//input[@aria-label="key of item ${pair_idx}"]
Input Text ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//input[@aria-label="key of item ${pair_idx}"]
Input Text ${ENV_VARIABLES_SECTION_XP}/div[contains(@class, "-l-split")][${idx}]//input[@aria-label="key of item ${pair_idx}"]
... ${key}
Input Text ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//input[@aria-label="value of item ${pair_idx}"]
Input Text ${ENV_VARIABLES_SECTION_XP}/div[contains(@class, "-l-split")][${idx}]//input[@aria-label="value of item ${pair_idx}"]
... ${value}
IF ${n_pairs}-${pair_idx} > 1
Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//button[text()="${add_key_value_text}"]
Click Element ${ENV_VARIABLES_SECTION_XP}/div[contains(@class, "-l-split")][${idx}]//button[text()="${add_key_value_text}"]
# The element we want to click might get pushed out of view on every loop, let's scroll by an approx
# amount of pixels for the block of elements that gets added.
IF "${add_key_value_text}" == "Add another key / value pair"
Execute Javascript document.getElementsByClassName("pf-c-drawer__content")[1].scrollBy(0,500) # robocop: disable
Execute Javascript document.getElementsByClassName("pf-v5-c-drawer__content")[1].scrollBy(0,500) # robocop: disable
ELSE IF "${add_key_value_text}" == "Add another variable"
Execute Javascript document.getElementsByClassName("pf-c-drawer__content")[1].scrollBy(0,700) # robocop: disable
Execute Javascript document.getElementsByClassName("pf-v5-c-drawer__content")[1].scrollBy(0,700) # robocop: disable
END
END
END
Expand Down Expand Up @@ -168,13 +168,13 @@ Select Environment Variable Types
[Documentation] Selects the type of environment variable in the workbench creation page: Secret vs Config Map
[Arguments] ${k8s_type} ${input_type} ${variable_index}
Run Keyword And Continue On Failure Wait Until Page Contains Element
... ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${variable_index}]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button
Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${variable_index}]//div[contains(@class,"pf-c-select")]/button
... ${ENV_VARIABLES_SECTION_XP}/div[contains(@class, "-l-split")][${variable_index}]//button[@aria-label="Options menu"]
Click Element ${ENV_VARIABLES_SECTION_XP}/div[contains(@class, "-l-split")][${variable_index}]//button[@aria-label="Options menu"]
Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"]
Click Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"]
Run Keyword And Continue On Failure
... Wait Until Page Contains Element ${ENV_VARIABLES_SECTION_XP}//button[div/span[text()="Select one"]]
Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${variable_index}]//button[div/span[text()="Select one"]]
Click Element ${ENV_VARIABLES_SECTION_XP}/div[contains(@class, "-l-split")][${variable_index}]//button[div/span[text()="Select one"]]
Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"]
Click Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Number Of Items Should Be
[Arguments] ${expected_number}
${version_check}= Is RHODS Version Greater Or Equal Than 1.21.0
IF ${version_check}==True
${versioned_title_xp}= Set Variable //div[@class="pf-c-card__title"]/div[@class="pf-c-content"]
${versioned_title_xp}= Set Variable //div[contains(@class, "-c-card__title")]//div[contains(@class, "-c-content")]
ELSE
${versioned_title_xp}= Set Variable //div[@class="pf-c-card__title odh-card__doc-title"]
END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,11 @@ Verify User Can Delete A Data Science Project

Verify User Can Access Only Its Owned Projects
[Tags] Sanity Tier1 ODS-1868
[Documentation] Verifies each user can access only thei owned projects. Except for
[Documentation] Verifies each user can access only they owned projects. Except for
... cluster and dedicated admins which should be able to fetch all the DS Projects
[Setup] Run Keywords
... SeleniumLibrary.Close All Browsers
... AND
... Set Variables For User Access Test
... AND
... Delete Data Science Project From CLI displayed_name=${PRJ_TITLE}
Expand Down

0 comments on commit b63590e

Please sign in to comment.