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

Improve keyword to wait for dashboard and remove Seldon folder #658

Merged
merged 12 commits into from
Dec 22, 2022
2 changes: 1 addition & 1 deletion tests/Resources/Page/HybridCloudConsole/Rhosak.robot
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Clean Up RHOSAK
[Documentation] Cleans up all the RHOSAK created resources from RHOSAK and RHODS UI
[Arguments] ${stream_to_delete} ${topic_to_delete} ${sa_clientid_to_delete} ${rhosak_app_id}
${window_title}= Get Title
IF $window_title == "Streams for Apache Kafka | Red Hat OpenShift Application Services"
IF $window_title == "Streams for Apache Kafka | Red Hat OpenShift Application Services" or $window_title == "Red Hat OpenShift Streams for Apache Kafka"
Maybe Skip RHOSAK Tour
${modal_exists}= Run Keyword And Return Status Wait Until Page Contains Element xpath=//*[contains(@class, "modal")]
IF ${modal_exists}==${TRUE}
Expand Down
19 changes: 15 additions & 4 deletions tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ ${RHODS_LOGO_XPATH}= //img[@alt="Red Hat OpenShift Data Science Logo"]
*** Keywords ***
Launch Dashboard
[Arguments] ${ocp_user_name} ${ocp_user_pw} ${ocp_user_auth_type} ${dashboard_url} ${browser} ${browser_options}
... ${expected_page}=Enabled ${wait_for_cards}=${TRUE}
Open Browser ${dashboard_url} browser=${browser} options=${browser_options}
Login To RHODS Dashboard ${ocp_user_name} ${ocp_user_pw} ${ocp_user_auth_type}
Wait for RHODS Dashboard to Load
Wait for RHODS Dashboard to Load expected_page=${expected_page}

Check warning

Code scanning / Robocop

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

Keyword name 'Wait for RHODS Dashboard to Load' does not follow case convention
... wait_for_cards=${wait_for_cards}

Authorize rhods-dashboard service account
Wait Until Page Contains Authorize Access
Expand Down Expand Up @@ -81,9 +83,17 @@ Logout From RHODS Dashboard
Wait Until Page Contains Log in with OpenShift

Wait for RHODS Dashboard to Load
[Arguments] ${dashboard_title}="Red Hat OpenShift Data Science"
[Arguments] ${dashboard_title}="Red Hat OpenShift Data Science" ${wait_for_cards}=${TRUE}
... ${expected_page}=Enabled
Wait For Condition return document.title == ${dashboard_title} timeout=15s
Wait Until Page Contains Element xpath:${RHODS_LOGO_XPATH} timeout=15s
IF "${expected_page}" != "${NONE}"
Wait Until Page Contains Element xpath://h1[text()="${expected_page}"]

Check warning

Code scanning / Robocop

Trailing whitespace at the end of line

Trailing whitespace at the end of line
END
IF ${wait_for_cards} == ${TRUE}

Check notice

Code scanning / Robocop

IF can be replaced with inline IF

IF can be replaced with inline IF
Wait Until Cards Are Loaded
END

Check warning

Code scanning / Robocop

Trailing whitespace at the end of line

Trailing whitespace at the end of line

Wait Until RHODS Dashboard ${dashboard_app} Is Visible
# Ideally the timeout would be an arg but Robot does not allow "normal" and "embedded" arguments
Expand Down Expand Up @@ -123,7 +133,7 @@ Verify Service Is Available In The Explore Page
[Documentation] Verify the service appears in Applications > Explore
[Arguments] ${app_name}
Menu.Navigate To Page Applications Explore
Wait Until Cards Are Loaded
Wait for RHODS Dashboard to Load expected_page=Explore

Check warning

Code scanning / Robocop

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

Keyword name 'Wait for RHODS Dashboard to Load' does not follow case convention
Capture Page Screenshot
Page Should Contain Element //article//*[.='${app_name}']

