Skip to content

Commit

Permalink
Verify that the color of the Jupyter Card code block is gray
Browse files Browse the repository at this point in the history
Signed-off-by: manosnoam <[email protected]>
  • Loading branch information
manosnoam committed Mar 22, 2024
1 parent 4d4123e commit 561e7cb
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 47 deletions.
4 changes: 2 additions & 2 deletions ods_ci/tests/Resources/Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ CSS Property Value Should Be
[Documentation] Compare the actual CSS property value with the expected one
[Arguments] ${locator} ${property} ${exp_value} ${operation}=equal
${el_text}= Get Text xpath:${locator}
Log Text of the target element: ${el_text}//div[contains(@class,'odh-markdown-view')]//p
Log Text of the target element: ${el_text}
${actual_value}= Get CSS Property Value xpath:${locator} ${property}
IF $operation == "contains"
Run Keyword And Continue On Failure Should Contain ${actual_value} ${exp_value}
Expand Down Expand Up @@ -316,7 +316,7 @@ Get Sub Domain Of Current URL
${domain} = Fetch From Left string=${current_url} marker=.
RETURN ${domain}

Is Current Sub Domain Start With
Does Current Sub Domain Start With
[Documentation] Check if current sub-domain start with the given String
... and returns True/False
[Arguments] ${url}
Expand Down
2 changes: 1 addition & 1 deletion ods_ci/tests/Resources/Page/LoginPage.robot
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Login To Openshift
${expected_text_list} = Create List Log in with Administrator Developer Data Science Projects
Wait Until Page Contains A String In List ${expected_text_list}
# Return if page is not the Login page (no login required)
${should_login} = Is Current Sub Domain Start With https://oauth
${should_login} = Does Current Sub Domain Start With https://oauth
IF not ${should_login} RETURN
# If here we need to login
Wait Until Element is Visible xpath://div[@class="pf-c-login"] timeout=10s
Expand Down
2 changes: 1 addition & 1 deletion ods_ci/tests/Resources/Page/OCPDashboard/OCPMenu.robot
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Switch To Developer Perspective
Maybe Skip Tour
[Documentation] If we are in the openshift web console, maybe skip the first time
... tour popup given to users, otherwise RETURN.
${should_cont} = Is Current Sub Domain Start With https://console-openshift-console
${should_cont} = Does Current Sub Domain Start With https://console-openshift-console

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 ${should_cont}==False
RETURN
END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ ${ODH_DASHBOARD_SIDEBAR_HEADER_GET_STARTED_ELEMENT}= //*[@class="pf-v5-c-drawe
${CARDS_XP}= //*[(contains(@class, 'odh-card')) and (contains(@class, 'pf-v5-c-card'))]
${CARD_BUTTON_XP}= //input[@name="odh-explore-selectable-card"]
${RES_CARDS_XP}= //div[contains(@data-ouia-component-type, "Card")]
${SAMPLE_APP_CARD_XP}= //div[contains(@data-testid,"explore-card")]
${SAMPLE_APP_CARD_XP}= //div[contains(@data-testid,"explore-card")]
${JUPYTER_CARD_XP}= //div[@data-testid="explore-card jupyter"]
${EXPLORE_PANEL_XP}= //div[@data-testid="explore-drawer-panel"]
${HEADER_XP}= div[@class='pf-v5-c-card__header']
${TITLE_XP}= div[@class='pf-v5-c-card__title']//span
${TITLE_XP_OLD}= div[@class='pf-v5-c-card__title']//div/div[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ ${EDITOR_RUNTIME_BTN_XP}= //div[contains(@class, "odh-dashboard__code-editor"

*** Keywords ***
Click Add Serving Runtime Template Button
SeleniumLibrary.Wait Until Page Contains Element ${ADD_RUNTIME_BTN_XP}
SeleniumLibrary.Click Element ${ADD_RUNTIME_BTN_XP}
Run Keyword And Continue On Failure SeleniumLibrary.Page Should Contain Add a serving runtime
Run Keyword And Continue On Failure SeleniumLibrary.Page Should Contain Drag a file here, upload files, or start from scratch.
Run Keyword And Continue On Failure SeleniumLibrary.Page Should Contain Element ${UPLOAD_RUNTIME_BTN_XP}
Run Keyword And Continue On Failure SeleniumLibrary.Page Should Contain Element ${SCRATCH_RUNTIME_BTN_XP}
Run Keyword And Continue On Failure SeleniumLibrary.Page Should Contain Element ${EDITOR_RUNTIME_BTN_XP}
Wait Until Page Contains Element ${ADD_RUNTIME_BTN_XP}
Click Element ${ADD_RUNTIME_BTN_XP}
Run Keyword And Continue On Failure Page Should Contain Add a serving runtime
Run Keyword And Continue On Failure Page Should Contain Drag a file here, upload files, or start from scratch.
Run Keyword And Continue On Failure Page Should Contain Element ${UPLOAD_RUNTIME_BTN_XP}
Run Keyword And Continue On Failure Page Should Contain Element ${SCRATCH_RUNTIME_BTN_XP}
Run Keyword And Continue On Failure Page Should Contain Element ${EDITOR_RUNTIME_BTN_XP}

