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

Fix: new home page issues #1428

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
29 changes: 25 additions & 4 deletions ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
${RHODS_GROUPS_CONFIG_CM}= rhods-groups-config
${RHODS_LOGO_XPATH}= //img[@alt="${ODH_DASHBOARD_PROJECT_NAME} Logo"]
@{ISV_TO_REMOVE_SELF_MANAGED}= Create List starburst nvidia rhoam
@{HOME_HEADERS}= Projects Train, serve, monitor, and manage AI/ML models Get oriented with learning resources


*** Keywords ***
Expand All @@ -62,7 +63,6 @@
... alias=${browser_alias}
Login To RHODS Dashboard ${ocp_user_name} ${ocp_user_pw} ${ocp_user_auth_type}
Wait For RHODS Dashboard To Load expected_page=${expected_page}
... wait_for_cards=${wait_for_cards}

Authorize rhods-dashboard service account
Wait Until Page Contains Authorize Access
Expand Down Expand Up @@ -103,7 +103,17 @@
... ${expected_page}=Enabled
Wait For Condition return document.title == ${dashboard_title} timeout=15s
Wait Until Page Contains Element xpath:${RHODS_LOGO_XPATH} timeout=20s
IF "${expected_page}" != "${NONE}" Wait For Dashboard Page Title ${expected_page} timeout=75s
IF "${expected_page}" != "${NONE}"
# Detect if we are in the new landing page instead in "Enable"
${first_header}= Set Variable (//h1)[1]
Wait Until Element Is Visible xpath:${first_header}
${h1_text} Get Text xpath:${first_header}

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning test

The assignment sign is not consistent within the file. Expected '=' but got '' instead
IF "${expected_page}" == "Enabled" and "${h1_text}" == "${HOME_HEADERS}[0]"
Wait For RHOAI Home Page To Load
ELSE
Wait For Dashboard Page Title ${expected_page} timeout=75s
END
END
IF ${wait_for_cards} == ${TRUE}
Wait Until Keyword Succeeds 3 times 5 seconds Wait Until Cards Are Loaded
END
Expand All @@ -112,15 +122,26 @@
[Documentation] Wait until the visible title (h1) of the current Dashboard page is '${page_title}'
[Arguments] ${page_title} ${timeout}=10s
${page_title_element}= Set Variable //*[@data-testid="app-page-title"]
Wait Until Element is Visible ${page_title_element} timeout=${timeout}
Wait Until Element Is Visible ${page_title_element} timeout=${timeout}
# Sometimes the h1 text is inside a child element, thus get it with textContent attribute
${title}= Get Element Attribute ${page_title_element} textContent
Should Be Equal ${title} ${page_title}

Wait For RHOAI Home Page To Load
[Documentation] Compare the h1 headers of the landing page with the expected ones
Wait Until Element Is Visible xpath:(//h1)[1]
${h1_elements}= Get WebElements xpath://h1
${h1_texts}= Create List

Check notice

Code scanning / Robocop

{{ create_keyword }} can be replaced with VAR Note test

Create List can be replaced with VAR
FOR ${element} IN @{h1_elements}
${text}= Get Text ${element}
Append To List ${h1_texts} ${text}
END
List Should Contain Sub List ${h1_texts} ${HOME_HEADERS}

Wait Until RHODS Dashboard ${dashboard_app} Is Visible
# Ideally the timeout would be an arg but Robot does not allow "normal" and "embedded" arguments
# Setting timeout to 30seconds since anything beyond that should be flagged as a UI bug
Wait Until Element is Visible xpath://div[contains(@class,'gallery')]/div//div[@class="pf-v5-c-card__title"]//*[text()="${dashboard_app}"]
Wait Until Element Is Visible xpath://div[contains(@class,'gallery')]/div//div[@class="pf-v5-c-card__title"]//*[text()="${dashboard_app}"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (143/120)
... timeout=30s

Launch ${dashboard_app} From RHODS Dashboard Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ Launch Notebook And Stop It # robocop: disable
Login To Jupyterhub ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
${authorization_required} = Is Service Account Authorization Required
IF ${authorization_required} Authorize Jupyterhub Service Account
Wait Until Page Contains Start a notebook server
Wait Until Page Contains Start a notebook server 30
Fix Spawner Status
Spawn Notebook With Arguments image=minimal-notebook
End Web Test
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Verify Content In RHODS Explore Section
# TODO: In ODH there are only 2 Apps, we excpect 7 Apps according to:
# ods_ci/tests/Resources/Files/AppsInfoDictionary_latest.json
${EXP_DATA_DICT}= Load Expected Data Of RHODS Explore Section
Click Link Explore
Navigate To Page Applications Explore
Wait For RHODS Dashboard To Load expected_page=Explore
Check Number Of Displayed Cards Is Correct expected_data=${EXP_DATA_DICT}
Check Cards Details Are Correct expected_data=${EXP_DATA_DICT}
Expand All @@ -75,7 +75,7 @@ Verify RHODS Explore Section Contains Only Expected ISVs
# TODO: In ODH there are only 2 Apps, we excpect 7 Apps according to:
# ods_ci/tests/Resources/Files/AppsInfoDictionary_latest.json
${EXP_DATA_DICT}= Load Expected Data Of RHODS Explore Section
Click Link Explore
Navigate To Page Applications Explore
Wait For RHODS Dashboard To Load expected_page=Explore
Check Number Of Displayed Cards Is Correct expected_data=${EXP_DATA_DICT}
Check Dashboard Diplayes Expected ISVs expected_data=${EXP_DATA_DICT}
Expand Down Expand Up @@ -124,7 +124,7 @@ Verify CSS Style Of Getting Started Descriptions
[Tags] Smoke
... Tier1
... ODS-1165
Click Link Explore
Navigate To Page Applications Explore
Wait For RHODS Dashboard To Load expected_page=Explore
${status}= Open Get Started Sidebar And Return Status card_locator=${JUPYTER_CARD_XP}
Should Be Equal ${status} ${TRUE}
Expand Down
Loading