Expand Down Expand Up @@ -193,7 +203,8 @@ Load Expected Data Of RHODS Explore Section
[Return] ${apps_dict_obj}

Wait Until Cards Are Loaded
Wait Until Page Contains Element xpath://div[contains(@class,'odh-explore-apps__gallery')]
Wait Until Page Contains Element xpath://div[contains(@class,'-apps__gallery')]

Check warning

Code scanning / Robocop

Trailing whitespace at the end of line

Trailing whitespace at the end of line

Get App ID From Card
[Arguments] ${card_locator}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ ${SPAWNER_LINK}= xpath=//a[text()="Launch Jupyter"]
*** Keywords ***
Open Data Science Projects Home Page
[Documentation] Verifies submenu Settings > "Data Science Projects" is visible
Page Should Contain Data Science Projects
# Page Should Contain Data Science Projects
Click Link Data Science Projects
Wait for RHODS Dashboard to Load wait_for_cards=${FALSE} expected_page=Data science projects

Check warning

Code scanning / Robocop

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

Keyword name 'Wait for RHODS Dashboard to Load' does not follow case convention
Wait Until Page Contains View your existing projects or create new projects. timeout=30
Wait Until Page Contains Element ${DS_PROJECT_XP} timeout=30
# Wait Until Page Contains Element ${DS_PROJECT_XP} timeout=30
Maybe Wait For Dashboard Loading Spinner Page

Is Data Science Projects Page Open
Expand Down
12 changes: 8 additions & 4 deletions tests/Tests/500__jupyterhub/jupyterhub-user-access.robot
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ Set Custom Access Groups
Check New Access Configuration Works As Expected
[Documentation] Checks if the new access configuration (using two custom groups)
... works as expected in JH
Launch Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
... ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS}
Launch Dashboard ocp_user_name=${TEST_USER.USERNAME} ocp_user_pw=${TEST_USER.PASSWORD}
... ocp_user_auth_type=${TEST_USER.AUTH_TYPE} dashboard_url=${ODH_DASHBOARD_URL}
... browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS}
... expected_page=${NONE} wait_for_cards=${FALSE}
${version_check}= Is RHODS Version Greater Or Equal Than 1.20.0
IF ${version_check} == True
${status}= Run Keyword And Return Status Launch Jupyter From RHODS Dashboard Link
Expand All @@ -124,7 +126,8 @@ Check New Access Configuration Works As Expected
Capture Page Screenshot perm_admin_custom.png
Logout From RHODS Dashboard
Login To RHODS Dashboard ${TEST_USER_3.USERNAME} ${TEST_USER_3.PASSWORD} ${TEST_USER_3.AUTH_TYPE}
Wait for RHODS Dashboard to Load
Wait for RHODS Dashboard to Load expected_page=Start a notebook server

Check warning

Code scanning / Robocop

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

Keyword name 'Wait for RHODS Dashboard to Load' does not follow case convention
... wait_for_cards=${FALSE}
Run Keyword And Continue On Failure Verify Jupyter Access Level expected_result=user
Capture Page Screenshot perm_user_custom.png
Logout From RHODS Dashboard
Expand All @@ -139,7 +142,8 @@ Check Standard Access Configuration Works As Expected
Capture Page Screenshot perm_admin_std.png
Logout From RHODS Dashboard
Login To RHODS Dashboard ${TEST_USER_4.USERNAME} ${TEST_USER_4.PASSWORD} ${TEST_USER_4.AUTH_TYPE}
Wait for RHODS Dashboard to Load
Wait for RHODS Dashboard to Load expected_page=Start a notebook server

Check warning

Code scanning / Robocop

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

Keyword name 'Wait for RHODS Dashboard to Load' does not follow case convention
... wait_for_cards=${FALSE}
Run Keyword And Continue On Failure Verify Jupyter Access Level expected_result=user
Capture Page Screenshot perm_user_std.png
Logout From RHODS Dashboard
Expand Down
Empty file.