Upload Serving Runtime Template
[Documentation] Uploads via UI a YAML file containing a custom Serving Runtime definition
Expand All @@ -31,27 +31,27 @@ Upload Serving Runtime Template
Element Should Be Enabled ${UPLOAD_RUNTIME_BTN_XP}
${rc} ${pwd}= Run And Return Rc And Output echo $PWD
Should Be Equal As Integers ${rc} ${0}
SeleniumLibrary.Choose File ${EDITOR_RUNTIME_BTN_XP}//input[@type="file"] ${pwd}/${runtime_filepath}
Choose File ${EDITOR_RUNTIME_BTN_XP}//input[@type="file"] ${pwd}/${runtime_filepath}
Wait For Dashboard Page Title Add serving runtime
Run Keyword And Continue On Failure Wait Until Page Contains Element //span[text()="kind"]
Run Keyword And Continue On Failure Wait Until Page Contains Element //span[text()="ServingRuntime"]
Select Model Serving Platform platform=${serving_platform}
IF '${serving_platform}'=='single' Select Runtime API Protocol
Submit Serving Runtime Template

Submit Serving Runtime Template
SeleniumLibrary.Click Element ${SUBMIT_RUNTIME_BTN_XP}
Click Element ${SUBMIT_RUNTIME_BTN_XP}
Wait Until Element Is Not Visible ${SUBMIT_RUNTIME_BTN_XP}
Wait For RHODS Dashboard To Load expected_page=Serving runtimes
... wait_for_cards=${FALSE}

Serving Runtime Template Should Be Listed
[Arguments] ${displayed_name} ${serving_platform}
Run Keyword And Continue On Failure
... SeleniumLibrary.Wait Until Page Contains Element
... Wait Until Page Contains Element
... //table//tr/td[@data-label="Name"]//div[text()="${displayed_name}"]
... timeout=10s
Run Keyword And Continue On Failure
... SeleniumLibrary.Wait Until Page Contains Element
... Wait Until Page Contains Element
... xpath=//table//tr[td[@data-label="Name"]//div[text()="${displayed_name}"]]/td[@data-label="Serving platforms supported"] # robocop: disable
${actual_platform_labels_str}= SeleniumLibrary.Get Text
${actual_platform_labels_str}= Get Text
... xpath=//table//tr[td[@data-label="Name"]//div[text()="${displayed_name}"]]/td[@data-label="Serving platforms supported"] # robocop: disable
${actual_platform_labels}= Split To Lines ${actual_platform_labels_str}
IF "${serving_platform}" == "both"
Expand Down Expand Up @@ -92,13 +92,13 @@ Select Model Serving Platform
[Documentation] Selects which model serving platform the serving runtime could be executed on
[Arguments] ${platform}="both"
${platform_link_name}= Get From Dictionary ${PLATFORM_NAMES_MAPPING} ${platform.lower()}
SeleniumLibrary.Click Element xpath://div[@data-testid="custom-serving-runtime-selection"]//button
SeleniumLibrary.Wait Until Page Contains Element xpath://a[text()="${platform_link_name}"]
SeleniumLibrary.Click Link ${platform_link_name}
Click Element xpath://div[@data-testid="custom-serving-runtime-selection"]//button
Wait Until Page Contains Element xpath://a[text()="${platform_link_name}"]
Click Link ${platform_link_name}

Select Runtime API Protocol
[Documentation] Selects which API protocol for the runtime
[Arguments] ${protocol}=gRPC
SeleniumLibrary.Click Element xpath://div[@data-testid="custom-serving-api-protocol-selection"]//button
SeleniumLibrary.Wait Until Page Contains Element xpath://a[text()="${protocol}"]
SeleniumLibrary.Click Link ${protocol}
Click Element xpath://div[@data-testid="custom-serving-api-protocol-selection"]//button
Wait Until Page Contains Element xpath://a[text()="${protocol}"]
Click Link ${protocol}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Resource ../../Resources/Page/OCPDashboard/OperatorHub/InstallODH.robot
Resource ../../Resources/RHOSi.resource
Resource ../../Resources/ODS.robot
Resource ../../Resources/Page/ODH/ODHDashboard/ODHDashboard.resource
Resource ../../Resources/Page/ODH/ODHDashboard/ODHDashboard.robot
Resource ../../Resources/Page/ODH/ODHDashboard/ODHDashboardResources.resource
Resource ../../Resources/Page/ODH/AiApps/Anaconda.resource
Resource ../../Resources/Page/LoginPage.robot
Expand Down Expand Up @@ -125,7 +126,8 @@ Verify CSS Style Of Getting Started Descriptions
... ODS-1165
Click Link Explore
Wait For RHODS Dashboard To Load expected_page=Explore
Open Get Started Sidebar And Return Status card_locator=${SAMPLE_APP_CARD_XP}
${status}= Open Get Started Sidebar And Return Status card_locator=${JUPYTER_CARD_XP}
Should Be Equal ${status} ${TRUE}
Capture Page Screenshot get_started_sidebar.png
Verify Jupyter Card CSS Style

Expand Down Expand Up @@ -502,7 +504,9 @@ RHODS Dahsboard Pod Should Contain OauthProxy Container

Verify Jupyter Card CSS Style
[Documentation] Compare the some CSS properties of the Explore page with the expected ones
# Please try to avoid verifying unique css values (e.g. colors), that might change accross RHODS versions
# Verify that the color of the Jupyter code is gray
CSS Property Value Should Be locator=${EXPLORE_PANEL_XP}//code
... property=background-color exp_value=rgba(240, 240, 240, 1)
CSS Property Value Should Be locator=${SIDEBAR_TEXT_CONTAINER_XP}//p
... property=margin-bottom exp_value=8px
CSS Property Value Should Be locator=${SIDEBAR_TEXT_CONTAINER_XP}/h1
Expand Down
19 changes: 0 additions & 19 deletions ~/.kube/config

This file was deleted.

0 comments on commit 561e7cb

Please sign in to comment.