From c42b3c89fa4c22318ae1bf4e3d55fc57c71fc521 Mon Sep 17 00:00:00 2001 From: Luca Giorgi Date: Tue, 30 Jan 2024 14:11:20 +0100 Subject: [PATCH] Fix multiple Sanity failures in 2.6 (#1158) * Fix various Sanity failures Signed-off-by: Luca Giorgi * Fixes Signed-off-by: Luca Giorgi * Add log level Signed-off-by: Luca Giorgi * fix productbug for custom-image, log level for git test Signed-off-by: Luca Giorgi * remove log level Signed-off-by: Luca Giorgi * add warn log for productbug in custom image test Signed-off-by: Luca Giorgi * Fix git test Signed-off-by: Luca Giorgi * update button for editing custom images Signed-off-by: Luca Giorgi * fix line length Signed-off-by: Luca Giorgi --------- Signed-off-by: Luca Giorgi --- .../ODH/JupyterHub/JupyterHubSpawner.robot | 15 ++++++++------- .../Page/ODH/ODHDashboard/ODHDashboard.robot | 4 ++-- .../Tests/500__jupyterhub/custom-image.robot | 8 +++++--- .../500__jupyterhub/test-jupyterlab-git.robot | 19 +++++++++++++------ 4 files changed, 28 insertions(+), 18 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..5c823a64a 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} = 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 + ... ${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..7b240ca57 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -625,14 +625,14 @@ 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 [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 diff --git a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot index 187b600fe..6b7d0a780 100644 --- a/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot +++ b/ods_ci/tests/Tests/500__jupyterhub/custom-image.robot @@ -62,17 +62,19 @@ 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} - Wait Until Page Contains Unable to add notebook image: ${IMG_NAME} + # 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 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..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,11 +41,14 @@ 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] ${commit_message}= Catenate ${COMMIT_MSG} ${randnum} Push Some Changes to Repo @@ -119,10 +122,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