From 2c0a14eccb9fb62c3b8bcd5c4f4545cdde0fa68c Mon Sep 17 00:00:00 2001 From: asanzgom Date: Thu, 11 Jan 2024 13:41:39 +0100 Subject: [PATCH 1/4] added Test Verify user can create a workbench using Intel AiKit image --- .../ODHDataScienceProject/Projects.resource | 2 +- .../Workbenches.resource | 16 +++-- ...s_dashboard_projects_notebook_images.robot | 61 +++++++++++++++++++ 3 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 90f5c8db5..011809d6f 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -167,7 +167,7 @@ Delete Data Science Project From CLI ${project_k8s_name}= Run oc get projects -o json | jq '.items[] | select((.metadata.annotations."openshift.io/display-name" != null) and (.metadata.labels."opendatahub.io/dashboard"=="true") and (.metadata.annotations."openshift.io/display-name"=="${displayed_name}")) | .metadata.name' # robocop: disable ${project_k8s_name}= Replace String ${project_k8s_name} " ${EMPTY} IF "${project_k8s_name}" == "${EMPTY}" - Log msg=There is probably no DS Projects with Diplay Name equal to ${displayed_name} + Log msg=There are probably no DS Projects with Display Name equal to ${displayed_name} ... level=WARN ELSE Oc Delete kind=Project name=${project_k8s_name} diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 05ea69a73..a30838543 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -173,16 +173,20 @@ Select An Existent PV Select Workbench Jupyter Image [Documentation] Selects a Jupyter image in the workbench creation page [Arguments] ${image_name} ${version}=default + Click Element //a[@href="#notebook-image"] Wait Until Page Contains Element ${WORKBENCH_IMAGE_MENU_BTN_XP} Click Button ${WORKBENCH_IMAGE_MENU_BTN_XP} Wait Until Page Contains Element ${WORKBENCH_IMAGE_ITEM_BTN_XP}\[text()="${image_name}"] timeout=10s Click Element ${WORKBENCH_IMAGE_ITEM_BTN_XP}\[text()="${image_name}"] - IF "${version}"=="default" - Verify Version Selection Dropdown - ELSE IF "${version}"=="previous" - Select Workbench Image Version ${version} - ELSE - Fail ${version} does not exist, use default/previous + + IF "${version}" != "${NONE}" + IF "${version}"=="default" + Verify Version Selection Dropdown + ELSE IF "${version}"=="previous" + Select Workbench Image Version ${version} + ELSE + Fail ${version} does not exist, use default/previous + END END Verify Version Selection Dropdown diff --git a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot new file mode 100644 index 000000000..de62cbfc6 --- /dev/null +++ b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot @@ -0,0 +1,61 @@ +*** Settings *** +Documentation Suite to test the spawn of different notebook images +Library SeleniumLibrary +Library OpenShiftLibrary +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +Resource ../../../Resources/RHOSi.resource +Suite Setup Project Suite Setup +Suite Teardown Project Suite Teardown + +*** Variables *** +${PRJ_TITLE}= ODS-CI DS Project Notebook Images +${PRJ_RESOURCE_NAME}= notebook-images-ds-project +${PRJ_DESCRIPTION}= ${PRJ_TITLE} is a test project for validating notebook images and shared by multiple tests +${intel_aikit_appname} aikit +${intel_aikit_container_name} Intel® oneAPI AI Analytics Toolkit Container +${intel_aikit_operator_name} Intel® oneAPI AI Analytics Toolkit Operator +${image_name} oneAPI AI Analytics Toolkit +${workbench_title} aikitwb +${pv_description} PV for AiKit workbench + +*** Test Cases *** +Verify user can create a workbench using Intel AiKit image + [Documentation] Verifies that a workbench can be created using Intel AiKit image + [Tags] ODS-2173 Tier2 + Check And Install Operator in Openshift ${intel_aikit_operator_name} ${intel_aikit_appname} + Create Tabname Instance For Installed Operator ${intel_aikit_operator_name} AIKitContainer ${APPLICATIONS_NAMESPACE} + Go To RHODS Dashboard + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workbench workbench_title=${workbench_title} workbench_description=workbench for testing + ... prj_title=${PRJ_TITLE} image_name=${image_name} version=${NONE} deployment_size=Small + ... storage=Persistent pv_name=aikitpv pv_existent=${FALSE} + ... pv_description=${pv_description} pv_size=1 + ... press_cancel=${FALSE} envs=${NONE} + Wait Until Workbench Is Started workbench_title=${workbench_title} + Open Data Science Projects Home Page + Wait Until Project Is Listed project_title=${PRJ_TITLE} + Launch And Access Workbench From Projects Home Page workbench_title=${workbench_title} + ... project_title=${PRJ_TITLE} username=${TEST_USER_3.USERNAME} + ... password=${TEST_USER_3.PASSWORD} auth_type=${TEST_USER_3.AUTH_TYPE} + + +*** Keywords *** +Project Suite Setup + [Documentation] Suite setup steps for testing DS Projects. It creates some test variables + ... and runs RHOSi setup + Set Library Search Order SeleniumLibrary + ${to_delete}= Create List ${PRJ_TITLE} + Set Suite Variable ${PROJECTS_TO_DELETE} ${to_delete} + RHOSi Setup + Launch Data Science Project Main Page + Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} + ... resource_name=${PRJ_RESOURCE_NAME} + +Project Suite Teardown + [Documentation] Suite teardown steps after testing DS Projects. It Deletes + ... all the DS projects created by the tests and run RHOSi teardown + Close All Browsers + # Delete All Data Science Projects From CLI + Delete Data Science Projects From CLI ocp_projects=${PROJECTS_TO_DELETE} + RHOSi Teardown From 25a94c68cbafe4a3f037daa989699b10c859c418 Mon Sep 17 00:00:00 2001 From: asanzgom Date: Thu, 11 Jan 2024 14:56:25 +0100 Subject: [PATCH 2/4] fixed robocop warnings --- ...s_dashboard_projects_notebook_images.robot | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot index de62cbfc6..eda49046e 100644 --- a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot +++ b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot @@ -8,34 +8,36 @@ Resource ../../../Resources/RHOSi.resource Suite Setup Project Suite Setup Suite Teardown Project Suite Teardown + *** Variables *** -${PRJ_TITLE}= ODS-CI DS Project Notebook Images -${PRJ_RESOURCE_NAME}= notebook-images-ds-project -${PRJ_DESCRIPTION}= ${PRJ_TITLE} is a test project for validating notebook images and shared by multiple tests -${intel_aikit_appname} aikit -${intel_aikit_container_name} Intel® oneAPI AI Analytics Toolkit Container -${intel_aikit_operator_name} Intel® oneAPI AI Analytics Toolkit Operator -${image_name} oneAPI AI Analytics Toolkit -${workbench_title} aikitwb -${pv_description} PV for AiKit workbench +${PRJ_TITLE} ODS-CI DS Project Notebook Images +${PRJ_RESOURCE_NAME} notebook-images-ds-project +${PRJ_DESCRIPTION} ${PRJ_TITLE} is a test project for validating notebook images and shared by multiple tests +${INTEL_AIKIT_APPNAME} aikit +${INTEL_AIKIT_OPERATOR_NAME} Intel® oneAPI AI Analytics Toolkit Operator +${IMG_NAME} oneAPI AI Analytics Toolkit +${WORKBENCH_TITLE} aikitwb +${PV_DESCRIPTION} PV for AiKit workbench + *** Test Cases *** Verify user can create a workbench using Intel AiKit image [Documentation] Verifies that a workbench can be created using Intel AiKit image [Tags] ODS-2173 Tier2 - Check And Install Operator in Openshift ${intel_aikit_operator_name} ${intel_aikit_appname} - Create Tabname Instance For Installed Operator ${intel_aikit_operator_name} AIKitContainer ${APPLICATIONS_NAMESPACE} + Check And Install Operator in Openshift ${INTEL_AIKIT_OPERATOR_NAME} ${INTEL_AIKIT_APPNAME} + Create Tabname Instance For Installed Operator ${INTEL_AIKIT_OPERATOR_NAME} + ... AIKitContainer ${APPLICATIONS_NAMESPACE} Go To RHODS Dashboard Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workbench workbench_title=${workbench_title} workbench_description=workbench for testing - ... prj_title=${PRJ_TITLE} image_name=${image_name} version=${NONE} deployment_size=Small + Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=workbench for testing + ... prj_title=${PRJ_TITLE} image_name=${IMG_NAME} version=${NONE} deployment_size=Small ... storage=Persistent pv_name=aikitpv pv_existent=${FALSE} - ... pv_description=${pv_description} pv_size=1 + ... pv_description=${PV_DESCRIPTION} pv_size=1 ... press_cancel=${FALSE} envs=${NONE} - Wait Until Workbench Is Started workbench_title=${workbench_title} + Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE} Open Data Science Projects Home Page Wait Until Project Is Listed project_title=${PRJ_TITLE} - Launch And Access Workbench From Projects Home Page workbench_title=${workbench_title} + Launch And Access Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} ... project_title=${PRJ_TITLE} username=${TEST_USER_3.USERNAME} ... password=${TEST_USER_3.PASSWORD} auth_type=${TEST_USER_3.AUTH_TYPE} From 9864a0cf189c8f3c2d08eac9c333a0e4d12fd173 Mon Sep 17 00:00:00 2001 From: asanzgom Date: Thu, 11 Jan 2024 16:21:24 +0100 Subject: [PATCH 3/4] changed scope of variables to Test Case --- ...15__ods_dashboard_projects_notebook_images.robot | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot index eda49046e..e4f2fae79 100644 --- a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot +++ b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot @@ -13,17 +13,17 @@ Suite Teardown Project Suite Teardown ${PRJ_TITLE} ODS-CI DS Project Notebook Images ${PRJ_RESOURCE_NAME} notebook-images-ds-project ${PRJ_DESCRIPTION} ${PRJ_TITLE} is a test project for validating notebook images and shared by multiple tests -${INTEL_AIKIT_APPNAME} aikit -${INTEL_AIKIT_OPERATOR_NAME} Intel® oneAPI AI Analytics Toolkit Operator -${IMG_NAME} oneAPI AI Analytics Toolkit -${WORKBENCH_TITLE} aikitwb -${PV_DESCRIPTION} PV for AiKit workbench *** Test Cases *** Verify user can create a workbench using Intel AiKit image [Documentation] Verifies that a workbench can be created using Intel AiKit image [Tags] ODS-2173 Tier2 + Set Test Variable ${INTEL_AIKIT_APPNAME} aikit + Set Test Variable ${INTEL_AIKIT_OPERATOR_NAME} Intel® oneAPI AI Analytics Toolkit Operator + Set Test Variable ${IMG_NAME} oneAPI AI Analytics Toolkit + Set Test Variable ${WORKBENCH_TITLE} aikitwb + Set Test Variable ${PV_DESCRIPTION} PV for AiKit workbench Check And Install Operator in Openshift ${INTEL_AIKIT_OPERATOR_NAME} ${INTEL_AIKIT_APPNAME} Create Tabname Instance For Installed Operator ${INTEL_AIKIT_OPERATOR_NAME} ... AIKitContainer ${APPLICATIONS_NAMESPACE} @@ -47,7 +47,7 @@ Project Suite Setup [Documentation] Suite setup steps for testing DS Projects. It creates some test variables ... and runs RHOSi setup Set Library Search Order SeleniumLibrary - ${to_delete}= Create List ${PRJ_TITLE} + ${to_delete} Create List ${PRJ_TITLE} Set Suite Variable ${PROJECTS_TO_DELETE} ${to_delete} RHOSi Setup Launch Data Science Project Main Page @@ -58,6 +58,5 @@ Project Suite Teardown [Documentation] Suite teardown steps after testing DS Projects. It Deletes ... all the DS projects created by the tests and run RHOSi teardown Close All Browsers - # Delete All Data Science Projects From CLI Delete Data Science Projects From CLI ocp_projects=${PROJECTS_TO_DELETE} RHOSi Teardown From c98f69108476d1eb71f1213141d44f22e9106b54 Mon Sep 17 00:00:00 2001 From: asanzgom Date: Thu, 11 Jan 2024 17:05:45 +0100 Subject: [PATCH 4/4] changed test case title to uppercase --- .../415__ods_dashboard_projects_notebook_images.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot index e4f2fae79..42f7f4f83 100644 --- a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot +++ b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot @@ -16,7 +16,7 @@ ${PRJ_DESCRIPTION} ${PRJ_TITLE} is a test project for validating notebook ima *** Test Cases *** -Verify user can create a workbench using Intel AiKit image +Verify User Can Create A Workbench Using Intel AiKit Image [Documentation] Verifies that a workbench can be created using Intel AiKit image [Tags] ODS-2173 Tier2 Set Test Variable ${INTEL_AIKIT_APPNAME} aikit