From fbe72316a3faa1ca70c66001b6ec4a76ec17d8d7 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Thu, 25 Jan 2024 17:02:22 +0100 Subject: [PATCH 1/9] Fix various Sanity failures Signed-off-by: Luca Giorgi --- .../Page/ODH/JupyterHub/JupyterHubSpawner.robot | 15 ++++++++------- .../Page/ODH/ODHDashboard/ODHDashboard.robot | 2 +- .../500__jupyterhub/test-jupyterlab-git.robot | 12 ++++++++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot b/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot index fe3740bea..a8a70c501 100644 --- a/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot +++ b/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot @@ -143,13 +143,14 @@ Add Spawner Environment Variable [Documentation] Adds a new environment variables based on the ${env_var} ${env_var_value} arguments [Arguments] ${env_var} ${env_var_value} Click Button Add more variables - #Input Text xpath://input[@id="---NO KEY---"] ${env_var} - Input Text xpath://input[contains(@id,"-NO KEY-")][1] ${env_var} - Element Attribute Value Should Be xpath:${KFNBC_ENV_VAR_NAME_PRE}//input[contains(@id,"-${env_var}")] value ${env_var} - #Input Text xpath://input[@id="${env_var}-value"] ${env_var_value} - Input Text xpath://input[contains(@id, "-${env_var}-value")] ${env_var_value} - #Element Attribute Value Should Be xpath://input[@id="${env_var}-value"] value ${env_var_value} - Element Attribute Value Should Be xpath://input[contains(@id, "-${env_var}-value")] value ${env_var_value} + ${elements} = Get Element Count ${KFNBC_ENV_VAR_NAME_PRE} + ${rows} = Set Variable ${elements}-${1} + Input Text xpath://input[contains(@id,"-NO KEY-")][1] ${env_var} + Element Attribute Value Should Be + ... xpath:${KFNBC_ENV_VAR_NAME_PRE}//input[contains(@id,"environment-variable-row-${rows}-0-${env_var}")] value + ... ${env_var} + Input Text xpath://input[contains(@id, "-${env_var}-value")] ${env_var_value} + Element Attribute Value Should Be xpath://input[contains(@id, "-${env_var}-value")] value ${env_var_value} Remove All Spawner Environment Variables [Documentation] Removes all existing environment variables in the Spawner diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index ab94b45c0..9288c0c88 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -625,7 +625,7 @@ Delete Custom Image [Arguments] ${image_name} Click Button xpath://td[@data-label="Name"]/div/div/div[.="${image_name} "]/../../../../td[last()]//button ${image_name_id} = Replace String ${image_name} ${SPACE} - - Click Element xpath://td[@data-label="Name"]/div/div/div[.="${image_name} "]/../../../../td[last()]//button/..//li[@id="custom-${image_name_id}-delete-button"] # robocop: disable + Click Element xpath://td[@data-label="Name"]/div/div/div[.="${image_name} "]/../../../../td[last()]//button/..//button[@id="custom-${image_name_id}-delete-button"] # robocop: disable Handle Deletion Confirmation Modal ${image_name} notebook image Open Edit Menu For Custom Image diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index abf06f33f..c09bcf602 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -119,10 +119,14 @@ Commit Changes Set Staging Status ON END Click Button xpath=//div[contains(@class, "CommitBox")]//button[.="Commit"] - Wait Until Page Contains Who is committing? timeout=10s - Input Text xpath=//input[@placeholder="Name"] ${name} - Input Text xpath=//input[@placeholder="Email"] ${email_id} - Click Element xpath=//button[.="OK"] + ${identity} = Run Keyword And Return Status Wait Until Page Contains Who is committing? timeout=10s + IF ${identity} + Input Text xpath=//input[@placeholder="Name"] ${name} + Input Text xpath=//input[@placeholder="Email"] ${email_id} + Click Element xpath=//button[.="OK"] + ELSE + Page Should Contain Element xpath=//button[@title="Disabled: No files are staged for commit"] + END Push Changes To Remote [Documentation] Push changes to remote directory From 228428f8c0a15d2d2308ae12184f33a366ea7551 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Fri, 26 Jan 2024 14:43:08 +0100 Subject: [PATCH 2/9] Fixes Signed-off-by: Luca Giorgi --- .../tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot | 2 +- ods_ci/tests/Tests/500__jupyterhub/custom-image.robot | 2 +- ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot b/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot index a8a70c501..5c823a64a 100644 --- a/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot +++ b/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot @@ -144,7 +144,7 @@ Add Spawner Environment Variable [Arguments] ${env_var} ${env_var_value} Click Button Add more variables ${elements} = Get Element Count ${KFNBC_ENV_VAR_NAME_PRE} - ${rows} = Set Variable ${elements}-${1} + ${rows} = Evaluate $elements-${1} Input Text xpath://input[contains(@id,"-NO KEY-")][1] ${env_var} Element Attribute Value Should Be ... xpath:${KFNBC_ENV_VAR_NAME_PRE}//input[contains(@id,"environment-variable-row-${rows}-0-${env_var}")] value diff --git a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot index 187b600fe..ec74db6c7 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot @@ -72,7 +72,7 @@ Test Duplicate Image Import New Custom Image ${IMG_URL} ${IMG_NAME} ${IMG_DESCRIPTION} ... software=${IMG_SOFTWARE} ... packages=${IMG_PACKAGES} - Wait Until Page Contains Unable to add notebook image: ${IMG_NAME} + Wait Until Page Contains Unable to add notebook image: HTTP request failed # Since the image cannot be created, we need to cancel the modal window now Click Button ${GENERIC_CANCEL_BTN_XP} [Teardown] Duplicate Image Teardown diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index c09bcf602..53e3b5fd3 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -37,6 +37,7 @@ Verify Updating Project With Changes From Git Repository [Documentation] Verifies that changes has been pulled successfully to local repository [Tags] ODS-324 ... Sanity Tier1 + Set Log Level TRACE Set Staging Status Clone Git Repository And Open ${REPO_URL} ${FILE_PATH} Sleep 1s @@ -61,6 +62,7 @@ Verify Updating Project With Changes From Git Repository Open New Notebook ${commit_msg2}= Get Last Commit Message Should Not Be Equal ${commit_msg2} ${commit_msg1} + Set Log Level NONE *** Keywords *** From c00e318e890b64e1c75d608981041439d8aaa638 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Fri, 26 Jan 2024 16:37:02 +0100 Subject: [PATCH 3/9] Add log level Signed-off-by: Luca Giorgi --- ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index 53e3b5fd3..08f7a612c 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -37,7 +37,6 @@ Verify Updating Project With Changes From Git Repository [Documentation] Verifies that changes has been pulled successfully to local repository [Tags] ODS-324 ... Sanity Tier1 - Set Log Level TRACE Set Staging Status Clone Git Repository And Open ${REPO_URL} ${FILE_PATH} Sleep 1s @@ -46,7 +45,6 @@ Verify Updating Project With Changes From Git Repository Add And Run JupyterLab Code Cell In Active Notebook ! mkdir ../folder/ Sleep 2s Open Folder or File folder - ${randnum}= Generate Random String 9 [NUMBERS] ${commit_message}= Catenate ${COMMIT_MSG} ${randnum} Push Some Changes to Repo @@ -62,7 +60,6 @@ Verify Updating Project With Changes From Git Repository Open New Notebook ${commit_msg2}= Get Last Commit Message Should Not Be Equal ${commit_msg2} ${commit_msg1} - Set Log Level NONE *** Keywords *** @@ -83,7 +80,9 @@ Push Some Changes To Repo Open With JupyterLab Menu Edit Delete Cells Enter Text In File And Save code=print("Hi Hello ${commitmsgg}") Set Staging Status status=ON + Set Log Level TRACE Commit Changes commit_message=${commitmsgg} name=${GITHUB_USER.USERNAME} email_id=${GITHUB_USER.EMAIL} + Set Log Level NONE Push Changes To Remote github_username=${GITHUB_USER.USERNAME} token=${GITHUB_USER.TOKEN} Set Staging Status status=OFF Close All JupyterLab Tabs From 00aa2f8949154ec2cdec4b725cf595a4a667bfe1 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Fri, 26 Jan 2024 16:56:19 +0100 Subject: [PATCH 4/9] fix productbug for custom-image, log level for git test Signed-off-by: Luca Giorgi --- ods_ci/tests/Tests/500__jupyterhub/custom-image.robot | 5 +++-- ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot index ec74db6c7..919635e96 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot @@ -62,16 +62,17 @@ Verify Custom Image Can Be Added Test Duplicate Image [Documentation] Test adding two images with the same name (should fail) - ... ProductBug - https://github.com/opendatahub-io/odh-dashboard/issues/2186 + ... ProductBug - https://issues.redhat.com/browse/RHOAIENG-1192 [Tags] Sanity Tier1 ExcludeOnDisconnected ... ODS-1368 - ... ProductBug Sleep 1 Create Custom Image Sleep 1 Import New Custom Image ${IMG_URL} ${IMG_NAME} ${IMG_DESCRIPTION} ... software=${IMG_SOFTWARE} ... packages=${IMG_PACKAGES} + # Workaround for https://issues.redhat.com/browse/RHOAIENG-1192 + # To be removed ASAP Wait Until Page Contains Unable to add notebook image: HTTP request failed # Since the image cannot be created, we need to cancel the modal window now Click Button ${GENERIC_CANCEL_BTN_XP} diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index 08f7a612c..43d08f42d 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -80,9 +80,7 @@ Push Some Changes To Repo Open With JupyterLab Menu Edit Delete Cells Enter Text In File And Save code=print("Hi Hello ${commitmsgg}") Set Staging Status status=ON - Set Log Level TRACE Commit Changes commit_message=${commitmsgg} name=${GITHUB_USER.USERNAME} email_id=${GITHUB_USER.EMAIL} - Set Log Level NONE Push Changes To Remote github_username=${GITHUB_USER.USERNAME} token=${GITHUB_USER.TOKEN} Set Staging Status status=OFF Close All JupyterLab Tabs @@ -111,6 +109,7 @@ Clone Git Repository In Current Folder Commit Changes [Documentation] It does the git commit with commit message [Arguments] ${commit_message} ${name} ${email_id} + Set Log Level TRACE Click Element xpath=//li[@title="Git"] Input Text xpath=//*[@id="jp-git-sessions"]//input[contains(@placeholder, "Summary")] ${commit_message} Sleep 2s @@ -128,6 +127,7 @@ Commit Changes ELSE Page Should Contain Element xpath=//button[@title="Disabled: No files are staged for commit"] END + Set Log Level NONE Push Changes To Remote [Documentation] Push changes to remote directory From 58eb89d4f249c78688fbea424965f424262f83e6 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Fri, 26 Jan 2024 17:50:03 +0100 Subject: [PATCH 5/9] remove log level Signed-off-by: Luca Giorgi --- ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot | 2 -- 1 file changed, 2 deletions(-) diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index 43d08f42d..e2f14190b 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -109,7 +109,6 @@ Clone Git Repository In Current Folder Commit Changes [Documentation] It does the git commit with commit message [Arguments] ${commit_message} ${name} ${email_id} - Set Log Level TRACE Click Element xpath=//li[@title="Git"] Input Text xpath=//*[@id="jp-git-sessions"]//input[contains(@placeholder, "Summary")] ${commit_message} Sleep 2s @@ -127,7 +126,6 @@ Commit Changes ELSE Page Should Contain Element xpath=//button[@title="Disabled: No files are staged for commit"] END - Set Log Level NONE Push Changes To Remote [Documentation] Push changes to remote directory From 898cdbf0069a408334ce6153fe980a80e96998bd Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Fri, 26 Jan 2024 17:52:52 +0100 Subject: [PATCH 6/9] add warn log for productbug in custom image test Signed-off-by: Luca Giorgi --- ods_ci/tests/Tests/500__jupyterhub/custom-image.robot | 1 + 1 file changed, 1 insertion(+) diff --git a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot index 919635e96..6b7d0a780 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot @@ -74,6 +74,7 @@ Test Duplicate Image # Workaround for https://issues.redhat.com/browse/RHOAIENG-1192 # To be removed ASAP Wait Until Page Contains Unable to add notebook image: HTTP request failed + Log Unable to add second image with error message "Unable to add notebook image: HTTP request failed" due to RHOAIENG-1192 level=WARN # robocop: disable # Since the image cannot be created, we need to cancel the modal window now Click Button ${GENERIC_CANCEL_BTN_XP} [Teardown] Duplicate Image Teardown From 10f2eccef8d00ef5cefa77bdd4f3ec7348a2eab0 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Tue, 30 Jan 2024 13:04:44 +0100 Subject: [PATCH 7/9] Fix git test Signed-off-by: Luca Giorgi --- ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index e2f14190b..5327953cd 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -41,8 +41,11 @@ Verify Updating Project With Changes From Git Repository Clone Git Repository And Open ${REPO_URL} ${FILE_PATH} Sleep 1s Open New Notebook + Add And Run JupyterLab Code Cell In Active Notebook import os;path="/opt/app-root/src/ODS-QE-Github-Test";os.chdir(path) ${commit_msg1}= Get Last Commit Message - Add And Run JupyterLab Code Cell In Active Notebook ! mkdir ../folder/ + Add And Run JupyterLab Code Cell In Active Notebook !mkdir ../folder/ + Add And Run JupyterLab Code Cell In Active Notebook !git config --global user.name "${GITHUB_USER.USERNAME}" + Add And Run JupyterLab Code Cell In Active Notebook !git config --global user.email ${GITHUB_USER.EMAIL} Sleep 2s Open Folder or File folder ${randnum}= Generate Random String 9 [NUMBERS] From cfe166c39ffc0b50637e99f0558998fb230443b8 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Tue, 30 Jan 2024 13:45:10 +0100 Subject: [PATCH 8/9] update button for editing custom images Signed-off-by: Luca Giorgi --- ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index 9288c0c88..7b240ca57 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -632,7 +632,7 @@ Open Edit Menu For Custom Image [Documentation] Opens the edit view for a specific custom image [Arguments] ${image_name} Click Button xpath://td[.="${image_name}"]/../td[last()]//button - Click Element xpath://td[.="${image_name}"]/../td[last()]//button/..//li[@id="${image_name}-edit-button"] + Click Element xpath://td[.="${image_name}"]/../td[last()]//button/..//button[@id="${image_name}-edit-button"] Wait Until Page Contains Delete Notebook Image Expand Custom Image Details From eb3530c164b538c691a542a0d90180098aeea3eb Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Tue, 30 Jan 2024 13:57:24 +0100 Subject: [PATCH 9/9] fix line length Signed-off-by: Luca Giorgi --- ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot index 5327953cd..2ef53adec 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/test-jupyterlab-git.robot @@ -41,7 +41,8 @@ Verify Updating Project With Changes From Git Repository Clone Git Repository And Open ${REPO_URL} ${FILE_PATH} Sleep 1s Open New Notebook - Add And Run JupyterLab Code Cell In Active Notebook import os;path="/opt/app-root/src/ODS-QE-Github-Test";os.chdir(path) + Add And Run JupyterLab Code Cell In Active Notebook + ... import os;path="/opt/app-root/src/ODS-QE-Github-Test";os.chdir(path) ${commit_msg1}= Get Last Commit Message Add And Run JupyterLab Code Cell In Active Notebook !mkdir ../folder/ Add And Run JupyterLab Code Cell In Active Notebook !git config --global user.name "${GITHUB_USER.USERNAME}"