From 19e4665f3f1de5b89fcec51c18ab999dec296324 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 29 Sep 2022 13:10:35 +0200 Subject: [PATCH 01/70] first files for DSG testing Signed-off-by: bdattoma --- .../ODH/ODHDashboard/ODHDashboardProjects.resource | 13 +++++++++++++ .../415__ods_dashboard_projects.robot | 0 2 files changed, 13 insertions(+) create mode 100644 tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource create mode 100644 tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource new file mode 100644 index 000000000..dc0c70ab4 --- /dev/null +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource @@ -0,0 +1,13 @@ +*** Settings *** +Resource ../../../Page/Components/Components.resource +Resource ../../../Common.robot + +*** Variables *** +${DS_PROJECT_XP}= //h1[text()="Data science projects"] +*** Keywords *** +Verify Data Science Projects Page Is Available + [Documentation] Verifies submenu Settings > Cluster settings" is visible + Page Should Contain Settings + Menu.Navigate To Page Settings Data Science Projects + Wait Until Page Contains View your existing projects or create new projects. timeout=30 + Wait Until Page Contains Element ${DS_PROJECT_XP} timeout=30 diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot new file mode 100644 index 000000000..e69de29bb From 958a49235b4515b355cab8ae2cb1b9dda2eec50c Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 30 Sep 2022 18:09:52 +0200 Subject: [PATCH 02/70] add first 2 tests for project creation --- tests/Resources/Common.robot | 28 ++++++++ .../ODHDashboardProjects.resource | 72 ++++++++++++++++++- .../415__ods_dashboard_projects.robot | 42 +++++++++++ 3 files changed, 139 insertions(+), 3 deletions(-) diff --git a/tests/Resources/Common.robot b/tests/Resources/Common.robot index aa95c5dcd..47e808749 100644 --- a/tests/Resources/Common.robot +++ b/tests/Resources/Common.robot @@ -189,3 +189,31 @@ Get OAuth Cookie ... It assumes Dashboard UI has been launched and login performed using UI. ${cookie}= Get Cookie _oauth_proxy [Return] ${cookie.value} + +Is Generic Modal Displayed + [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s + IF ${partial_match} == ${TRUE} + ${is_displayed}= Run Keyword And Return Status + ... Page Should Contain Element xpath=//*[contains(id,"${id}")] timeout=${timeout} + ELSE + ${is_displayed}= Run Keyword And Return Status + ... Page Should Contain Element xpath=//*[@id="${id}")] timeout=${timeout} + END + [Return] ${is_displayed} + +Wait Until Modal Disappear + [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s + IF ${partial_match} == ${TRUE} + Wait Until Page Contains Element xpath=//*[contains(id,"${id}")] timeout=${timeout} + Wait Until Page Does Not Contain Element xpath=//*[contains(id,"${id}")] timeout=${timeout} + ELSE + Wait Until Page Contains Element xpath=//*[@id="${id}")] timeout=${timeout} + Wait Until Page Does Not Contain Element xpath=//*[@id="${id}")] timeout=${timeout} + END + +Close Generic Modal If Present + ${is_modal}= Is Generic Modal Displayed + IF ${is_modal} == ${TRUE} + Click Element xpath=//button[@aria-label="Close"] + Wait Until Modal Disappear + END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource index dc0c70ab4..3c6516037 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource @@ -2,12 +2,78 @@ Resource ../../../Page/Components/Components.resource Resource ../../../Common.robot + *** Variables *** ${DS_PROJECT_XP}= //h1[text()="Data science projects"] +${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] +${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] +${CREATE_BTN_XP}= xpath=//button[text()="Create"] +${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"] +${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"] +${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"] + + *** Keywords *** -Verify Data Science Projects Page Is Available +Open Data Science Projects Page [Documentation] Verifies submenu Settings > Cluster settings" is visible - Page Should Contain Settings - Menu.Navigate To Page Settings Data Science Projects + Page Should Contain Data Science Projects + Click Link Data Science Projects 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 xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + +Is Data Science Projects Page Open + Close Generic Modal If Present + ${page_open}= Run Keyword And Return Status Page Should Contain ${DS_PROJECT_XP} + [Return] ${page_open} + +Open Data Science Project + [Documentation] Verifies submenu Settings > Cluster settings" is visible + [Arguments] ${project_title} + Click Link ${project_title} + +Delete Data Science Project + [Arguments] ${project_title} + ${is_open}= Is Data Science Projects Page Open + IF ${is_open} == ${FALSE} + Open Data Science Projects Page + END + Project Should Be Listed project_title=${project_title} + Open Actions Menu Of Project project_title=${project_title} + Click Delete From Action Menu project_title=${project_title} + +Open Actions Menu Of Project + [Arguments] ${project_title} + Project Should Be Listed project_title=${project_title} + Click Element ${ACTIONS_BTN_XP} + +Click Delete From Action Menu + [Arguments] ${project_title} + Wait Until Page Contains Element ${DELETE_ACTION_BTN_XP} + Click Element ${DELETE_ACTION_BTN_XP} + +Wait Until Project Is Open + [Arguments] ${project_title} + Wait Until Page Contains Element xpath=//h1[text()=${project_title}] timeout=30 + +Project Should Be Listed + [Arguments] ${project_title} + Page Should Contain Element xpath=//td/a[text()=${project_title}] + +Project's Owner Should Be + [Arguments] ${project_title} ${expected_username} + Page Should Contain Element xpath=//td[a[text()=${project_title}]]/small[text()=${expected_username}] + +Create Data Science Project + [Arguments] ${title} ${description} + Click Button Create data science project + Wait Until Page Contains Element ${TITLE_INPUT_XP} + Run Keyword And Warn On Failure Element Should Be Disabled ${CREATE_BTN_XP} + Input Text ${TITLE_INPUT_XP} ${title} + Input Text ${DESCR_INPUT_XP} ${description} + Wait Until Element Is Enabled ${CREATE_BTN_XP} + Click Button ${CREATE_BTN_XP} + Wait Until Modal Disappear + + diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot index e69de29bb..c3b6441b9 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot @@ -0,0 +1,42 @@ +*** Settings *** +Library SeleniumLibrary +Resource ../../Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +Suite Setup Project Suite Setup +Suite Teardown Project Suite Teardown + + +*** Variables *** +${PRJ_TITLE}= ODS-CI DS Project +${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature + + +*** Test Cases *** +Verify User Cannot Create Project Without Title + [Tags] ODS-XYZ + Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + Open Data Science Projects Page + Create Project With Empty Title And Expect Error + +Verify User Can Create A Data Science Project + [Tags] ODS-XYZ + Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + Open Data Science Projects Page + Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} + Wait Until Project Is Open project_title=${PRJ_TITLE} + Open Data Science Projects Page + Project Should Be Listed project_title=${PRJ_TITLE} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} + [Teardown] Delete Data Science Project project_title=${PRJ_TITLE} + + +*** Keywords *** +Project Suite Setup + Set Library Search Order SeleniumLibrary + # RHOSi Setup + +Project Suite Teardown + Close All Browsers + +Create Project With Empty Title And Expect Error + ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ + Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} From 77aa3a9cf14371c3703135850e0211b0b0a41e8a Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 30 Sep 2022 18:22:26 +0200 Subject: [PATCH 03/70] fix generic modal handling --- tests/Resources/Common.robot | 13 ++++++++----- .../ODH/ODHDashboard/ODHDashboardProjects.resource | 9 ++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/Resources/Common.robot b/tests/Resources/Common.robot index 47e808749..da56feccf 100644 --- a/tests/Resources/Common.robot +++ b/tests/Resources/Common.robot @@ -203,12 +203,15 @@ Is Generic Modal Displayed Wait Until Modal Disappear [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s - IF ${partial_match} == ${TRUE} - Wait Until Page Contains Element xpath=//*[contains(id,"${id}")] timeout=${timeout} - Wait Until Page Does Not Contain Element xpath=//*[contains(id,"${id}")] timeout=${timeout} + ${is_modal}= Is Generic Modal Displayed + IF ${is_modal} == ${TRUE} + IF ${partial_match} == ${TRUE} + Wait Until Page Does Not Contain Element xpath=//*[contains(id,"${id}")] timeout=${timeout} + ELSE + Wait Until Page Does Not Contain Element xpath=//*[@id="${id}")] timeout=${timeout} + END ELSE - Wait Until Page Contains Element xpath=//*[@id="${id}")] timeout=${timeout} - Wait Until Page Does Not Contain Element xpath=//*[@id="${id}")] timeout=${timeout} + Log No Modals on the screen right now.. level=WARN END Close Generic Modal If Present diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource index 3c6516037..6ace5df13 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource @@ -42,6 +42,7 @@ Delete Data Science Project Project Should Be Listed project_title=${project_title} Open Actions Menu Of Project project_title=${project_title} Click Delete From Action Menu project_title=${project_title} + # check NS deleted Open Actions Menu Of Project [Arguments] ${project_title} @@ -52,18 +53,19 @@ Click Delete From Action Menu [Arguments] ${project_title} Wait Until Page Contains Element ${DELETE_ACTION_BTN_XP} Click Element ${DELETE_ACTION_BTN_XP} + # Add confirmation click Wait Until Project Is Open [Arguments] ${project_title} - Wait Until Page Contains Element xpath=//h1[text()=${project_title}] timeout=30 + Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_title}")] timeout=30 Project Should Be Listed [Arguments] ${project_title} - Page Should Contain Element xpath=//td/a[text()=${project_title}] + Page Should Contain Element xpath=//td/a[text()="${project_title}"] Project's Owner Should Be [Arguments] ${project_title} ${expected_username} - Page Should Contain Element xpath=//td[a[text()=${project_title}]]/small[text()=${expected_username}] + Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project [Arguments] ${title} ${description} @@ -75,5 +77,6 @@ Create Data Science Project Wait Until Element Is Enabled ${CREATE_BTN_XP} Click Button ${CREATE_BTN_XP} Wait Until Modal Disappear + # check NS created From ed684deec06d2f3acdb9e20ac61c4391e0feb021 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 4 Oct 2022 10:20:19 +0200 Subject: [PATCH 04/70] add polarion ids --- .../400__ods_dashboard/415__ods_dashboard_projects.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot index c3b6441b9..395b4b57d 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot @@ -12,13 +12,13 @@ ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature *** Test Cases *** Verify User Cannot Create Project Without Title - [Tags] ODS-XYZ + [Tags] ODS-1783 Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Page Create Project With Empty Title And Expect Error Verify User Can Create A Data Science Project - [Tags] ODS-XYZ + [Tags] ODS-1775 ODS-1784 Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} From 9ad67381eee4ee8280a290e2c5d974ee978d6af4 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 4 Oct 2022 18:22:06 +0200 Subject: [PATCH 05/70] add check on NS creation --- .../ODHDashboardProjects.resource | 39 +++++++++++-------- .../415__ods_dashboard_projects.robot | 15 +++++-- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource index 6ace5df13..3074bb960 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource @@ -1,5 +1,5 @@ *** Settings *** -Resource ../../../Page/Components/Components.resource +Resource ../../../Page/Components/Components.resource Resource ../../../Common.robot @@ -30,42 +30,43 @@ Is Data Science Projects Page Open Open Data Science Project [Documentation] Verifies submenu Settings > Cluster settings" is visible - [Arguments] ${project_title} - Click Link ${project_title} + [Arguments] ${project_displayed_name} + Click Link ${project_displayed_name} Delete Data Science Project - [Arguments] ${project_title} + [Arguments] ${project_displayed_name} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} Open Data Science Projects Page END - Project Should Be Listed project_title=${project_title} - Open Actions Menu Of Project project_title=${project_title} - Click Delete From Action Menu project_title=${project_title} + Project Should Be Listed project_displayed_name=${project_displayed_name} + Open Actions Menu Of Project project_displayed_name=${project_displayed_name} + Click Delete From Action Menu project_displayed_name=${project_displayed_name} # check NS deleted Open Actions Menu Of Project - [Arguments] ${project_title} - Project Should Be Listed project_title=${project_title} + [Arguments] ${project_displayed_name} + Project Should Be Listed project_displayed_name=${project_displayed_name} Click Element ${ACTIONS_BTN_XP} Click Delete From Action Menu - [Arguments] ${project_title} + [Arguments] ${project_displayed_name} Wait Until Page Contains Element ${DELETE_ACTION_BTN_XP} Click Element ${DELETE_ACTION_BTN_XP} # Add confirmation click Wait Until Project Is Open - [Arguments] ${project_title} - Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_title}")] timeout=30 + [Arguments] ${project_displayed_name} + Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_displayed_name}")] timeout=30 Project Should Be Listed - [Arguments] ${project_title} - Page Should Contain Element xpath=//td/a[text()="${project_title}"] + [Arguments] ${project_displayed_name} + Page Should Contain Element xpath=//td/a[text()="${project_displayed_name}"] Project's Owner Should Be - [Arguments] ${project_title} ${expected_username} - Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] + [Arguments] ${project_displayed_name} ${expected_username} + Page Should Contain Element xpath=//td[a[text()="${project_displayed_name}"]] + Page Should Contain Element xpath=//td[a[text()="${project_displayed_name}"]]/small[text()="${expected_username}"] Create Data Science Project [Arguments] ${title} ${description} @@ -77,6 +78,10 @@ Create Data Science Project Wait Until Element Is Enabled ${CREATE_BTN_XP} Click Button ${CREATE_BTN_XP} Wait Until Modal Disappear - # check NS created +Get Openshift Namespace From Data Science Project + [Arguments] ${project_displayed_name} + ${project_link}= Get Element Attribute xpath=//td/a[text()="${project_displayed_name}"] href + ${ns_name}= Split String From Right separator=/ max_split=1 string=${project_link} + [Return] ${ns_name[1]} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot index 395b4b57d..e7be37191 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot @@ -1,5 +1,6 @@ *** Settings *** Library SeleniumLibrary +Library OpenShiftLibrary Resource ../../Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource Suite Setup Project Suite Setup Suite Teardown Project Suite Teardown @@ -22,11 +23,12 @@ Verify User Can Create A Data Science Project Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} - Wait Until Project Is Open project_title=${PRJ_TITLE} + Wait Until Project Is Open project_displayed_name=${PRJ_TITLE} Open Data Science Projects Page - Project Should Be Listed project_title=${PRJ_TITLE} - Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} - [Teardown] Delete Data Science Project project_title=${PRJ_TITLE} + Project Should Be Listed project_displayed_name=${PRJ_TITLE} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_displayed_name=${PRJ_TITLE} + Check Corresponding Namespace Exists project_displayed_name=${PRJ_TITLE} + [Teardown] Delete Data Science Project project_displayed_name=${PRJ_TITLE} *** Keywords *** @@ -40,3 +42,8 @@ Project Suite Teardown Create Project With Empty Title And Expect Error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} + +Check Corresponding Namespace Exists + [Arguments] ${project_displayed_name} + ${ns_name}= Get Openshift Namespace From Data Science Project project_displayed_name=${project_displayed_name} + Oc Get kind=Project name=${ns_name} From 01486bb3b1faab15124d7e09f27f94fdf92ed119 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 7 Oct 2022 18:33:07 +0200 Subject: [PATCH 06/70] add teardown to delete NS using OC Signed-off-by: bdattoma --- .../ODHDashboardProjects.resource | 20 +++++++++++++++++-- .../415__ods_dashboard_projects.robot | 7 +++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource index 3074bb960..28e942fe8 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource @@ -42,7 +42,23 @@ Delete Data Science Project Project Should Be Listed project_displayed_name=${project_displayed_name} Open Actions Menu Of Project project_displayed_name=${project_displayed_name} Click Delete From Action Menu project_displayed_name=${project_displayed_name} - # check NS deleted + ${ns_name}= Get Openshift Namespace From Data Science Project project_displayed_name=${project_displayed_name} + ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${ns_name} + IF ${present} == ${TRUE} + Fail msg=The namespace for ${project_displayed_name} project was not deleted using UI actions.. + END + +Delete Data Science Projects From CLI + [Documentation] Deletets the Openshift Projects using OpenshiftLibrary + [Arguments] ${ocp_projects} + FOR ${project} IN @{ocp_projects} + ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${project} + IF ${present} == ${FALSE} + Continue For Loop + ELSE + OpenshiftLibrary.Oc Delete kind=Project name=${project} + END + END Open Actions Menu Of Project [Arguments] ${project_displayed_name} @@ -53,7 +69,7 @@ Click Delete From Action Menu [Arguments] ${project_displayed_name} Wait Until Page Contains Element ${DELETE_ACTION_BTN_XP} Click Element ${DELETE_ACTION_BTN_XP} - # Add confirmation click + Click Button Delete Wait Until Project Is Open [Arguments] ${project_displayed_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot index e7be37191..1efafb5c8 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot @@ -27,8 +27,10 @@ Verify User Can Create A Data Science Project Open Data Science Projects Page Project Should Be Listed project_displayed_name=${PRJ_TITLE} Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_displayed_name=${PRJ_TITLE} - Check Corresponding Namespace Exists project_displayed_name=${PRJ_TITLE} - [Teardown] Delete Data Science Project project_displayed_name=${PRJ_TITLE} + ${ns_name}= Check Corresponding Namespace Exists project_displayed_name=${PRJ_TITLE} + Delete Data Science Project project_displayed_name=${PRJ_TITLE} + ${ns_to_delete}= Create List ${ns_name} + [Teardown] Delete Data Science Projects From CLI ${ns_to_delete} *** Keywords *** @@ -47,3 +49,4 @@ Check Corresponding Namespace Exists [Arguments] ${project_displayed_name} ${ns_name}= Get Openshift Namespace From Data Science Project project_displayed_name=${project_displayed_name} Oc Get kind=Project name=${ns_name} + [Return] ${ns_name} From 4334b084ab48ae2022b8a35dbd2a54dfb2b0fe42 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 13 Oct 2022 17:23:13 +0200 Subject: [PATCH 07/70] add workspace + delete all notebook from CLI Signed-off-by: bdattoma --- .../Projects.resource} | 66 +++++++++++-------- .../ODHDataScienceProject/Workspaces.resource | 34 ++++++++++ .../415__ods_dashboard_projects.robot | 38 ++++++++--- 3 files changed, 102 insertions(+), 36 deletions(-) rename tests/Resources/Page/ODH/ODHDashboard/{ODHDashboardProjects.resource => ODHDataScienceProject/Projects.resource} (72%) create mode 100644 tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource similarity index 72% rename from tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource rename to tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 28e942fe8..96bc85437 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -1,20 +1,21 @@ *** Settings *** -Resource ../../../Page/Components/Components.resource -Resource ../../../Common.robot +Resource ../../../../Page/Components/Components.resource +Resource ../../../../Common.robot *** Variables *** -${DS_PROJECT_XP}= //h1[text()="Data science projects"] -${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] -${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] -${CREATE_BTN_XP}= xpath=//button[text()="Create"] -${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"] +${DS_PROJECT_XP}= //h1[text()="Data science projects"] +${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] +${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] +${GENERIC_CREATE_BTN_XP}= xpath=//button[text()="Create"] +${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create"] +${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"] ${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"] -${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"] +${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"] *** Keywords *** -Open Data Science Projects Page +Open Data Science Projects Home Page [Documentation] Verifies submenu Settings > Cluster settings" is visible Page Should Contain Data Science Projects Click Link Data Science Projects @@ -28,7 +29,7 @@ Is Data Science Projects Page Open ${page_open}= Run Keyword And Return Status Page Should Contain ${DS_PROJECT_XP} [Return] ${page_open} -Open Data Science Project +Open Data Science Project Details Page [Documentation] Verifies submenu Settings > Cluster settings" is visible [Arguments] ${project_displayed_name} Click Link ${project_displayed_name} @@ -37,7 +38,7 @@ Delete Data Science Project [Arguments] ${project_displayed_name} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} - Open Data Science Projects Page + Open Data Science Projects Home Page END Project Should Be Listed project_displayed_name=${project_displayed_name} Open Actions Menu Of Project project_displayed_name=${project_displayed_name} @@ -48,18 +49,6 @@ Delete Data Science Project Fail msg=The namespace for ${project_displayed_name} project was not deleted using UI actions.. END -Delete Data Science Projects From CLI - [Documentation] Deletets the Openshift Projects using OpenshiftLibrary - [Arguments] ${ocp_projects} - FOR ${project} IN @{ocp_projects} - ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${project} - IF ${present} == ${FALSE} - Continue For Loop - ELSE - OpenshiftLibrary.Oc Delete kind=Project name=${project} - END - END - Open Actions Menu Of Project [Arguments] ${project_displayed_name} Project Should Be Listed project_displayed_name=${project_displayed_name} @@ -86,13 +75,14 @@ Project's Owner Should Be Create Data Science Project [Arguments] ${title} ${description} - Click Button Create data science project + Click Button ${PROJECT_CREATE_BTN_XP} + # Click Button Create data science project Wait Until Page Contains Element ${TITLE_INPUT_XP} - Run Keyword And Warn On Failure Element Should Be Disabled ${CREATE_BTN_XP} + Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} Input Text ${TITLE_INPUT_XP} ${title} Input Text ${DESCR_INPUT_XP} ${description} - Wait Until Element Is Enabled ${CREATE_BTN_XP} - Click Button ${CREATE_BTN_XP} + Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + Click Button ${GENERIC_CREATE_BTN_XP} Wait Until Modal Disappear Get Openshift Namespace From Data Science Project @@ -101,3 +91,25 @@ Get Openshift Namespace From Data Science Project ${ns_name}= Split String From Right separator=/ max_split=1 string=${project_link} [Return] ${ns_name[1]} +Delete Data Science Projects From CLI + [Documentation] Deletets the Openshift Projects using OpenshiftLibrary + [Arguments] ${ocp_projects} + FOR ${project} IN @{ocp_projects} + ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${project} + IF ${present} == ${FALSE} + Continue For Loop + ELSE + OpenshiftLibrary.Oc Delete kind=Project name=${project} + END + END + +Delete All Data Science Projects From CLI + [Documentation] Deletes all the Openshift Projects which have been created + ... via DataScienceProjects feature, using OpenshiftLibrary + @{projects}= Oc Get kind=Project label_selector=opendatahub.io/user=htpasswd-2dcluster-2dadmin-2duser + @{to_delete}= Create List + FOR ${project} IN @{projects} + Log ${project['metadata']['name']} + Append To List ${to_delete} ${project['metadata']['name']} + END + Delete Data Science Projects From CLI ocp_projects=${to_delete} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource new file mode 100644 index 000000000..219d3cf26 --- /dev/null +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -0,0 +1,34 @@ +*** Settings *** +Resource ../../../../Page/Components/Components.resource +Resource ../../../../Common.robot +Resource Projects.resource + + +*** Variables *** +${WORKSPACE_CREATE_BTN_XP}= xpath=//button[text()="Create data science workspace"] +${WRKSP_NAME_INPUT_XP}= xpath=//input[@name="workspace-name"] +${WRKSP_DESCR_INPUT_XP}= xpath=//input[@name="workspace-description"] + + +*** Keywords *** +Create Workspace + [Documentation] Creates a new workspace in a Data Science project. It assumes + ... the DS Project details page is open + [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python + Click Button ${WORKSPACE_CREATE_BTN_XP} + Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} + Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} + Input Text ${WRKSP_NAME_INPUT_XP} ${name} + Input Text ${WRKSP_DESCR_INPUT_XP} ${description} + Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} + Select Jupyter Image image_name=${image_name} + # Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + # Click Button ${GENERIC_CREATE_BTN_XP} + # Wait Until Modal Disappear + +Select Jupyter Image + [Arguments] ${image_name} + Click Button xpath=//button[@aria-label="Options menu"] + Wait Until Page Contains Element xpath=//ul[@id="workspace-image-stream-selection"] + Select From List By Value xpath=//ul[@id="workspace-image-stream-selection"] Minimal Python + # Click Element xpath=//li/button/span[text()="Minimal Python"] diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot index 1efafb5c8..c75c2cf1f 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot @@ -1,36 +1,50 @@ *** Settings *** Library SeleniumLibrary Library OpenShiftLibrary -Resource ../../Resources/Page/ODH/ODHDashboard/ODHDashboardProjects.resource +Resource ../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +Resource ../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource Suite Setup Project Suite Setup Suite Teardown Project Suite Teardown +Test Setup Launch Data Science Project Main Page *** Variables *** ${PRJ_TITLE}= ODS-CI DS Project ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature +${WRKSP_TITLE}= ODS-CI Workspace 1 +${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using Minimal Python image to test DS Projects feature *** Test Cases *** Verify User Cannot Create Project Without Title [Tags] ODS-1783 - Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} - Open Data Science Projects Page + # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + # Open Data Science Projects Home Page Create Project With Empty Title And Expect Error Verify User Can Create A Data Science Project - [Tags] ODS-1775 ODS-1784 - Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} - Open Data Science Projects Page + [Tags] ODS-1775 + # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + Open Data Science Projects Home Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} Wait Until Project Is Open project_displayed_name=${PRJ_TITLE} - Open Data Science Projects Page + Open Data Science Projects Home Page Project Should Be Listed project_displayed_name=${PRJ_TITLE} Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_displayed_name=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_displayed_name=${PRJ_TITLE} + +Verify User Can Create A Workspace In A Data Science Project + [Tags] ODS-XYZ workspace + # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + # Open Data Science Projects Home Page + Open Data Science Project Details Page project_displayed_name=${PRJ_TITLE} + Wait Until Project Is Open project_displayed_name=${PRJ_TITLE} + Create Workspace name=${WRKSP_TITLE} + +Verify User Can Delete A Data Science Project + [Tags] ODS-1784 Delete Data Science Project project_displayed_name=${PRJ_TITLE} - ${ns_to_delete}= Create List ${ns_name} - [Teardown] Delete Data Science Projects From CLI ${ns_to_delete} + # check workspaces and resources get deleted too *** Keywords *** @@ -40,6 +54,12 @@ Project Suite Setup Project Suite Teardown Close All Browsers + Delete All Data Science Projects From CLI + +Launch Data Science Project Main Page + [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} + Launch Dashboard ocp_user_name=${username} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + Open Data Science Projects Home Page Create Project With Empty Title And Expect Error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ From 5abfca4d8e49f9bd442de97f3b2efae8012a584d Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 14 Oct 2022 14:50:47 +0200 Subject: [PATCH 08/70] minor variable name change Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 40 +++++++++---------- .../415__ods_dashboard_projects.robot | 18 ++++----- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 96bc85437..32a47cb78 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -31,47 +31,47 @@ Is Data Science Projects Page Open Open Data Science Project Details Page [Documentation] Verifies submenu Settings > Cluster settings" is visible - [Arguments] ${project_displayed_name} - Click Link ${project_displayed_name} + [Arguments] ${project_title} + Click Link ${project_title} Delete Data Science Project - [Arguments] ${project_displayed_name} + [Arguments] ${project_title} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} Open Data Science Projects Home Page END - Project Should Be Listed project_displayed_name=${project_displayed_name} - Open Actions Menu Of Project project_displayed_name=${project_displayed_name} - Click Delete From Action Menu project_displayed_name=${project_displayed_name} - ${ns_name}= Get Openshift Namespace From Data Science Project project_displayed_name=${project_displayed_name} + Project Should Be Listed project_title=${project_title} + Open Actions Menu Of Project project_title=${project_title} + Click Delete From Action Menu project_title=${project_title} + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title} ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${ns_name} IF ${present} == ${TRUE} - Fail msg=The namespace for ${project_displayed_name} project was not deleted using UI actions.. + Fail msg=The namespace for ${project_title} project was not deleted using UI actions.. END Open Actions Menu Of Project - [Arguments] ${project_displayed_name} - Project Should Be Listed project_displayed_name=${project_displayed_name} + [Arguments] ${project_title} + Project Should Be Listed project_title=${project_title} Click Element ${ACTIONS_BTN_XP} Click Delete From Action Menu - [Arguments] ${project_displayed_name} + [Arguments] ${project_title} Wait Until Page Contains Element ${DELETE_ACTION_BTN_XP} Click Element ${DELETE_ACTION_BTN_XP} Click Button Delete Wait Until Project Is Open - [Arguments] ${project_displayed_name} - Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_displayed_name}")] timeout=30 + [Arguments] ${project_title} + Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_title}")] timeout=30 Project Should Be Listed - [Arguments] ${project_displayed_name} - Page Should Contain Element xpath=//td/a[text()="${project_displayed_name}"] + [Arguments] ${project_title} + Page Should Contain Element xpath=//td/a[text()="${project_title}"] Project's Owner Should Be - [Arguments] ${project_displayed_name} ${expected_username} - Page Should Contain Element xpath=//td[a[text()="${project_displayed_name}"]] - Page Should Contain Element xpath=//td[a[text()="${project_displayed_name}"]]/small[text()="${expected_username}"] + [Arguments] ${project_title} ${expected_username} + Page Should Contain Element xpath=//td[a[text()="${project_title}"]] + Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project [Arguments] ${title} ${description} @@ -86,8 +86,8 @@ Create Data Science Project Wait Until Modal Disappear Get Openshift Namespace From Data Science Project - [Arguments] ${project_displayed_name} - ${project_link}= Get Element Attribute xpath=//td/a[text()="${project_displayed_name}"] href + [Arguments] ${project_title} + ${project_link}= Get Element Attribute xpath=//td/a[text()="${project_title}"] href ${ns_name}= Split String From Right separator=/ max_split=1 string=${project_link} [Return] ${ns_name[1]} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot index c75c2cf1f..eb69a812b 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot @@ -27,23 +27,23 @@ Verify User Can Create A Data Science Project # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} - Wait Until Project Is Open project_displayed_name=${PRJ_TITLE} + Wait Until Project Is Open project_title=${PRJ_TITLE} Open Data Science Projects Home Page - Project Should Be Listed project_displayed_name=${PRJ_TITLE} - Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_displayed_name=${PRJ_TITLE} - ${ns_name}= Check Corresponding Namespace Exists project_displayed_name=${PRJ_TITLE} + Project Should Be Listed project_title=${PRJ_TITLE} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} + ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} Verify User Can Create A Workspace In A Data Science Project [Tags] ODS-XYZ workspace # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} # Open Data Science Projects Home Page - Open Data Science Project Details Page project_displayed_name=${PRJ_TITLE} - Wait Until Project Is Open project_displayed_name=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Wait Until Project Is Open project_title=${PRJ_TITLE} Create Workspace name=${WRKSP_TITLE} Verify User Can Delete A Data Science Project [Tags] ODS-1784 - Delete Data Science Project project_displayed_name=${PRJ_TITLE} + Delete Data Science Project project_title=${PRJ_TITLE} # check workspaces and resources get deleted too @@ -66,7 +66,7 @@ Create Project With Empty Title And Expect Error Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} Check Corresponding Namespace Exists - [Arguments] ${project_displayed_name} - ${ns_name}= Get Openshift Namespace From Data Science Project project_displayed_name=${project_displayed_name} + [Arguments] ${project_title} + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title} Oc Get kind=Project name=${ns_name} [Return] ${ns_name} From 403527498507d1cb5a7bb8ed1ffe48817577d9a8 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 14 Oct 2022 18:42:14 +0200 Subject: [PATCH 09/70] add kw to wait for Dashboard spinner Signed-off-by: bdattoma --- tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index 15eaabff1..59e1daca6 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -700,3 +700,11 @@ Get Links From Switcher Open Application Switcher Menu [Documentation] Clicks on the App Switcher in the top navigation bar of RHODS Dashboard Click Button //button[@class="pf-c-app-launcher__toggle"] + +Maybe Wait For Dashboard Loading Spinner Page + [Documentation] Detecs the loading symbol (spinner) and wait for it to disappear. + ... If the spinner does not appear, the keyword ignores the error. + Run Keyword And Ignore Error Run Keywords + ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + ... AND + ... Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 From 3f40004fbec2a3089f4f7c4a5bc4228e5c973390 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 14 Oct 2022 18:42:34 +0200 Subject: [PATCH 10/70] add workspace basic testing (to be finished) Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 29 ++++--- .../ODHDataScienceProject/Workspaces.resource | 85 ++++++++++++++++--- .../415__ods_dashboard_projects.robot | 28 +++--- 3 files changed, 107 insertions(+), 35 deletions(-) rename tests/Tests/400__ods_dashboard/{ => 415__ods_dashboard_projects}/415__ods_dashboard_projects.robot (69%) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 32a47cb78..7ec2ba590 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -8,7 +8,7 @@ ${DS_PROJECT_XP}= //h1[text()="Data science projects"] ${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] ${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] ${GENERIC_CREATE_BTN_XP}= xpath=//button[text()="Create"] -${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create"] +${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project"] ${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"] ${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"] ${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"] @@ -21,8 +21,9 @@ Open Data Science Projects Home Page Click Link Data Science Projects 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 xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 - Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + # Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + # Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + Maybe Wait For Dashboard Loading Spinner Page Is Data Science Projects Page Open Close Generic Modal If Present @@ -33,6 +34,7 @@ Open Data Science Project Details Page [Documentation] Verifies submenu Settings > Cluster settings" is visible [Arguments] ${project_title} Click Link ${project_title} + Wait Until Project Is Open project_title=${project_title} Delete Data Science Project [Arguments] ${project_title} @@ -66,12 +68,11 @@ Wait Until Project Is Open Project Should Be Listed [Arguments] ${project_title} - Page Should Contain Element xpath=//td/a[text()="${project_title}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/a[text()="${project_title}"] Project's Owner Should Be [Arguments] ${project_title} ${expected_username} - Page Should Contain Element xpath=//td[a[text()="${project_title}"]] - Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project [Arguments] ${title} ${description} @@ -106,10 +107,14 @@ Delete Data Science Projects From CLI Delete All Data Science Projects From CLI [Documentation] Deletes all the Openshift Projects which have been created ... via DataScienceProjects feature, using OpenshiftLibrary - @{projects}= Oc Get kind=Project label_selector=opendatahub.io/user=htpasswd-2dcluster-2dadmin-2duser - @{to_delete}= Create List - FOR ${project} IN @{projects} - Log ${project['metadata']['name']} - Append To List ${to_delete} ${project['metadata']['name']} + ${res} ${projects}= Run Keyword And Ignore Error Oc Get kind=Project label_selector=opendatahub.io/user=htpasswd-2dcluster-2dadmin-2duser + IF "${res}" == "FAIL" + Log msg=There are probably no DS Projects to delete in teardown. + ELSE + @{to_delete}= Create List + FOR ${project} IN @{projects} + Log ${project['metadata']['name']} + Append To List ${to_delete} ${project['metadata']['name']} + END + Delete Data Science Projects From CLI ocp_projects=${to_delete} END - Delete Data Science Projects From CLI ocp_projects=${to_delete} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 219d3cf26..aed17c0d8 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -5,9 +5,16 @@ Resource Projects.resource *** Variables *** -${WORKSPACE_CREATE_BTN_XP}= xpath=//button[text()="Create data science workspace"] +${WORKSPACE_CREATE_BTN_XP}= xpath=//a[text()="Create data science workspace"] ${WRKSP_NAME_INPUT_XP}= xpath=//input[@name="workspace-name"] -${WRKSP_DESCR_INPUT_XP}= xpath=//input[@name="workspace-description"] +${WRKSP_DESCR_TXT_XP}= xpath=//textarea[@name="workspace-description"] +${WRKSP_IMAGE_MENU_BTN_XP}= xpath=//section[@id="notebook-image"]//button[@aria-label="Options menu"] +${WRKSP_IMAGE_ITEM_BTN_XP}= xpath=//ul[@id="workspace-image-stream-selection"]/li/button +${WRKSP_SIZE_MENU_BTN_XP}= xpath=//section[@id="deployment-size"]//button[@aria-label="Options menu"] +${WRKSP_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button +${WRKSP_STATUS_STOPPED}= Stopped +${WRKSP_STATUS_RUNNING}= Started +${WRKSP_STATUS_STARTING}= Starting *** Keywords *** @@ -15,20 +22,72 @@ Create Workspace [Documentation] Creates a new workspace in a Data Science project. It assumes ... the DS Project details page is open [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python - Click Button ${WORKSPACE_CREATE_BTN_XP} + Click Element ${WORKSPACE_CREATE_BTN_XP} Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} Input Text ${WRKSP_NAME_INPUT_XP} ${name} - Input Text ${WRKSP_DESCR_INPUT_XP} ${description} + Input Text ${WRKSP_DESCR_TXT_XP} ${description} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} - Select Jupyter Image image_name=${image_name} - # Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} - # Click Button ${GENERIC_CREATE_BTN_XP} - # Wait Until Modal Disappear + Select Workspace Jupyter Image image_name=${image_name} + ## Select Workspace Container Size # to fix, by default Small is already select + Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + Click Button ${GENERIC_CREATE_BTN_XP} + Wait Until Modal Disappear -Select Jupyter Image +Select Workspace Jupyter Image [Arguments] ${image_name} - Click Button xpath=//button[@aria-label="Options menu"] - Wait Until Page Contains Element xpath=//ul[@id="workspace-image-stream-selection"] - Select From List By Value xpath=//ul[@id="workspace-image-stream-selection"] Minimal Python - # Click Element xpath=//li/button/span[text()="Minimal Python"] + Wait Until Page Contains Element ${WRKSP_IMAGE_MENU_BTN_XP} + Click Button ${WRKSP_IMAGE_MENU_BTN_XP} + Wait Until Page Contains Element ${WRKSP_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] + Click Element ${WRKSP_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] + +Select Workspace Container Size + [Arguments] ${size_name}=Small + Wait Until Page Contains Element ${WRKSP_SIZE_MENU_BTN_XP} + Click Button ${WRKSP_SIZE_MENU_BTN_XP} + Wait Until Page Contains Element ${WRKSP_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] + Click Element ${WRKSP_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] + +Workspace Should Be Listed + [Arguments] ${workspace_title} + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${workspace_title}"] + +Workspace Status Should Be + [Arguments] ${workspace_title} ${status} + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[text()="${status}"] + +Wait Until Workspace Is Started + [Arguments] ${workspace_title} ${timeout}=25s + Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} + +Start Workspace + [Arguments] ${workspace_title} + ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_STOPPED} + IF ${is_stopped} == ${TRUE} + Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/input + ELSE + Log msg=Cannot start ${workspace_title} workspace because it is not stopped. + END + Wait Until Workspace Is Started workspace_title=${workspace_title} + +Launch Workspace + [Arguments] ${workspace_title} + ${is_started}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} + IF ${is_started} == ${TRUE} + Click Link xpath=//tr[td/h4[text()="${workspace_title}"]]/td/a[text()="Open"] + Run Keyword And Warn On Failure Login To Openshift ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE} + ${authorization_required} = Is Service Account Authorization Required + Run Keyword If ${authorization_required} Authorize jupyterhub service account + Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s + Maybe Close Popup + ELSE + Log msg=Cannot launch workspace ${workspace_title} because it is not running.. level=ERROR + END + +Check Launched Workspace Is The Correct One + [Arguments] ${workspace_title} ${image} + # check notebook id from URL.. + Open New Notebook In Jupyterlab Menu + Spawned Image Check ${image} + # ${spawn_fail} = Has Spawn Failed + diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot similarity index 69% rename from tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot rename to tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index eb69a812b..e4b06abf1 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -1,10 +1,10 @@ *** Settings *** Library SeleniumLibrary Library OpenShiftLibrary -Resource ../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource -Resource ../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource Suite Setup Project Suite Setup -Suite Teardown Project Suite Teardown +# Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page @@ -18,28 +18,36 @@ ${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using Minimal Pyt *** Test Cases *** Verify User Cannot Create Project Without Title [Tags] ODS-1783 - # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} - # Open Data Science Projects Home Page Create Project With Empty Title And Expect Error Verify User Can Create A Data Science Project [Tags] ODS-1775 - # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} Wait Until Project Is Open project_title=${PRJ_TITLE} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} - Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} + Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} + # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} Verify User Can Create A Workspace In A Data Science Project [Tags] ODS-XYZ workspace - # Launch Dashboard ocp_user_name=${TEST_USER_3.USERNAME} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} - # Open Data Science Projects Home Page Open Data Science Project Details Page project_title=${PRJ_TITLE} - Wait Until Project Is Open project_title=${PRJ_TITLE} Create Workspace name=${WRKSP_TITLE} + Wait Until Project Is Open project_title=${PRJ_TITLE} + # Add wait for workspace section to load rows + Workspace Should Be Listed workspace_title=${WRKSP_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + [Teardown] Close All Browsers + +Verify User Can Launch A Workspace + [Tags] ODS-XYZ workspace + Open Data Science Projects Home Page + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Start Workspace workspace_title=${WRKSP_TITLE} + Launch Workspace workspace_title=${WRKSP_TITLE} + Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=Minimal Python Verify User Can Delete A Data Science Project [Tags] ODS-1784 From f21a4c4394a7703489e2848a9381734e62a8fbc1 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 14 Oct 2022 18:59:21 +0200 Subject: [PATCH 11/70] draft for template testing version Signed-off-by: bdattoma --- ...15__ods_dashboard_projects_templates.robot | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot new file mode 100644 index 000000000..601909ff6 --- /dev/null +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot @@ -0,0 +1,55 @@ +*** Settings *** +Library SeleniumLibrary +Library OpenShiftLibrary +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +Suite Setup Project Suite Setup +Suite Teardown Project Suite Teardown +Test Setup Launch Data Science Project Main Page + + +*** Variables *** +${PRJ_TITLE}= ODS-CI DS Project +${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature +${WRKSP_TITLE}= ODS-CI Workspace 1 +${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using Minimal Python image to test DS Projects feature + + +*** Keywords *** +Project Suite Setup + Set Library Search Order SeleniumLibrary + # RHOSi Setup + +Project Suite Teardown + Close All Browsers + Delete All Data Science Projects From CLI + +Launch Data Science Project Main Page + [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} + Launch Dashboard ocp_user_name=${username} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + Open Data Science Projects Home Page + +Create DS Project Template + [Arguments] ${title} ${description} ${username} + Open Data Science Projects Home Page + IF "${title}" == "${EMPTY}" + ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ + Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${title} description=${title} + Click Button ${GENERIC_CREATE_BTN_XP} + Return From Keyword + ELSE + Create Data Science Project title=${title} description=${description} + END + + Wait Until Project Is Open project_title=${title} + Open Data Science Projects Home Page + Project Should Be Listed project_title=${title} + Project's Owner Should Be expected_username=${username} project_title=${title} + + +*** Test Cases *** +Verify User Can Create A Data Science Project + [Template] Create DS Project Template + [Tags] template + ${EMPTY} ${EMPTY} ${OCP_ADMIN_USER.USERNAME} + ${PRJ_TITLE} ${PRJ_DESCRIPTION} ${OCP_ADMIN_USER.USERNAME} From 784b54886fa76a39b949b9097c56fc9ca11e674f Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 14 Oct 2022 19:00:17 +0200 Subject: [PATCH 12/70] add generic cancel button Signed-off-by: bdattoma --- .../ODH/ODHDashboard/ODHDataScienceProject/Projects.resource | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 7ec2ba590..888e10b9f 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -8,6 +8,7 @@ ${DS_PROJECT_XP}= //h1[text()="Data science projects"] ${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] ${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] ${GENERIC_CREATE_BTN_XP}= xpath=//button[text()="Create"] +${GENERIC_CANCEL_BTN_XP}= xpath=//button[text()="Cancel"] ${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project"] ${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"] ${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"] From d27bdd9708d4783f48513323e54a8119a5c6832b Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 17 Oct 2022 17:58:27 +0200 Subject: [PATCH 13/70] add workspace v2 kw + new template Signed-off-by: bdattoma --- .../ODHDataScienceProject/Workspaces.resource | 43 ++++++++++++++++- ...15__ods_dashboard_projects_templates.robot | 47 +++++++++++++++---- 2 files changed, 80 insertions(+), 10 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index aed17c0d8..f8bb120d9 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -21,7 +21,7 @@ ${WRKSP_STATUS_STARTING}= Starting Create Workspace [Documentation] Creates a new workspace in a Data Science project. It assumes ... the DS Project details page is open - [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python + [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small Click Element ${WORKSPACE_CREATE_BTN_XP} Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} @@ -34,6 +34,47 @@ Create Workspace Click Button ${GENERIC_CREATE_BTN_XP} Wait Until Modal Disappear +Create Workspace v2 + [Documentation] Creates a new workspace in a Data Science project. It assumes + ... the DS Project deta + # [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small + [Arguments] ${wrksp_title} ${wrksp_description} ${prj_title} ${image_name} ${deployment_size} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} + Click Element ${WORKSPACE_CREATE_BTN_XP} + Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} + Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} + Input Text ${WRKSP_NAME_INPUT_XP} ${wrksp_title} + Input Text ${WRKSP_DESCR_TXT_XP} ${wrksp_description} + Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} + Select Workspace Jupyter Image image_name=${image_name} + ## Select Workspace Container Size # to fix, by default Small is already select + IF "${storage}" == "Persistent" + Click Element xpath=//input[@name="persistent-storage-type-radio"] + IF ${pv_existent} == ${TRUE} + Click Element xpath=//input[@name="add-existing-storage-checkbox"] + Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] + Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] + Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] + Click Element xpath=//ul/li/button[text()="${prj_title}"] + # select PV - function not available yet in the product + ELSE IF ${pv_existent} == ${FALSE} + Click Element xpath=//input[@name="create-new-storage-checkbox"] + Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] + Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] ${pv_name} + Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] + Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] ${pv_name} + Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] + Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} + ELSE + Fail msg="pv_existent" argument is required when selected storage type is "Persistent" + END + ELSE + Click Element xpath=//input[@name="ephemeral-storage-type-radio"] + END + Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + Click Button ${GENERIC_CREATE_BTN_XP} + Wait Until Modal Disappear + Select Workspace Jupyter Image [Arguments] ${image_name} Wait Until Page Contains Element ${WRKSP_IMAGE_MENU_BTN_XP} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot index 601909ff6..a13f115d8 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot @@ -6,6 +6,7 @@ Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProjec Suite Setup Project Suite Setup Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page +#Test Template Create Workspace In A DS Project *** Variables *** @@ -15,6 +16,32 @@ ${WRKSP_TITLE}= ODS-CI Workspace 1 ${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using Minimal Python image to test DS Projects feature +*** Test Cases *** +# title description prj_title image_name deployment_size storage pv_existent pv_name pv_description pv_size +# Create A Workspace With Ephimeral Storage ${WRKSP_TITLE} ${WRKSP_DESCRIPTION} ${PRJ_TITLE} Minimal Python Small Ephemeral ${NONE} ${NONE} ${NONE} ${NONE} + + + +Verify User Can Create A Data Science Project + [Template] Create DS Project Template + [Tags] template + ${EMPTY} ${EMPTY} ${OCP_ADMIN_USER.USERNAME} + ${PRJ_TITLE} ${PRJ_DESCRIPTION} ${OCP_ADMIN_USER.USERNAME} + # [Teardown] Delete All Data Science Projects From CLI + +Verify User Can Create A Workspace With Ephimeral Storage + [Template] Create Workspace In A DS Project + [Tags] template2 + ${WRKSP_TITLE} ${WRKSP_DESCRIPTION} ${PRJ_TITLE} Minimal Python Small + ... Ephemeral ${NONE} ${NONE} ${NONE} ${NONE} + +Verify User Can Create A Workspace With Persistent Storage + [Template] Create Workspace In A DS Project + [Tags] template3 + ${WRKSP_TITLE} ${WRKSP_DESCRIPTION} ${PRJ_TITLE} Minimal Python Small + ... Persistent ${NONE} ${NONE} ${NONE} ${NONE} + + *** Keywords *** Project Suite Setup Set Library Search Order SeleniumLibrary @@ -22,7 +49,7 @@ Project Suite Setup Project Suite Teardown Close All Browsers - Delete All Data Science Projects From CLI + #Delete All Data Science Projects From CLI Launch Data Science Project Main Page [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} @@ -40,16 +67,18 @@ Create DS Project Template ELSE Create Data Science Project title=${title} description=${description} END - Wait Until Project Is Open project_title=${title} Open Data Science Projects Home Page Project Should Be Listed project_title=${title} Project's Owner Should Be expected_username=${username} project_title=${title} - -*** Test Cases *** -Verify User Can Create A Data Science Project - [Template] Create DS Project Template - [Tags] template - ${EMPTY} ${EMPTY} ${OCP_ADMIN_USER.USERNAME} - ${PRJ_TITLE} ${PRJ_DESCRIPTION} ${OCP_ADMIN_USER.USERNAME} +Create Workspace In A DS Project + [Arguments] ${title} ${description} ${prj_title} ${image_name} ${deployment_size} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workspace v2 wrksp_title=${title} wrksp_description=${description} prj_title=${prj_title} image_name=${image_name} deployment_size=${deployment_size} + ... storage=${storage} pv_existent=${pv_existent} pv_name=${pv_name} pv_description=${pv_description} pv_size=${pv_size} + Wait Until Project Is Open project_title=${prj_title} + # Add wait for workspace section to load rows + Workspace Should Be Listed workspace_title=${wrksp_title} + Workspace Status Should Be workspace_title=${wrksp_title} status=${WRKSP_STATUS_STOPPED} From 51881d135389010a0438d50472c9afdc8f813975 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 18 Oct 2022 17:01:35 +0200 Subject: [PATCH 14/70] add workspace with PV storage testing Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 1 + .../ODHDataScienceProject/Workspaces.resource | 34 ++++++++++------ .../415__ods_dashboard_projects.robot | 39 +++++++++++++++---- 3 files changed, 56 insertions(+), 18 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 888e10b9f..d1218edfe 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -36,6 +36,7 @@ Open Data Science Project Details Page [Arguments] ${project_title} Click Link ${project_title} Wait Until Project Is Open project_title=${project_title} + Maybe Wait For Dashboard Loading Spinner Page Delete Data Science Project [Arguments] ${project_title} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index f8bb120d9..3ea252e7a 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -15,10 +15,11 @@ ${WRKSP_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button ${WRKSP_STATUS_STOPPED}= Stopped ${WRKSP_STATUS_RUNNING}= Started ${WRKSP_STATUS_STARTING}= Starting - +&{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch +... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow *** Keywords *** -Create Workspace +Create Workspace v1 [Documentation] Creates a new workspace in a Data Science project. It assumes ... the DS Project details page is open [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small @@ -34,7 +35,7 @@ Create Workspace Click Button ${GENERIC_CREATE_BTN_XP} Wait Until Modal Disappear -Create Workspace v2 +Create Workspace [Documentation] Creates a new workspace in a Data Science project. It assumes ... the DS Project deta # [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small @@ -66,7 +67,7 @@ Create Workspace v2 Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} ELSE - Fail msg="pv_existent" argument is required when selected storage type is "Persistent" + Log msg="pv_existent" argument is required when selected storage type is "Persistent" level=ERROR END ELSE Click Element xpath=//input[@name="ephemeral-storage-type-radio"] @@ -105,7 +106,7 @@ Start Workspace [Arguments] ${workspace_title} ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_STOPPED} IF ${is_stopped} == ${TRUE} - Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/input + Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[@class="pf-c-switch__toggle"] ELSE Log msg=Cannot start ${workspace_title} workspace because it is not stopped. END @@ -116,11 +117,12 @@ Launch Workspace ${is_started}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} IF ${is_started} == ${TRUE} Click Link xpath=//tr[td/h4[text()="${workspace_title}"]]/td/a[text()="Open"] - Run Keyword And Warn On Failure Login To Openshift ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE} - ${authorization_required} = Is Service Account Authorization Required - Run Keyword If ${authorization_required} Authorize jupyterhub service account - Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s - Maybe Close Popup + Switch Window NEW + Run Keyword And Warn On Failure Login To Openshift ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE} + ${authorization_required} = Is Service Account Authorization Required + Run Keyword If ${authorization_required} Authorize jupyterhub service account + Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s + Maybe Close Popup ELSE Log msg=Cannot launch workspace ${workspace_title} because it is not running.. level=ERROR END @@ -128,7 +130,17 @@ Launch Workspace Check Launched Workspace Is The Correct One [Arguments] ${workspace_title} ${image} # check notebook id from URL.. + ${current_url}= Get Location + Location Should Contain expected Open New Notebook In Jupyterlab Menu - Spawned Image Check ${image} + Spawned Image Check ${IMAGE_ID_MAPPING}[${image}] # ${spawn_fail} = Has Spawn Failed +Get Openshift Notebook CR From Workspace + [Arguments] ${workspace_title} ${namespace} + ${res} ${cr_name}= Run Keyword And Ignore Error Oc Get kind=Project + ... field_selector=metadata.annotations.openshift.io/display-name=${workspace_title},metadata.namespace=${namespace} + ... fields=[metadata.name] + [Return] ${res} ${cr_name} + + diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index e4b06abf1..305274346 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -12,7 +12,12 @@ Test Setup Launch Data Science Project Main Page ${PRJ_TITLE}= ODS-CI DS Project ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature ${WRKSP_TITLE}= ODS-CI Workspace 1 -${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using Minimal Python image to test DS Projects feature +${NB_IMAGE}= Minimal Python +${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using ${NB_IMAGE} image to test DS Projects feature +${PV_NAME}= ods-ci-pv +${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature +# PV size are in GB +${PV_SIZE}= 1 *** Test Cases *** @@ -31,23 +36,36 @@ Verify User Can Create A Data Science Project # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} -Verify User Can Create A Workspace In A Data Science Project +Verify User Can Create A Workspace With Ephimeral Storage [Tags] ODS-XYZ workspace Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace name=${WRKSP_TITLE} + Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Ephemeral pv_existent=${NONE} pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} Wait Until Project Is Open project_title=${PRJ_TITLE} - # Add wait for workspace section to load rows Workspace Should Be Listed workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} - [Teardown] Close All Browsers + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} -Verify User Can Launch A Workspace +Verify User Can Create A Workspace With Existent PV Storage [Tags] ODS-XYZ workspace + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Persistent pv_existent=${TRUE} pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} + Wait Until Project Is Open project_title=${PRJ_TITLE} + Workspace Should Be Listed workspace_title=${WRKSP_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + +Verify User Can Launch A Workspace + [Tags] ODS-XYZ workspace-launch Open Data Science Projects Home Page Open Data Science Project Details Page project_title=${PRJ_TITLE} Start Workspace workspace_title=${WRKSP_TITLE} Launch Workspace workspace_title=${WRKSP_TITLE} - Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=Minimal Python + Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} + [Teardown] Close All Browsers Verify User Can Delete A Data Science Project [Tags] ODS-1784 @@ -78,3 +96,10 @@ Check Corresponding Namespace Exists ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title} Oc Get kind=Project name=${ns_name} [Return] ${ns_name} + +Check Corresponding Notebook CR Exists + [Arguments] ${workspace_title} ${namespace} + ${res} ${_}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + IF "${res}" == "FAIL" + Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workspace_title} in ${namespace} NS + END From 9e65d187b13664ca59c8b5bb1a5303d0c6154cdc Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 18 Oct 2022 17:31:01 +0200 Subject: [PATCH 15/70] minor changes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 8 ++++++-- .../ODHDataScienceProject/Workspaces.resource | 4 +++- .../415__ods_dashboard_projects.robot | 14 ++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index d1218edfe..3fefdae82 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -22,8 +22,6 @@ Open Data Science Projects Home Page Click Link Data Science Projects 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 xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 - # Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 Maybe Wait For Dashboard Loading Spinner Page Is Data Science Projects Page Open @@ -87,9 +85,15 @@ Create Data Science Project Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} Wait Until Modal Disappear + Wait Until Project Is Open project_title=${title} + Get Openshift Namespace From Data Science Project [Arguments] ${project_title} + ${is_open}= Is Data Science Projects Page Open + IF ${is_open} == ${FALSE} + Open Data Science Projects Home Page + END ${project_link}= Get Element Attribute xpath=//td/a[text()="${project_title}"] href ${ns_name}= Split String From Right separator=/ max_split=1 string=${project_link} [Return] ${ns_name[1]} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 3ea252e7a..431dd5af0 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -54,7 +54,8 @@ Create Workspace IF ${pv_existent} == ${TRUE} Click Element xpath=//input[@name="add-existing-storage-checkbox"] Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] - Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] + Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-label"]//button[@aria-label="Options menu"] + # Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] Click Element xpath=//ul/li/button[text()="${prj_title}"] # select PV - function not available yet in the product @@ -75,6 +76,7 @@ Create Workspace Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} Wait Until Modal Disappear + Wait Until Project Is Open project_title=${prj_title} Select Workspace Jupyter Image [Arguments] ${image_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 305274346..5158fd730 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -29,7 +29,6 @@ Verify User Can Create A Data Science Project [Tags] ODS-1775 Open Data Science Projects Home Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} - Wait Until Project Is Open project_title=${PRJ_TITLE} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} @@ -41,22 +40,21 @@ Verify User Can Create A Workspace With Ephimeral Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Ephemeral pv_existent=${NONE} pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} - Wait Until Project Is Open project_title=${PRJ_TITLE} Workspace Should Be Listed workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} Verify User Can Create A Workspace With Existent PV Storage - [Tags] ODS-XYZ workspace + [Tags] ODS-XYZ workspace-pv Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Persistent pv_existent=${TRUE} pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} - Wait Until Project Is Open project_title=${PRJ_TITLE} - Workspace Should Be Listed workspace_title=${WRKSP_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} - ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + # Workspace Should Be Listed workspace_title=${WRKSP_TITLE} + # Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + # ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + # Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + [Teardown] Close All Browsers Verify User Can Launch A Workspace [Tags] ODS-XYZ workspace-launch From 93c7fa0a5a2051ffc51379d33e823639808f47e5 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 18 Oct 2022 19:15:59 +0200 Subject: [PATCH 16/70] fix existing pv + add polarion ids Signed-off-by: bdattoma --- .../ODHDataScienceProject/Workspaces.resource | 6 +++--- .../415__ods_dashboard_projects.robot | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 431dd5af0..3d3b3a1ed 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -53,9 +53,9 @@ Create Workspace Click Element xpath=//input[@name="persistent-storage-type-radio"] IF ${pv_existent} == ${TRUE} Click Element xpath=//input[@name="add-existing-storage-checkbox"] - Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] - Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-label"]//button[@aria-label="Options menu"] - # Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] + Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-control"] + # Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] + Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-control"] Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] Click Element xpath=//ul/li/button[text()="${prj_title}"] # select PV - function not available yet in the product diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 5158fd730..a3082e9e6 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -36,7 +36,7 @@ Verify User Can Create A Data Science Project ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} Verify User Can Create A Workspace With Ephimeral Storage - [Tags] ODS-XYZ workspace + [Tags] ODS-1812 Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Ephemeral pv_existent=${NONE} pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} @@ -46,16 +46,17 @@ Verify User Can Create A Workspace With Ephimeral Storage Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} Verify User Can Create A Workspace With Existent PV Storage - [Tags] ODS-XYZ workspace-pv + [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Persistent pv_existent=${TRUE} pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} - # Workspace Should Be Listed workspace_title=${WRKSP_TITLE} - # Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} - # ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - # Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Workspace Should Be Listed workspace_title=${WRKSP_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} [Teardown] Close All Browsers + Verify User Can Launch A Workspace [Tags] ODS-XYZ workspace-launch Open Data Science Projects Home Page From e4dca431ad42b44462d1e0bfcc40a124f564e74d Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 19 Oct 2022 13:33:01 +0200 Subject: [PATCH 17/70] fix prj selection in existing pv Signed-off-by: bdattoma --- .../ODHDataScienceProject/Workspaces.resource | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 3d3b3a1ed..8cbc74367 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -17,6 +17,8 @@ ${WRKSP_STATUS_RUNNING}= Started ${WRKSP_STATUS_STARTING}= Starting &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow +${WRKSP_CREATE_LAUNCH_BTN_XP}= xpath=//button[text()="Create and launch"] + *** Keywords *** Create Workspace v1 @@ -40,7 +42,7 @@ Create Workspace ... the DS Project deta # [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small [Arguments] ${wrksp_title} ${wrksp_description} ${prj_title} ${image_name} ${deployment_size} - ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${launch}=${FALSE} Click Element ${WORKSPACE_CREATE_BTN_XP} Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} @@ -53,9 +55,11 @@ Create Workspace Click Element xpath=//input[@name="persistent-storage-type-radio"] IF ${pv_existent} == ${TRUE} Click Element xpath=//input[@name="add-existing-storage-checkbox"] - Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-control"] - # Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] - Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-control"] + #Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-control"] + #Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] + #Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input + Wait Until Element Is Enabled xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input + Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] Click Element xpath=//ul/li/button[text()="${prj_title}"] # select PV - function not available yet in the product @@ -73,8 +77,13 @@ Create Workspace ELSE Click Element xpath=//input[@name="ephemeral-storage-type-radio"] END - Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} - Click Button ${GENERIC_CREATE_BTN_XP} + IF ${launch} == ${TRUE} + Wait Until Element Is Enabled ${WRKSP_CREATE_LAUNCH_BTN_XP} + Click Button ${WRKSP_CREATE_LAUNCH_BTN_XP} + ELSE + Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + Click Button ${GENERIC_CREATE_BTN_XP} + END Wait Until Modal Disappear Wait Until Project Is Open project_title=${prj_title} From d54e84b7428b27f8af18a461476a986ba3ea5790 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 19 Oct 2022 13:34:33 +0200 Subject: [PATCH 18/70] fix prj selection in existing pv (2) Signed-off-by: bdattoma --- .../ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 8cbc74367..d38fef9e5 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -55,9 +55,6 @@ Create Workspace Click Element xpath=//input[@name="persistent-storage-type-radio"] IF ${pv_existent} == ${TRUE} Click Element xpath=//input[@name="add-existing-storage-checkbox"] - #Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group-control"] - #Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//button[@aria-label="Options menu"] - #Wait Until Page Contains Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input Wait Until Element Is Enabled xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] From dc0a12ae2469d5276123ea3241f7ee92e6e45e27 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 19 Oct 2022 17:22:05 +0200 Subject: [PATCH 19/70] add workspace + pv creation test + misc fixes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 1 + .../ODHDataScienceProject/Workspaces.resource | 11 ++++++----- .../415__ods_dashboard_projects.robot | 13 +++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 3fefdae82..b37b6f5a1 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -65,6 +65,7 @@ Click Delete From Action Menu Wait Until Project Is Open [Arguments] ${project_title} Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_title}")] timeout=30 + Maybe Wait For Dashboard Loading Spinner Page Project Should Be Listed [Arguments] ${project_title} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index d38fef9e5..86221ef6d 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -65,7 +65,7 @@ Create Workspace Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] ${pv_name} Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] - Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] ${pv_name} + Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] ${pv_description} Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} ELSE @@ -146,9 +146,10 @@ Check Launched Workspace Is The Correct One Get Openshift Notebook CR From Workspace [Arguments] ${workspace_title} ${namespace} - ${res} ${cr_name}= Run Keyword And Ignore Error Oc Get kind=Project - ... field_selector=metadata.annotations.openshift.io/display-name=${workspace_title},metadata.namespace=${namespace} - ... fields=[metadata.name] - [Return] ${res} ${cr_name} + # ${res} ${cr_name}= Run Keyword And Ignore Error Oc Get kind=Notebook + # ... field_selector=metadata.annotations.openshift.io/display-name=${workspace_title},metadata.namespace=${namespace} + # ... fields=[metadata.name] + ${rc} ${cr_name}= Run And Return Rc And Output oc get notebook -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${workspace_title}")].metadata.name}' + [Return] ${rc} ${cr_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index a3082e9e6..0381d93d4 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -3,6 +3,7 @@ Library SeleniumLibrary Library OpenShiftLibrary Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource Suite Setup Project Suite Setup # Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page @@ -56,6 +57,18 @@ Verify User Can Create A Workspace With Existent PV Storage Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} [Teardown] Close All Browsers +Verify User Can Create A Workspace Adding A New PV Storage + [Tags] ODS-1816 + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Persistent pv_existent=${FALSE} pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} + Workspace Should Be Listed workspace_title=${WRKSP_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Storage Size Should Be title=${PV_NAME} namespace=${ns_name} size=${PV_SIZE} + [Teardown] Close All Browsers Verify User Can Launch A Workspace [Tags] ODS-XYZ workspace-launch From e368e014e4fa3be45f849509a623c4580bb66b8c Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 19 Oct 2022 18:06:28 +0200 Subject: [PATCH 20/70] remove temporarily the custom pv size. leave default Signed-off-by: bdattoma --- .../ODHDashboard/ODHDataScienceProject/Workspaces.resource | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 86221ef6d..00dfdf180 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -66,8 +66,8 @@ Create Workspace Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] ${pv_name} Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] ${pv_description} - Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] - Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} + # Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] + # Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} ELSE Log msg="pv_existent" argument is required when selected storage type is "Persistent" level=ERROR END From f6d2fc645e6f031b9a9621e66c122e9cc574978f Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 20 Oct 2022 13:30:48 +0200 Subject: [PATCH 21/70] add TC to stop workspaces Signed-off-by: bdattoma --- tests/Resources/Common.robot | 21 +++++-- .../ODHDataScienceProject/Projects.resource | 6 +- .../ODHDataScienceProject/Workspaces.resource | 34 +++++++++-- .../415__ods_dashboard_projects.robot | 56 ++++++++++++++----- 4 files changed, 93 insertions(+), 24 deletions(-) diff --git a/tests/Resources/Common.robot b/tests/Resources/Common.robot index da56feccf..62c92cb5a 100644 --- a/tests/Resources/Common.robot +++ b/tests/Resources/Common.robot @@ -194,14 +194,14 @@ Is Generic Modal Displayed [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s IF ${partial_match} == ${TRUE} ${is_displayed}= Run Keyword And Return Status - ... Page Should Contain Element xpath=//*[contains(id,"${id}")] timeout=${timeout} + ... Page Should Contain Element xpath=//*[contains(id,"${id}")] ELSE ${is_displayed}= Run Keyword And Return Status - ... Page Should Contain Element xpath=//*[@id="${id}")] timeout=${timeout} + ... Page Should Contain Element xpath=//*[@id="${id}")] END [Return] ${is_displayed} -Wait Until Modal Disappear +Wait Until Modal Disappears [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s ${is_modal}= Is Generic Modal Displayed IF ${is_modal} == ${TRUE} @@ -214,9 +214,22 @@ Wait Until Modal Disappear Log No Modals on the screen right now.. level=WARN END +Wait Until Modal Appears + [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s + ${is_modal}= Is Generic Modal Displayed + IF ${is_modal} == ${FALSE} + IF ${partial_match} == ${TRUE} + Wait Until Page Contains Element xpath=//*[contains(@id,"${id}")] timeout=${timeout} + ELSE + Wait Until Page Contains Element xpath=//*[@id="${id}")] timeout=${timeout} + END + ELSE + Log No Modals on the screen right now.. level=WARN + END + Close Generic Modal If Present ${is_modal}= Is Generic Modal Displayed IF ${is_modal} == ${TRUE} Click Element xpath=//button[@aria-label="Close"] - Wait Until Modal Disappear + Wait Until Modal Disappears END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index b37b6f5a1..660cc75b0 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -32,6 +32,10 @@ Is Data Science Projects Page Open Open Data Science Project Details Page [Documentation] Verifies submenu Settings > Cluster settings" is visible [Arguments] ${project_title} + ${is_open}= Is Data Science Projects Page Open + IF ${is_open} == ${FALSE} + Open Data Science Projects Home Page + END Click Link ${project_title} Wait Until Project Is Open project_title=${project_title} Maybe Wait For Dashboard Loading Spinner Page @@ -85,7 +89,7 @@ Create Data Science Project Input Text ${DESCR_INPUT_XP} ${description} Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} - Wait Until Modal Disappear + Wait Until Modal Disappears Wait Until Project Is Open project_title=${title} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 00dfdf180..d10f95c40 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -15,6 +15,7 @@ ${WRKSP_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button ${WRKSP_STATUS_STOPPED}= Stopped ${WRKSP_STATUS_RUNNING}= Started ${WRKSP_STATUS_STARTING}= Starting +${WRKSP_STOP_BTN_XP}= xpath=//button[text()="Stop workspace"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow ${WRKSP_CREATE_LAUNCH_BTN_XP}= xpath=//button[text()="Create and launch"] @@ -35,7 +36,7 @@ Create Workspace v1 ## Select Workspace Container Size # to fix, by default Small is already select Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} - Wait Until Modal Disappear + Wait Until Modal Disappears Create Workspace [Documentation] Creates a new workspace in a Data Science project. It assumes @@ -81,7 +82,7 @@ Create Workspace Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} END - Wait Until Modal Disappear + Wait Until Modal Disappears Wait Until Project Is Open project_title=${prj_title} Select Workspace Jupyter Image @@ -135,11 +136,36 @@ Launch Workspace Log msg=Cannot launch workspace ${workspace_title} because it is not running.. level=ERROR END +Stop Workspace + [Arguments] ${workspace_title} ${press_cancel}=${FALSE} + ${is_started}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} + IF ${is_started} == ${TRUE} + Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[@class="pf-c-switch__toggle"] + Wait Until Modal Appears + Run Keyword And Continue On Failure Page Should Contain Stop workspace? + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workspace? Any changes without saving will be erased. + Run Keyword And Continue On Failure Page Should Contain To save changes, access your workspace + Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] + Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] + Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Click Button ${WRKSP_STOP_BTN_XP} + END + + + ELSE + Fail msg=Cannot stop workspace ${workspace_title} because it is not running... + END + Check Launched Workspace Is The Correct One - [Arguments] ${workspace_title} ${image} + [Arguments] ${workspace_title} ${image} ${namespace} + ${_} ${cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} # check notebook id from URL.. ${current_url}= Get Location - Location Should Contain expected + Location Should Contain ${cr_name} + Location Should Contain ${namespace} Open New Notebook In Jupyterlab Menu Spawned Image Check ${IMAGE_ID_MAPPING}[${image}] # ${spawn_fail} = Has Spawn Failed diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 0381d93d4..921b7158d 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -12,22 +12,31 @@ Test Setup Launch Data Science Project Main Page *** Variables *** ${PRJ_TITLE}= ODS-CI DS Project ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature -${WRKSP_TITLE}= ODS-CI Workspace 1 +# ${PRJ_TITLE_2}= ODS-CI DS Project 2 +# ${PRJ_DESCRIPTION_2}= ODS-CI DS Project 2 is a test for validating DSG feature ${NB_IMAGE}= Minimal Python +${WRKSP_TITLE}= ODS-CI Workspace 1 ${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using ${NB_IMAGE} image to test DS Projects feature +${WRKSP_2_TITLE}= ODS-CI Workspace 2 +${WRKSP_2_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAGE} image to test DS Projects feature +${WRKSP_3_TITLE}= ODS-CI Workspace 2 +${WRKSP_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAGE} image to test DS Projects feature ${PV_NAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB -${PV_SIZE}= 1 +${PV_SIZE}= 20 *** Test Cases *** Verify User Cannot Create Project Without Title [Tags] ODS-1783 + [Setup] Launch Data Science Project Main Page Create Project With Empty Title And Expect Error + # add close modal Verify User Can Create A Data Science Project [Tags] ODS-1775 + [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} Open Data Science Projects Home Page @@ -39,8 +48,9 @@ Verify User Can Create A Data Science Project Verify User Can Create A Workspace With Ephimeral Storage [Tags] ODS-1812 Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small - ... storage=Ephemeral pv_existent=${NONE} pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} + Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} launch=${FALSE} Workspace Should Be Listed workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -49,23 +59,25 @@ Verify User Can Create A Workspace With Ephimeral Storage Verify User Can Create A Workspace With Existent PV Storage [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small - ... storage=Persistent pv_existent=${TRUE} pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} - Workspace Should Be Listed workspace_title=${WRKSP_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + Create Workspace wrksp_title=${WRKSP_2_TITLE} wrksp_description=${WRKSP_2_DESCRIPTION} prj_title=${PRJ_TITLE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} + ... pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} launch=${FALSE} + Workspace Should Be Listed workspace_title=${WRKSP_2_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_2_TITLE} namespace=${ns_name} [Teardown] Close All Browsers Verify User Can Create A Workspace Adding A New PV Storage [Tags] ODS-1816 Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small - ... storage=Persistent pv_existent=${FALSE} pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} - Workspace Should Be Listed workspace_title=${WRKSP_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + Create Workspace wrksp_title=${WRKSP_3_TITLE} wrksp_description=${WRKSP_3_DESCRIPTION} prj_title=${PRJ_TITLE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} + ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} launch=${TRUE} + Workspace Should Be Listed workspace_title=${WRKSP_3_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_3_TITLE} namespace=${ns_name} Open Data Science Project Details Page project_title=${PRJ_TITLE} Storage Size Should Be title=${PV_NAME} namespace=${ns_name} size=${PV_SIZE} [Teardown] Close All Browsers @@ -73,12 +85,26 @@ Verify User Can Create A Workspace Adding A New PV Storage Verify User Can Launch A Workspace [Tags] ODS-XYZ workspace-launch Open Data Science Projects Home Page + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Start Workspace workspace_title=${WRKSP_TITLE} Launch Workspace workspace_title=${WRKSP_TITLE} - Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} + Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} namespace=${ns_name} + Switch Window Open Data Hub [Teardown] Close All Browsers +Verify User Can Stop A Workspace + [Tags] ODS-XYZW + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Stop Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} + Stop Workspace workspace_title=${WRKSP_TITLE} + [Teardown] Close All Browsers + + +# Verify User Can Delete A Workspace +# [Tags] ODS-XYZ + + Verify User Can Delete A Data Science Project [Tags] ODS-1784 Delete Data Science Project project_title=${PRJ_TITLE} From b62c2b0dc2cdc4b1193b015e7bcf1e853792cc4b Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 20 Oct 2022 16:40:57 +0200 Subject: [PATCH 22/70] add TC to delete workspaces Signed-off-by: bdattoma --- .../ODHDataScienceProject/Workspaces.resource | 32 +++++++++++++++---- .../415__ods_dashboard_projects.robot | 22 ++++++++++--- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index d10f95c40..0ce086eeb 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -16,6 +16,7 @@ ${WRKSP_STATUS_STOPPED}= Stopped ${WRKSP_STATUS_RUNNING}= Started ${WRKSP_STATUS_STARTING}= Starting ${WRKSP_STOP_BTN_XP}= xpath=//button[text()="Stop workspace"] +${WRKSP_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow ${WRKSP_CREATE_LAUNCH_BTN_XP}= xpath=//button[text()="Create and launch"] @@ -121,17 +122,21 @@ Start Workspace END Wait Until Workspace Is Started workspace_title=${workspace_title} +Access To Workspace + [Arguments] ${username}=${TEST_USER.USERNAME} ${password}=${TEST_USER.PASSWORD} ${auth_type}=${TEST_USER.AUTH_TYPE} + Switch Window NEW + Run Keyword And Warn On Failure Login To Openshift ${username} ${password} ${auth_type} + ${authorization_required} = Is Service Account Authorization Required + Run Keyword If ${authorization_required} Authorize jupyterhub service account + Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s + Maybe Close Popup + Launch Workspace [Arguments] ${workspace_title} ${is_started}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} IF ${is_started} == ${TRUE} Click Link xpath=//tr[td/h4[text()="${workspace_title}"]]/td/a[text()="Open"] - Switch Window NEW - Run Keyword And Warn On Failure Login To Openshift ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE} - ${authorization_required} = Is Service Account Authorization Required - Run Keyword If ${authorization_required} Authorize jupyterhub service account - Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s - Maybe Close Popup + Access To Workspace ELSE Log msg=Cannot launch workspace ${workspace_title} because it is not running.. level=ERROR END @@ -159,6 +164,21 @@ Stop Workspace Fail msg=Cannot stop workspace ${workspace_title} because it is not running... END +Delete Workspace + [Arguments] ${workspace_title} ${press_cancel}=${FALSE} + Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] + Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] + Wait Until Modal Appears + Run Keyword And Continue On Failure Page Should Contain Confirm notebook delete + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${workspace_title}? + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Click Button ${WRKSP_DELETE_BTN_XP} + END + + Check Launched Workspace Is The Correct One [Arguments] ${workspace_title} ${image} ${namespace} ${_} ${cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 921b7158d..1eb19e46a 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -101,8 +101,14 @@ Verify User Can Stop A Workspace [Teardown] Close All Browsers -# Verify User Can Delete A Workspace -# [Tags] ODS-XYZ +Verify User Can Delete A Workspace + [Tags] ODS-XYZWX + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Delete Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} + Delete Workspace workspace_title=${WRKSP_TITLE} + Check Workspace Resources Are Deleted workspace_title=${WRKSP_TITLE} namespace=${ns_name} + [Teardown] Close All Browsers Verify User Can Delete A Data Science Project @@ -137,7 +143,15 @@ Check Corresponding Namespace Exists Check Corresponding Notebook CR Exists [Arguments] ${workspace_title} ${namespace} - ${res} ${_}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} - IF "${res}" == "FAIL" + ${res} ${response}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + IF "${response}" == "${EMPTY}" Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workspace_title} in ${namespace} NS END + +Check Workspace Resources Are Deleted + [Arguments] ${workspace_title} ${namespace} + ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} + IF ${status} == ${TRUE} + Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. + END + From eaa54eb5d68036443cd2b47b323878d311677f2b Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 20 Oct 2022 17:37:23 +0200 Subject: [PATCH 23/70] add polarion ids + add start wrksp in creation TCs Signed-off-by: bdattoma --- .../ODHDataScienceProject/Workspaces.resource | 19 ++++++++----- .../415__ods_dashboard_projects.robot | 28 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 0ce086eeb..fcf422885 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -19,7 +19,7 @@ ${WRKSP_STOP_BTN_XP}= xpath=//button[text()="Stop workspace"] ${WRKSP_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow -${WRKSP_CREATE_LAUNCH_BTN_XP}= xpath=//button[text()="Create and launch"] +${WRKSP_CREATE_START_BTN_XP}= xpath=//button[text()="Create and launch"] *** Keywords *** @@ -44,7 +44,8 @@ Create Workspace ... the DS Project deta # [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small [Arguments] ${wrksp_title} ${wrksp_description} ${prj_title} ${image_name} ${deployment_size} - ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${launch}=${FALSE} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${start}=${FALSE} + ... ${press_cancel}=${FALSE} Click Element ${WORKSPACE_CREATE_BTN_XP} Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} @@ -76,12 +77,16 @@ Create Workspace ELSE Click Element xpath=//input[@name="ephemeral-storage-type-radio"] END - IF ${launch} == ${TRUE} - Wait Until Element Is Enabled ${WRKSP_CREATE_LAUNCH_BTN_XP} - Click Button ${WRKSP_CREATE_LAUNCH_BTN_XP} + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} - Click Button ${GENERIC_CREATE_BTN_XP} + IF ${start} == ${TRUE} + Wait Until Element Is Enabled ${WRKSP_CREATE_START_BTN_XP} + Click Button ${WRKSP_CREATE_START_BTN_XP} + ELSE + Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + Click Button ${GENERIC_CREATE_BTN_XP} + END END Wait Until Modal Disappears Wait Until Project Is Open project_title=${prj_title} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 1eb19e46a..1eb80be6b 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -45,35 +45,42 @@ Verify User Can Create A Data Science Project # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} -Verify User Can Create A Workspace With Ephimeral Storage +Verify User Can Create And Start A Workspace With Ephimeral Storage [Tags] ODS-1812 Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workspace wrksp_title=${EMPTY} wrksp_description=${EMPTY} prj_title=${PRJ_TITLE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} press_cancel=${TRUE} Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} - ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} launch=${FALSE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} Workspace Should Be Listed workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Start Workspace workspace_title=${WRKSP_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_RUNNING} -Verify User Can Create A Workspace With Existent PV Storage +Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_2_TITLE} wrksp_description=${WRKSP_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} - ... pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} launch=${FALSE} + ... pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} start=${TRUE} Workspace Should Be Listed workspace_title=${WRKSP_2_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STOPPED} + Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STARTING} + Wait Until Workspace Is Started workspace_title=${WRKSP_2_TITLE} + # Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workspace_title=${WRKSP_2_TITLE} namespace=${ns_name} [Teardown] Close All Browsers -Verify User Can Create A Workspace Adding A New PV Storage +Verify User Can Create And Start A Workspace Adding A New PV Storage [Tags] ODS-1816 Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_3_TITLE} wrksp_description=${WRKSP_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} - ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} launch=${TRUE} + ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${FALSE} Workspace Should Be Listed workspace_title=${WRKSP_3_TITLE} Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -83,7 +90,7 @@ Verify User Can Create A Workspace Adding A New PV Storage [Teardown] Close All Browsers Verify User Can Launch A Workspace - [Tags] ODS-XYZ workspace-launch + [Tags] ODS-1815 Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -94,15 +101,16 @@ Verify User Can Launch A Workspace [Teardown] Close All Browsers Verify User Can Stop A Workspace - [Tags] ODS-XYZW + [Tags] ODS-1817 Open Data Science Project Details Page project_title=${PRJ_TITLE} Stop Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} Stop Workspace workspace_title=${WRKSP_TITLE} + # add checks on notebook pod is terminated [Teardown] Close All Browsers Verify User Can Delete A Workspace - [Tags] ODS-XYZWX + [Tags] ODS-1813 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Delete Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} From 487a13f185b473527aa136994200b57ba7ad0470 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 21 Oct 2022 18:01:53 +0200 Subject: [PATCH 24/70] fix keywords + add TC for handling wrksp from home Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 43 ++++++++++++++++++- .../ODHDataScienceProject/Workspaces.resource | 2 +- .../415__ods_dashboard_projects.robot | 22 ++++++++-- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 660cc75b0..bf24a657c 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -1,7 +1,7 @@ *** Settings *** Resource ../../../../Page/Components/Components.resource Resource ../../../../Common.robot - +Resource ./Workspaces.resource *** Variables *** ${DS_PROJECT_XP}= //h1[text()="Data science projects"] @@ -129,3 +129,44 @@ Delete All Data Science Projects From CLI END Delete Data Science Projects From CLI ocp_projects=${to_delete} END + +Workspace Status Should Be From Projects Home Page + [Arguments] ${workspace_title} ${status} ${project_title} + ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} + ${_} ${workspace_cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/span[text()="${status}"] + +Start Workspace From Projects Home Page + [Documentation] Trigger the workspace "start" process from DS Projects home page. + ... It needs ${workspace_title} and ${project_title} at least. If ${namespace} and/or + ... ${workspace_cr_name} are given too, the kw spares one or two calls to openshift API server + [Arguments] ${workspace_title} ${project_title} ${namespace}=${EMPTY} ${workspace_cr_name}=${EMPTY} + ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_STOPPED} project_title=${project_title} + IF ${is_stopped} == ${TRUE} + IF "${workspace_cr_name}" == "${EMPTY}" + IF "${namespace}" == "${EMPTY}" + ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} + END + ${_} ${workspace_cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + END + # Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/input[@id="${workspace_cr_name}"] + Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/span[@class="pf-c-switch__toggle"] + ELSE + Log msg=Cannot start ${workspace_title} workspace because it is not stopped. + END + Wait Until Workspace Is Started From Projects Home Page workspace_title=${workspace_title} project_title=${project_title} + +Wait Until Workspace Is Started From Projects Home Page + [Arguments] ${workspace_title} ${project_title} ${timeout}=25s + Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} project_title=${project_title} + +Launch Workspace From Projects Home Page + [Arguments] ${workspace_title} ${project_title} + Open Data Science Projects Home Page + ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} project_title=${project_title} + IF ${is_started} == ${TRUE} + Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workspace_title}"] + Access To Workspace + ELSE + Fail msg=Cannot launch workspace ${workspace_title} because it is not running... + END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index fcf422885..a85455197 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -143,7 +143,7 @@ Launch Workspace Click Link xpath=//tr[td/h4[text()="${workspace_title}"]]/td/a[text()="Open"] Access To Workspace ELSE - Log msg=Cannot launch workspace ${workspace_title} because it is not running.. level=ERROR + Fail msg=Cannot launch workspace ${workspace_title} because it is not running... END Stop Workspace diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 1eb80be6b..2fbbe7a5b 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -47,6 +47,7 @@ Verify User Can Create A Data Science Project Verify User Can Create And Start A Workspace With Ephimeral Storage [Tags] ODS-1812 + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${EMPTY} wrksp_description=${EMPTY} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} @@ -56,10 +57,11 @@ Verify User Can Create And Start A Workspace With Ephimeral Storage ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} Workspace Should Be Listed workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} - ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} Start Workspace workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_RUNNING} + [Teardown] Close All Browsers Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 @@ -80,9 +82,11 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_3_TITLE} wrksp_description=${WRKSP_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} - ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${FALSE} + ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${TRUE} Workspace Should Be Listed workspace_title=${WRKSP_3_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STOPPED} + # Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STOPPED} + Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STARTING} + Wait Until Workspace Is Started workspace_title=${WRKSP_2_TITLE} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workspace_title=${WRKSP_3_TITLE} namespace=${ns_name} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -100,6 +104,18 @@ Verify User Can Launch A Workspace Switch Window Open Data Hub [Teardown] Close All Browsers +Verify User Can Start And Launch A Workspace From Projects Home Page + [Tags] ODS-1818 + Open Data Science Projects Home Page + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + ${_} ${workspace_cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Start Workspace From Projects Home Page workspace_title=${WRKSP_TITLE} project_title=${PRJ_TITLE} workspace_cr_name=${workspace_cr_name} namespace=${ns_name} + Launch Workspace From Projects Home Page workspace_title=${WRKSP_TITLE} project_title=${PRJ_TITLE} + Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} namespace=${ns_name} + Switch Window Open Data Hub + [Teardown] Close All Browsers + + Verify User Can Stop A Workspace [Tags] ODS-1817 Open Data Science Project Details Page project_title=${PRJ_TITLE} From 6419394b80831267734cacfa031fb79297d521ea Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 24 Oct 2022 16:45:05 +0200 Subject: [PATCH 25/70] adapt code after new UI changes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 8 ++-- .../ODHDataScienceProject/Workspaces.resource | 37 ++++++++++--------- .../415__ods_dashboard_projects.robot | 20 ++++++---- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index bf24a657c..ace84e0ba 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -5,8 +5,10 @@ Resource ./Workspaces.resource *** Variables *** ${DS_PROJECT_XP}= //h1[text()="Data science projects"] -${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] -${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] +${TITLE_INPUT_XP}= xpath=//input[@id="test"] +${DESCR_INPUT_XP}= xpath=//textarea[@id="test"] +# ${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] +# ${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] ${GENERIC_CREATE_BTN_XP}= xpath=//button[text()="Create"] ${GENERIC_CANCEL_BTN_XP}= xpath=//button[text()="Cancel"] ${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project"] @@ -157,7 +159,7 @@ Start Workspace From Projects Home Page Wait Until Workspace Is Started From Projects Home Page workspace_title=${workspace_title} project_title=${project_title} Wait Until Workspace Is Started From Projects Home Page - [Arguments] ${workspace_title} ${project_title} ${timeout}=25s + [Arguments] ${workspace_title} ${project_title} ${timeout}=30s Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} project_title=${project_title} Launch Workspace From Projects Home Page diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index a85455197..464cf11d9 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -5,7 +5,8 @@ Resource Projects.resource *** Variables *** -${WORKSPACE_CREATE_BTN_XP}= xpath=//a[text()="Create data science workspace"] +${WORKSPACE_CREATE_BTN_XP}= xpath=//button[text()="Create data science workspace"] +# ${WORKSPACE_CREATE_BTN_XP}= xpath=//a[text()="Create data science workspace"] ${WRKSP_NAME_INPUT_XP}= xpath=//input[@name="workspace-name"] ${WRKSP_DESCR_TXT_XP}= xpath=//textarea[@name="workspace-description"] ${WRKSP_IMAGE_MENU_BTN_XP}= xpath=//section[@id="notebook-image"]//button[@aria-label="Options menu"] @@ -13,13 +14,13 @@ ${WRKSP_IMAGE_ITEM_BTN_XP}= xpath=//ul[@id="workspace-image-stream-sel ${WRKSP_SIZE_MENU_BTN_XP}= xpath=//section[@id="deployment-size"]//button[@aria-label="Options menu"] ${WRKSP_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button ${WRKSP_STATUS_STOPPED}= Stopped -${WRKSP_STATUS_RUNNING}= Started -${WRKSP_STATUS_STARTING}= Starting +${WRKSP_STATUS_RUNNING}= Running +${WRKSP_STATUS_STARTING}= Starting... ${WRKSP_STOP_BTN_XP}= xpath=//button[text()="Stop workspace"] ${WRKSP_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow -${WRKSP_CREATE_START_BTN_XP}= xpath=//button[text()="Create and launch"] +${WRKSP_CREATE_START_BTN_XP}= xpath=//button[text()="Create and start"] *** Keywords *** @@ -55,21 +56,23 @@ Create Workspace Select Workspace Jupyter Image image_name=${image_name} ## Select Workspace Container Size # to fix, by default Small is already select IF "${storage}" == "Persistent" - Click Element xpath=//input[@name="persistent-storage-type-radio"] + # Click Element xpath=//input[@name="persistent-storage-type-radio"] IF ${pv_existent} == ${TRUE} - Click Element xpath=//input[@name="add-existing-storage-checkbox"] - Wait Until Element Is Enabled xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input - Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input - Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] - Click Element xpath=//ul/li/button[text()="${prj_title}"] + # Click Element xpath=//input[@name="add-existing-storage-checkbox"] + Click Element xpath=//input[@name="persistent-existing-storage-type-radio"] + # Wait Until Element Is Enabled xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input + # Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input + # Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] + # Click Element xpath=//ul/li/button[text()="${prj_title}"] # select PV - function not available yet in the product ELSE IF ${pv_existent} == ${FALSE} - Click Element xpath=//input[@name="create-new-storage-checkbox"] - Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] - Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//input[@name="create-new-storage-name"] ${pv_name} - Wait Until Page Contains Element xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] - Input Text xpath=//div[input[@name="create-new-storage-checkbox"]]//textarea[@name="create-new-storage-description"] ${pv_description} - # Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] + # Click Element xpath=//input[@name="create-new-storage-checkbox"] + Click Element xpath=//input[@name="persistent-new-storage-type-radio"] + Wait Until Page Contains Element xpath=//div[input[@name="persistent-new-storage-type-radio"]]//input[@name="create-new-storage-name"] + Input Text xpath=//div[input[@name="persistent-new-storage-type-radio"]]//input[@name="create-new-storage-name"] ${pv_name} + Wait Until Page Contains Element xpath=//div[input[@name="persistent-new-storage-type-radio"]]//textarea[@name="create-new-storage-description"] + Input Text xpath=//div[input[@name="persistent-new-storage-type-radio"]]//textarea[@name="create-new-storage-description"] ${pv_description} + Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] # Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} ELSE Log msg="pv_existent" argument is required when selected storage type is "Persistent" level=ERROR @@ -114,7 +117,7 @@ Workspace Status Should Be Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[text()="${status}"] Wait Until Workspace Is Started - [Arguments] ${workspace_title} ${timeout}=25s + [Arguments] ${workspace_title} ${timeout}=40s Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} Start Workspace diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 2fbbe7a5b..c2b92b5f5 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -18,13 +18,13 @@ ${NB_IMAGE}= Minimal Python ${WRKSP_TITLE}= ODS-CI Workspace 1 ${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using ${NB_IMAGE} image to test DS Projects feature ${WRKSP_2_TITLE}= ODS-CI Workspace 2 -${WRKSP_2_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAGE} image to test DS Projects feature +${WRKSP_2_DESCRIPTION}= ODS-CI Workspace 2 is a test workspace using ${NB_IMAGE} image to test DS Projects feature ${WRKSP_3_TITLE}= ODS-CI Workspace 2 ${WRKSP_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAGE} image to test DS Projects feature ${PV_NAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB -${PV_SIZE}= 20 +${PV_SIZE}= 1 *** Test Cases *** @@ -79,17 +79,23 @@ Verify User Can Create And Start A Workspace With Existent PV Storage Verify User Can Create And Start A Workspace Adding A New PV Storage [Tags] ODS-1816 + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_3_TITLE} wrksp_description=${WRKSP_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${TRUE} Workspace Should Be Listed workspace_title=${WRKSP_3_TITLE} - # Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STOPPED} - Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STARTING} - Wait Until Workspace Is Started workspace_title=${WRKSP_2_TITLE} - ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Reload Page + Wait Until Project Is Open project_title=${PRJ_TITLE} + Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STARTING} + # the continue on failure should be temporary + Run Keyword And Continue On Failure Wait Until Workspace Is Started workspace_title=${WRKSP_3_TITLE} Check Corresponding Notebook CR Exists workspace_title=${WRKSP_3_TITLE} namespace=${ns_name} - Open Data Science Project Details Page project_title=${PRJ_TITLE} + Reload Page + Wait Until Project Is Open project_title=${PRJ_TITLE} + ${connected_woksps}= Create List ${WRKSP_3_TITLE} + Storage Should Be Listed storage_title=${PV_NAME} storage_description=${PV_DESCRIPTION} + ... storage_type=Persistent storage connected_wrksp=${connected_woksps} Storage Size Should Be title=${PV_NAME} namespace=${ns_name} size=${PV_SIZE} [Teardown] Close All Browsers From b4ba2eddf6854a4bb6630824ec93de2d5fd9a389 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 25 Oct 2022 09:54:59 +0200 Subject: [PATCH 26/70] minor changes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 2 +- .../ODHDataScienceProject/Workspaces.resource | 2 +- .../415__ods_dashboard_projects.robot | 39 ++++++++++--------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index ace84e0ba..09995c74a 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -154,7 +154,7 @@ Start Workspace From Projects Home Page # Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/input[@id="${workspace_cr_name}"] Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/span[@class="pf-c-switch__toggle"] ELSE - Log msg=Cannot start ${workspace_title} workspace because it is not stopped. + Fail msg=Cannot start ${workspace_title} workspace because it is not stopped. END Wait Until Workspace Is Started From Projects Home Page workspace_title=${workspace_title} project_title=${project_title} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 464cf11d9..5a9903c05 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -117,7 +117,7 @@ Workspace Status Should Be Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[text()="${status}"] Wait Until Workspace Is Started - [Arguments] ${workspace_title} ${timeout}=40s + [Arguments] ${workspace_title} ${timeout}=30s Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} Start Workspace diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index c2b92b5f5..d85f8225a 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -33,7 +33,8 @@ Verify User Cannot Create Project Without Title [Setup] Launch Data Science Project Main Page Create Project With Empty Title And Expect Error # add close modal - + [Teardown] Close All Browsers + Verify User Can Create A Data Science Project [Tags] ODS-1775 [Setup] Launch Data Science Project Main Page @@ -44,6 +45,7 @@ Verify User Can Create A Data Science Project Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} + [Teardown] Close All Browsers Verify User Can Create And Start A Workspace With Ephimeral Storage [Tags] ODS-1812 @@ -110,6 +112,14 @@ Verify User Can Launch A Workspace Switch Window Open Data Hub [Teardown] Close All Browsers +Verify User Can Stop A Workspace + [Tags] ODS-1817 + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Stop Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} + Stop Workspace workspace_title=${WRKSP_TITLE} + # add checks on notebook pod is terminated + [Teardown] Close All Browsers + Verify User Can Start And Launch A Workspace From Projects Home Page [Tags] ODS-1818 Open Data Science Projects Home Page @@ -121,23 +131,13 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Switch Window Open Data Hub [Teardown] Close All Browsers - -Verify User Can Stop A Workspace - [Tags] ODS-1817 - Open Data Science Project Details Page project_title=${PRJ_TITLE} - Stop Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} - Stop Workspace workspace_title=${WRKSP_TITLE} - # add checks on notebook pod is terminated - [Teardown] Close All Browsers - - -Verify User Can Delete A Workspace + Verify User Can Delete A Workspace [Tags] ODS-1813 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Delete Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} Delete Workspace workspace_title=${WRKSP_TITLE} - Check Workspace Resources Are Deleted workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Check Workspace CR Is Deleted workspace_title=${WRKSP_TITLE} namespace=${ns_name} [Teardown] Close All Browsers @@ -178,10 +178,11 @@ Check Corresponding Notebook CR Exists Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workspace_title} in ${namespace} NS END -Check Workspace Resources Are Deleted - [Arguments] ${workspace_title} ${namespace} - ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} - IF ${status} == ${TRUE} - Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. - END +Check Workspace CR Is Deleted + [Arguments] ${workspace_title} ${namespace} ${timeout}=10s + Wait Until Keyword Succeeds ${timeout} 2s Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} + # ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} + # IF ${status} == ${TRUE} + # Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. + # END From 47ec0cfc53aab58fa36c89cebf1db9757a00ace4 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 25 Oct 2022 15:37:44 +0200 Subject: [PATCH 27/70] add storage creation testing + test for existing PV Signed-off-by: bdattoma --- .../ODHDataScienceProject/Workspaces.resource | 41 +++++-------------- .../415__ods_dashboard_projects.robot | 39 +++++++++++------- 2 files changed, 34 insertions(+), 46 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index 5a9903c05..b7de607c3 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -24,26 +24,9 @@ ${WRKSP_CREATE_START_BTN_XP}= xpath=//button[text()="Create and start"] *** Keywords *** -Create Workspace v1 - [Documentation] Creates a new workspace in a Data Science project. It assumes - ... the DS Project details page is open - [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small - Click Element ${WORKSPACE_CREATE_BTN_XP} - Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} - Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} - Input Text ${WRKSP_NAME_INPUT_XP} ${name} - Input Text ${WRKSP_DESCR_TXT_XP} ${description} - Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} - Select Workspace Jupyter Image image_name=${image_name} - ## Select Workspace Container Size # to fix, by default Small is already select - Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} - Click Button ${GENERIC_CREATE_BTN_XP} - Wait Until Modal Disappears - Create Workspace [Documentation] Creates a new workspace in a Data Science project. It assumes ... the DS Project deta - # [Arguments] ${name} ${description}=${EMPTY} ${image_name}=Minimal Python ${size}=Small [Arguments] ${wrksp_title} ${wrksp_description} ${prj_title} ${image_name} ${deployment_size} ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${start}=${FALSE} ... ${press_cancel}=${FALSE} @@ -56,24 +39,12 @@ Create Workspace Select Workspace Jupyter Image image_name=${image_name} ## Select Workspace Container Size # to fix, by default Small is already select IF "${storage}" == "Persistent" - # Click Element xpath=//input[@name="persistent-storage-type-radio"] IF ${pv_existent} == ${TRUE} - # Click Element xpath=//input[@name="add-existing-storage-checkbox"] Click Element xpath=//input[@name="persistent-existing-storage-type-radio"] - # Wait Until Element Is Enabled xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input - # Click Element xpath=//div[input[@name="add-existing-storage-checkbox"]]//div[@class="pf-c-form__group"]/div[@class="pf-c-form__group-control"]/div/div/div/input - # Wait Until Page Contains Element xpath=//ul/li/button[text()="${prj_title}"] - # Click Element xpath=//ul/li/button[text()="${prj_title}"] - # select PV - function not available yet in the product + Select An Existent PV name=${pv_name} ELSE IF ${pv_existent} == ${FALSE} - # Click Element xpath=//input[@name="create-new-storage-checkbox"] Click Element xpath=//input[@name="persistent-new-storage-type-radio"] - Wait Until Page Contains Element xpath=//div[input[@name="persistent-new-storage-type-radio"]]//input[@name="create-new-storage-name"] - Input Text xpath=//div[input[@name="persistent-new-storage-type-radio"]]//input[@name="create-new-storage-name"] ${pv_name} - Wait Until Page Contains Element xpath=//div[input[@name="persistent-new-storage-type-radio"]]//textarea[@name="create-new-storage-description"] - Input Text xpath=//div[input[@name="persistent-new-storage-type-radio"]]//textarea[@name="create-new-storage-description"] ${pv_description} - Clear Element Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] - # Input Text xpath=//div[@name="create-new-storage-size"]/div/input[@aria-label="Input"] ${pv_size} + Fill In New PV Data name=${pv_name} description=${pv_description} size=${pv_size} ELSE Log msg="pv_existent" argument is required when selected storage type is "Persistent" level=ERROR END @@ -94,6 +65,14 @@ Create Workspace Wait Until Modal Disappears Wait Until Project Is Open project_title=${prj_title} +Select An Existent PV + [Arguments] ${name} + Run Keyword And Continue On Failure Wait Until Element Is Enabled xpath=//input[@placeholder="Select a persistent storage"] + Click Element xpath=//input[@placeholder="Select a persistent storage"] + Wait Until Page Contains Element xpath=//ul/li/button[text()="${name}"] + Wait Until Page Contains Element xpath=//div[contains(@class,"pf-c-select")]/ul/li/button[text()="${name}"] + Click Element xpath=//ul/li/button[text()="${name}"] + Select Workspace Jupyter Image [Arguments] ${image_name} Wait Until Page Contains Element ${WRKSP_IMAGE_MENU_BTN_XP} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index d85f8225a..db809ff2a 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -7,6 +7,7 @@ Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProjec Suite Setup Project Suite Setup # Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page +Test Teardown Close All Browsers *** Variables *** @@ -21,7 +22,7 @@ ${WRKSP_2_TITLE}= ODS-CI Workspace 2 ${WRKSP_2_DESCRIPTION}= ODS-CI Workspace 2 is a test workspace using ${NB_IMAGE} image to test DS Projects feature ${WRKSP_3_TITLE}= ODS-CI Workspace 2 ${WRKSP_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAGE} image to test DS Projects feature -${PV_NAME}= ods-ci-pv +${PV_BASENAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB ${PV_SIZE}= 1 @@ -33,7 +34,6 @@ Verify User Cannot Create Project Without Title [Setup] Launch Data Science Project Main Page Create Project With Empty Title And Expect Error # add close modal - [Teardown] Close All Browsers Verify User Can Create A Data Science Project [Tags] ODS-1775 @@ -45,7 +45,6 @@ Verify User Can Create A Data Science Project Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} - [Teardown] Close All Browsers Verify User Can Create And Start A Workspace With Ephimeral Storage [Tags] ODS-1812 @@ -63,21 +62,36 @@ Verify User Can Create And Start A Workspace With Ephimeral Storage Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} Start Workspace workspace_title=${WRKSP_TITLE} Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_RUNNING} - [Teardown] Close All Browsers + +Verify User Can Create A PV Storage + [Tags] ODS-1819 + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + ${workspaces}= Create Dictionary ${WRKSP_TITLE}=mount-data + Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} + ... size=${PV_SIZE} connected_wrksp=${NONE} press_cancel=${TRUE} + Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} + ... size=${PV_SIZE} connected_wrksp=${workspaces} + Storage Should Be Listed name=${PV_BASENAME}-A description=${PV_DESCRIPTION} + ... type=Persistent storage connected_wrksp=${workspaces} + Storage Size Should Be name=${PV_BASENAME}-A namespace=${ns_name} size=${PV_SIZE} + + Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create PersistenVolume Storage name=${PV_BASENAME}-existent description=${PV_DESCRIPTION} + ... size=${PV_SIZE} connected_wrksp=${NONE} Create Workspace wrksp_title=${WRKSP_2_TITLE} wrksp_description=${WRKSP_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} - ... pv_name=${PV_NAME} pv_description=${NONE} pv_size=${NONE} start=${TRUE} + ... pv_name=${PV_BASENAME}-existent pv_description=${NONE} pv_size=${NONE} start=${TRUE} Workspace Should Be Listed workspace_title=${WRKSP_2_TITLE} Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STARTING} Wait Until Workspace Is Started workspace_title=${WRKSP_2_TITLE} # Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workspace_title=${WRKSP_2_TITLE} namespace=${ns_name} - [Teardown] Close All Browsers Verify User Can Create And Start A Workspace Adding A New PV Storage [Tags] ODS-1816 @@ -85,7 +99,7 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_3_TITLE} wrksp_description=${WRKSP_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} - ... pv_name=${PV_NAME} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${TRUE} + ... pv_name=${PV_BASENAME}-new pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${TRUE} Workspace Should Be Listed workspace_title=${WRKSP_3_TITLE} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} @@ -96,10 +110,9 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} ${connected_woksps}= Create List ${WRKSP_3_TITLE} - Storage Should Be Listed storage_title=${PV_NAME} storage_description=${PV_DESCRIPTION} - ... storage_type=Persistent storage connected_wrksp=${connected_woksps} - Storage Size Should Be title=${PV_NAME} namespace=${ns_name} size=${PV_SIZE} - [Teardown] Close All Browsers + Storage Should Be Listed name=${PV_BASENAME}-new description=${PV_DESCRIPTION} + ... type=Persistent storage connected_wrksp=${connected_woksps} + Storage Size Should Be name=${PV_BASENAME}-new namespace=${ns_name} size=${PV_SIZE} Verify User Can Launch A Workspace [Tags] ODS-1815 @@ -110,7 +123,6 @@ Verify User Can Launch A Workspace Launch Workspace workspace_title=${WRKSP_TITLE} Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub - [Teardown] Close All Browsers Verify User Can Stop A Workspace [Tags] ODS-1817 @@ -118,7 +130,6 @@ Verify User Can Stop A Workspace Stop Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} Stop Workspace workspace_title=${WRKSP_TITLE} # add checks on notebook pod is terminated - [Teardown] Close All Browsers Verify User Can Start And Launch A Workspace From Projects Home Page [Tags] ODS-1818 @@ -129,7 +140,6 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Launch Workspace From Projects Home Page workspace_title=${WRKSP_TITLE} project_title=${PRJ_TITLE} Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub - [Teardown] Close All Browsers Verify User Can Delete A Workspace [Tags] ODS-1813 @@ -138,7 +148,6 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Delete Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} Delete Workspace workspace_title=${WRKSP_TITLE} Check Workspace CR Is Deleted workspace_title=${WRKSP_TITLE} namespace=${ns_name} - [Teardown] Close All Browsers Verify User Can Delete A Data Science Project From 6948108df3fac88713a1c6b098ec9c110c2326e0 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 25 Oct 2022 16:23:57 +0200 Subject: [PATCH 28/70] add missing resource file for storage Signed-off-by: bdattoma --- .../ODHDataScienceProject/Storage.resource | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource new file mode 100644 index 000000000..eef322d1b --- /dev/null +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource @@ -0,0 +1,81 @@ +*** Settings *** +Resource ../../../../Page/Components/Components.resource +Resource ../../../../Common.robot +Resource Projects.resource + + +*** Variables *** +${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"] +${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"] +${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] +${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"] +${STORAGE_WRKSP_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li +${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="storages"]]/div/button[text()="Add storage"] +${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add")] + +*** Keywords *** +Storage Should Be Listed + [Arguments] ${name} ${description} ${type} ${connected_wrksp} + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${name}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/p[text()="${description}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/p[text()=" ${type}"] + IF "${connected_wrksp}" == "${NONE}" + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] + ELSE + FOR ${index} ${wrksp_title} IN ENUMERATE @{connected_wrksp} + Log ${index}: ${wrksp_title} + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${wrksp_title}"] + END + END + +Storage Size Should Be + [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ + [Arguments] ${name} ${size} ${namespace} + Click Element xpath=//tr[td/h4[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] + Wait Until Element Is Visible xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"] + Wait Until Page Contains Element xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] + ${displayed_size}= Get Text xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] + Run keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi + ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].spec.resources.requests.storage}' + Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi + ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.capacity.storage}' + Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi + +Create PersistenVolume Storage + [Arguments] ${name} ${description} ${size} ${connected_wrksp}=${NONE} ${press_cancel}=${FALSE} + Click Button ${STORAGE_ADD_BTN_1_XP} + Fill In New PV Data ${name} ${description} ${size} ${connected_wrksp} + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} + Click Button ${STORAGE_ADD_BTN_2_XP} + END + Wait Until Modal Disappears + Wait Until Project Is Open project_title=${prj_title} + +Fill In New PV Data + [Arguments] ${name} ${description} ${size} ${connected_wrksp}=${NONE} + Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} + Input Text ${STORAGE_NAME_INPUT_XP} ${name} + Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} + Input Text ${STORAGE_DESCR_INPUT_XP} ${description} + Clear Element Text ${STORAGE_SIZE_INPUT_XP} + IF "${connected_wrksp}" == "${NONE}" + Log msg=you are not connecting any workspaces to ${name} PV + ELSE + Run Keyword And Continue On Failure Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] + FOR ${wrksp_title} IN @{connected_wrksp} + ${mount_dir}= Set Variable ${connected_wrksp}[${wrksp_title}] + Set Connection Between PV And Workspace ${wrksp_title} ${mount_dir} + END + END + +Set Connection Between PV And Workspace + [Arguments] ${wrksp_title} ${mount_dir} + Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"] + Click Element xpath=//button[@aria-label="Options menu"] + Wait Until Page Contains Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] + Click Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] + Wait Until Page Contains Element ${STORAGE_MOUNT_DIR_INPUT_XP} + Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} From ff202398495a7f57a302d5ee7b61401c62745f5c Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 25 Oct 2022 16:45:16 +0200 Subject: [PATCH 29/70] add pv size gt 1 Signed-off-by: bdattoma --- .../ODH/ODHDashboard/ODHDataScienceProject/Storage.resource | 6 ++++++ .../415__ods_dashboard_projects.robot | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource index eef322d1b..b27414f36 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource @@ -8,6 +8,7 @@ Resource Projects.resource ${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"] ${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"] ${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] +${STORAGE_SIZE_PLUS_BTN_XP}= xpath=//div/button[@aria-label="Plus"] ${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"] ${STORAGE_WRKSP_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li ${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="storages"]]/div/button[text()="Add storage"] @@ -61,6 +62,11 @@ Fill In New PV Data Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} Input Text ${STORAGE_DESCR_INPUT_XP} ${description} Clear Element Text ${STORAGE_SIZE_INPUT_XP} + IF ${size} > 1 + FOR ${counter} IN RANGE 1 ${size} + Click Element ${STORAGE_SIZE_PLUS_BTN_XP} + END + END IF "${connected_wrksp}" == "${NONE}" Log msg=you are not connecting any workspaces to ${name} PV ELSE diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index db809ff2a..281386cb7 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -25,7 +25,7 @@ ${WRKSP_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAG ${PV_BASENAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB -${PV_SIZE}= 1 +${PV_SIZE}= 2 *** Test Cases *** From 9e147bde602886673bb4484f99d3e74ef91eaad5 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 25 Oct 2022 18:16:29 +0200 Subject: [PATCH 30/70] add data connection resources + minore fixes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Storage.resource | 87 ------------------- .../415__ods_dashboard_projects.robot | 12 ++- 2 files changed, 8 insertions(+), 91 deletions(-) delete mode 100644 tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource deleted file mode 100644 index b27414f36..000000000 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource +++ /dev/null @@ -1,87 +0,0 @@ -*** Settings *** -Resource ../../../../Page/Components/Components.resource -Resource ../../../../Common.robot -Resource Projects.resource - - -*** Variables *** -${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"] -${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"] -${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] -${STORAGE_SIZE_PLUS_BTN_XP}= xpath=//div/button[@aria-label="Plus"] -${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"] -${STORAGE_WRKSP_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li -${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="storages"]]/div/button[text()="Add storage"] -${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add")] - -*** Keywords *** -Storage Should Be Listed - [Arguments] ${name} ${description} ${type} ${connected_wrksp} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${name}"] - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/p[text()="${description}"] - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/p[text()=" ${type}"] - IF "${connected_wrksp}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] - ELSE - FOR ${index} ${wrksp_title} IN ENUMERATE @{connected_wrksp} - Log ${index}: ${wrksp_title} - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${wrksp_title}"] - END - END - -Storage Size Should Be - [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ - [Arguments] ${name} ${size} ${namespace} - Click Element xpath=//tr[td/h4[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] - Wait Until Element Is Visible xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"] - Wait Until Page Contains Element xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] - ${displayed_size}= Get Text xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] - Run keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi - ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].spec.resources.requests.storage}' - Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi - ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.capacity.storage}' - Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi - -Create PersistenVolume Storage - [Arguments] ${name} ${description} ${size} ${connected_wrksp}=${NONE} ${press_cancel}=${FALSE} - Click Button ${STORAGE_ADD_BTN_1_XP} - Fill In New PV Data ${name} ${description} ${size} ${connected_wrksp} - IF ${press_cancel} == ${TRUE} - Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE - Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} - Click Button ${STORAGE_ADD_BTN_2_XP} - END - Wait Until Modal Disappears - Wait Until Project Is Open project_title=${prj_title} - -Fill In New PV Data - [Arguments] ${name} ${description} ${size} ${connected_wrksp}=${NONE} - Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} - Input Text ${STORAGE_NAME_INPUT_XP} ${name} - Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} - Input Text ${STORAGE_DESCR_INPUT_XP} ${description} - Clear Element Text ${STORAGE_SIZE_INPUT_XP} - IF ${size} > 1 - FOR ${counter} IN RANGE 1 ${size} - Click Element ${STORAGE_SIZE_PLUS_BTN_XP} - END - END - IF "${connected_wrksp}" == "${NONE}" - Log msg=you are not connecting any workspaces to ${name} PV - ELSE - Run Keyword And Continue On Failure Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] - FOR ${wrksp_title} IN @{connected_wrksp} - ${mount_dir}= Set Variable ${connected_wrksp}[${wrksp_title}] - Set Connection Between PV And Workspace ${wrksp_title} ${mount_dir} - END - END - -Set Connection Between PV And Workspace - [Arguments] ${wrksp_title} ${mount_dir} - Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"] - Click Element xpath=//button[@aria-label="Options menu"] - Wait Until Page Contains Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] - Click Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] - Wait Until Page Contains Element ${STORAGE_MOUNT_DIR_INPUT_XP} - Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 281386cb7..88aed2bc5 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -3,7 +3,7 @@ Library SeleniumLibrary Library OpenShiftLibrary Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource -Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storage.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource Suite Setup Project Suite Setup # Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page @@ -69,9 +69,9 @@ Verify User Can Create A PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} ${workspaces}= Create Dictionary ${WRKSP_TITLE}=mount-data Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_wrksp=${NONE} press_cancel=${TRUE} + ... size=${PV_SIZE} connected_wrksp=${NONE} press_cancel=${TRUE} project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_wrksp=${workspaces} + ... size=${PV_SIZE} connected_wrksp=${workspaces} project_title=${PRJ_TITLE} Storage Should Be Listed name=${PV_BASENAME}-A description=${PV_DESCRIPTION} ... type=Persistent storage connected_wrksp=${workspaces} Storage Size Should Be name=${PV_BASENAME}-A namespace=${ns_name} size=${PV_SIZE} @@ -82,7 +82,7 @@ Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${PV_BASENAME}-existent description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_wrksp=${NONE} + ... size=${PV_SIZE} connected_wrksp=${NONE} project_title=${PRJ_TITLE} Create Workspace wrksp_title=${WRKSP_2_TITLE} wrksp_description=${WRKSP_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} ... pv_name=${PV_BASENAME}-existent pv_description=${NONE} pv_size=${NONE} start=${TRUE} @@ -149,6 +149,10 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Delete Workspace workspace_title=${WRKSP_TITLE} Check Workspace CR Is Deleted workspace_title=${WRKSP_TITLE} namespace=${ns_name} +Verify User Cand Add A S3 Data Connection + [Tags] ODS-Z + # Create S3 Data Connection + # check secret creation Verify User Can Delete A Data Science Project [Tags] ODS-1784 From 0840cc832a288445f1125e61b7f0bc3275f511d3 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 26 Oct 2022 17:33:34 +0200 Subject: [PATCH 31/70] add data connection first test Signed-off-by: bdattoma --- .../DataConnections.resource | 53 +++++++++++++++++++ .../415__ods_dashboard_projects.robot | 14 ++++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource new file mode 100644 index 000000000..54275cd8b --- /dev/null +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -0,0 +1,53 @@ +*** Settings *** +Resource ../../../../Page/Components/Components.resource +Resource ../../../../Common.robot +Resource Projects.resource + + +*** Variables *** +${S3_NAME_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field Name"] +${S3_KEY_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_ACCESS_KEY_ID"] +${S3_SECRET_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_SECRET_ACCESS_KEY"] +${S3_ENDPOINT_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_S3_ENDPOINT"] +${S3_REGION_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_DEFAULT_REGION"] +${DC_SECTION_XP}= xpath=//div[div//h4[@id="data-connections"]] +${DC_ADD_BTN_1_XP}= ${DC_SECTION_XP}/div/button[text()="Add data connection"] +${DC_ADD_BTN_2_XP}= xpath=//footer/button[text()="Add data connection"] + + +*** Keywords *** +Create S3 Data Connection + [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${aws_s3_endpoint} ${aws_region} ${connected_wrksp}=${NONE} ${press_cancel}=${FALSE} + Click Button ${DC_ADD_BTN_1_XP} + Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} + Input Text ${S3_NAME_DC_INPUT_XP} ${dc_name} + Input Text ${S3_KEY_DC_INPUT_XP} ${aws_access_key} + Input Text ${S3_SECRET_DC_INPUT_XP} ${aws_secret_access} + Input Text ${S3_ENDPOINT_DC_INPUT_XP} ${aws_s3_endpoint} + Input Text ${S3_REGION_DC_INPUT_XP} ${aws_region} + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} + Click Button ${STORAGE_ADD_BTN_2_XP} + END + Wait Until Modal Disappears + Wait Until Project Is Open project_title=${project_title} + +Data Connection Should Be Listed + [Arguments] ${name} ${type} ${connected_wrksp} + Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td/h4[text()="${name}"] + Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[text()=" ${type}"] + IF "${connected_wrksp}" == "${NONE}" + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[text()="No connections"] + ELSE + FOR ${index} ${wrksp_title} IN ENUMERATE @{connected_wrksp} + Log ${index}: ${wrksp_title} + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${wrksp_title}"] + END + END + +Get Openshift Secret From Data Connection + [Arguments] ${dc_name} ${namespace} + ${rc} ${secret_name}= Run And Return Rc And Output oc get secret -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${dc_name}")].metadata.name}' + [Return] ${rc} ${secret_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 88aed2bc5..57bad13ca 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -4,6 +4,7 @@ Library OpenShiftLibrary Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource Suite Setup Project Suite Setup # Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page @@ -152,7 +153,12 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Verify User Cand Add A S3 Data Connection [Tags] ODS-Z # Create S3 Data Connection - # check secret creation + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=S3-test aws_access_key=access-key-test + ... aws_secret_access=secret-access aws_s3_endpoint=s3-endpoint-test aws_region=us-test-region + Data Connection Should Be Listed name=S3-test type=Object storage connected_wrksp=${NONE} + Check Corresponding Data Connection Secret Exists dc_name=S3-test namespace=${ns_name} Verify User Can Delete A Data Science Project [Tags] ODS-1784 @@ -199,3 +205,9 @@ Check Workspace CR Is Deleted # Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. # END +Check Corresponding Data Connection Secret Exists + [Arguments] ${dc_name} ${namespace} + ${res} ${response}= Get Openshift Secret From Data Connection dc_name=${dc_name} namespace=${namespace} + IF "${response}" == "${EMPTY}" + Run Keyword And Continue On Failure Fail msg=Secret not found for ${dc_name} in ${namespace} NS + END \ No newline at end of file From df7524dfca4161bc0c3a0ef4de17d1a20afb16af Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 26 Oct 2022 17:34:19 +0200 Subject: [PATCH 32/70] add missing storages file Signed-off-by: bdattoma --- .../ODHDataScienceProject/Storages.resource | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource new file mode 100644 index 000000000..b053b76e4 --- /dev/null +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -0,0 +1,87 @@ +*** Settings *** +Resource ../../../../Page/Components/Components.resource +Resource ../../../../Common.robot +Resource Projects.resource + + +*** Variables *** +${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"] +${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"] +${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] +${STORAGE_SIZE_PLUS_BTN_XP}= xpath=//div/button[@aria-label="Plus"] +${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"] +${STORAGE_WRKSP_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li +${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="storages"]]/div/button[text()="Add storage"] +${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add")] + +*** Keywords *** +Storage Should Be Listed + [Arguments] ${name} ${description} ${type} ${connected_wrksp} + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${name}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/p[text()="${description}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/p[text()=" ${type}"] + IF "${connected_wrksp}" == "${NONE}" + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] + ELSE + FOR ${index} ${wrksp_title} IN ENUMERATE @{connected_wrksp} + Log ${index}: ${wrksp_title} + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${wrksp_title}"] + END + END + +Storage Size Should Be + [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ + [Arguments] ${name} ${size} ${namespace} + Click Element xpath=//tr[td/h4[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] + Wait Until Element Is Visible xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"] + Wait Until Page Contains Element xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] + ${displayed_size}= Get Text xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] + Run keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi + ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].spec.resources.requests.storage}' + Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi + ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.capacity.storage}' + Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi + +Create PersistenVolume Storage + [Arguments] ${project_title} ${name} ${description} ${size} ${connected_wrksp}=${NONE} ${press_cancel}=${FALSE} + Click Button ${STORAGE_ADD_BTN_1_XP} + Fill In New PV Data ${name} ${description} ${size} ${connected_wrksp} + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} + Click Button ${STORAGE_ADD_BTN_2_XP} + END + Wait Until Modal Disappears + Wait Until Project Is Open project_title=${project_title} + +Fill In New PV Data + [Arguments] ${name} ${description} ${size} ${connected_wrksp}=${NONE} + Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} + Input Text ${STORAGE_NAME_INPUT_XP} ${name} + Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} + Input Text ${STORAGE_DESCR_INPUT_XP} ${description} + Clear Element Text ${STORAGE_SIZE_INPUT_XP} + IF ${size} > 1 + FOR ${counter} IN RANGE 1 ${size} + Click Element ${STORAGE_SIZE_PLUS_BTN_XP} + END + END + IF "${connected_wrksp}" == "${NONE}" + Log msg=you are not connecting any workspaces to ${name} PV + ELSE + Run Keyword And Continue On Failure Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] + FOR ${wrksp_title} IN @{connected_wrksp} + ${mount_dir}= Set Variable ${connected_wrksp}[${wrksp_title}] + Set Connection Between PV And Workspace ${wrksp_title} ${mount_dir} + END + END + +Set Connection Between PV And Workspace + [Arguments] ${wrksp_title} ${mount_dir} + Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"] + Click Element xpath=//button[@aria-label="Options menu"] + Wait Until Page Contains Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] + Click Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] + Wait Until Page Contains Element ${STORAGE_MOUNT_DIR_INPUT_XP} + Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} From e9a49819a0de80bda547de7b60b4d5c9ce1ee0e9 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 26 Oct 2022 19:05:29 +0200 Subject: [PATCH 33/70] add deletions Signed-off-by: bdattoma --- .../DataConnections.resource | 16 ++++++++ .../ODHDataScienceProject/Storages.resource | 15 +++++++ .../ODHDataScienceProject/Workspaces.resource | 2 +- .../415__ods_dashboard_projects.robot | 40 +++++++++++++------ 4 files changed, 60 insertions(+), 13 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 54275cd8b..f53cb735b 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -13,6 +13,7 @@ ${S3_REGION_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_DEFA ${DC_SECTION_XP}= xpath=//div[div//h4[@id="data-connections"]] ${DC_ADD_BTN_1_XP}= ${DC_SECTION_XP}/div/button[text()="Add data connection"] ${DC_ADD_BTN_2_XP}= xpath=//footer/button[text()="Add data connection"] +${DC_DELETE_BTN_XP}= xpath=//button[text()="Delete data connection"] *** Keywords *** @@ -51,3 +52,18 @@ Get Openshift Secret From Data Connection [Arguments] ${dc_name} ${namespace} ${rc} ${secret_name}= Run And Return Rc And Output oc get secret -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${dc_name}")].metadata.name}' [Return] ${rc} ${secret_name} + +Delete Data Connection + [Arguments] ${name} ${press_cancel}=${FALSE} + Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] + Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] + Wait Until Modal Appears + Run Keyword And Continue On Failure Page Should Contain Confirm data connection delete + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Click Button ${DC_DELETE_BTN_XP} + END + Wait Until Modal Disappears \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index b053b76e4..b952ceede 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -85,3 +85,18 @@ Set Connection Between PV And Workspace Click Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] Wait Until Page Contains Element ${STORAGE_MOUNT_DIR_INPUT_XP} Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} + +Delete Storage + [Arguments] ${name} ${press_cancel}=${FALSE} + Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] + Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] + Wait Until Modal Appears + Run Keyword And Continue On Failure Page Should Contain Confirm storage delete + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Click Button ${WRKSP_DELETE_BTN_XP} + END + Wait Until Modal Disappears \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource index b7de607c3..5bcaf76a0 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource @@ -164,7 +164,7 @@ Delete Workspace ELSE Click Button ${WRKSP_DELETE_BTN_XP} END - + Wait Until Modal Disappears Check Launched Workspace Is The Correct One [Arguments] ${workspace_title} ${image} ${namespace} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 57bad13ca..7089422cd 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -14,8 +14,6 @@ Test Teardown Close All Browsers *** Variables *** ${PRJ_TITLE}= ODS-CI DS Project ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature -# ${PRJ_TITLE_2}= ODS-CI DS Project 2 -# ${PRJ_DESCRIPTION_2}= ODS-CI DS Project 2 is a test for validating DSG feature ${NB_IMAGE}= Minimal Python ${WRKSP_TITLE}= ODS-CI Workspace 1 ${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using ${NB_IMAGE} image to test DS Projects feature @@ -27,6 +25,10 @@ ${PV_BASENAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB ${PV_SIZE}= 2 +${DC_S3_NAME}= ods-ci-s3 +${DC_S3_ENDPOINT}= custom.endpoint.s3.com +${DC_S3_REGION}= ods-ci-region +${DC_S3_TYPE}= Object storage *** Test Cases *** @@ -152,13 +154,20 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Verify User Cand Add A S3 Data Connection [Tags] ODS-Z - # Create S3 Data Connection ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=S3-test aws_access_key=access-key-test - ... aws_secret_access=secret-access aws_s3_endpoint=s3-endpoint-test aws_region=us-test-region - Data Connection Should Be Listed name=S3-test type=Object storage connected_wrksp=${NONE} - Check Corresponding Data Connection Secret Exists dc_name=S3-test namespace=${ns_name} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${AWS_ACCESS_KEY_ID} + ... aws_secret_access=${AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} + Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_wrksp=${NONE} + Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} + +Verify User Can Delete A Data Connection + [Tags] ODS-ZY + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Delete Data Connection name=${DC_S3_NAME} press_cancel=${True} + Delete Data Connection name=${DC_S3_NAME} + Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Delete A Data Science Project [Tags] ODS-1784 @@ -200,14 +209,21 @@ Check Corresponding Notebook CR Exists Check Workspace CR Is Deleted [Arguments] ${workspace_title} ${namespace} ${timeout}=10s Wait Until Keyword Succeeds ${timeout} 2s Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} - # ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} - # IF ${status} == ${TRUE} - # Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. - # END + ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} + IF ${status} == ${TRUE} + Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. + END Check Corresponding Data Connection Secret Exists [Arguments] ${dc_name} ${namespace} ${res} ${response}= Get Openshift Secret From Data Connection dc_name=${dc_name} namespace=${namespace} IF "${response}" == "${EMPTY}" Run Keyword And Continue On Failure Fail msg=Secret not found for ${dc_name} in ${namespace} NS - END \ No newline at end of file + END + +Check Data Connection Secret Is Deleted + [Arguments] ${dc_name} ${namespace} ${timeout}=10s + ${status}= Run Keyword And Return Status Check Corresponding Data Connection Secret Exists dc_name=${dc_name} namespace=${namespace} + IF ${status} == ${TRUE} + Fail msg=The secret for ${dc_name} data connection is still present, while it should have been deleted. + END From ff2aef923e45f656ea7c9e7265c3b4aff9e3f40f Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 27 Oct 2022 15:59:27 +0200 Subject: [PATCH 34/70] migrate from workspaces to workbenches Signed-off-by: bdattoma --- .../DataConnections.resource | 12 +- .../ODHDataScienceProject/Projects.resource | 40 +++--- .../ODHDataScienceProject/Storages.resource | 40 +++--- ...rkspaces.resource => Workbenches.resource} | 127 +++++++++--------- .../415__ods_dashboard_projects.robot | 106 +++++++-------- 5 files changed, 162 insertions(+), 163 deletions(-) rename tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/{Workspaces.resource => Workbenches.resource} (58%) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index f53cb735b..fdfca1133 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -18,7 +18,7 @@ ${DC_DELETE_BTN_XP}= xpath=//button[text()="Delete data connecti *** Keywords *** Create S3 Data Connection - [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${aws_s3_endpoint} ${aws_region} ${connected_wrksp}=${NONE} ${press_cancel}=${FALSE} + [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${aws_s3_endpoint} ${aws_region} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} Click Button ${DC_ADD_BTN_1_XP} Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} Input Text ${S3_NAME_DC_INPUT_XP} ${dc_name} @@ -36,15 +36,15 @@ Create S3 Data Connection Wait Until Project Is Open project_title=${project_title} Data Connection Should Be Listed - [Arguments] ${name} ${type} ${connected_wrksp} + [Arguments] ${name} ${type} ${connected_workbench} Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td/h4[text()="${name}"] Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[text()=" ${type}"] - IF "${connected_wrksp}" == "${NONE}" + IF "${connected_workbench}" == "${NONE}" Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[text()="No connections"] ELSE - FOR ${index} ${wrksp_title} IN ENUMERATE @{connected_wrksp} - Log ${index}: ${wrksp_title} - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${wrksp_title}"] + FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} + Log ${index}: ${workbench_title} + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${workbench_title}"] END END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 09995c74a..d129bac9c 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -133,42 +133,42 @@ Delete All Data Science Projects From CLI END Workspace Status Should Be From Projects Home Page - [Arguments] ${workspace_title} ${status} ${project_title} + [Arguments] ${workbench_title} ${status} ${project_title} ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} - ${_} ${workspace_cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/span[text()="${status}"] + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[text()="${status}"] Start Workspace From Projects Home Page - [Documentation] Trigger the workspace "start" process from DS Projects home page. - ... It needs ${workspace_title} and ${project_title} at least. If ${namespace} and/or - ... ${workspace_cr_name} are given too, the kw spares one or two calls to openshift API server - [Arguments] ${workspace_title} ${project_title} ${namespace}=${EMPTY} ${workspace_cr_name}=${EMPTY} - ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_STOPPED} project_title=${project_title} + [Documentation] Trigger the workbench "start" process from DS Projects home page. + ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or + ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server + [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} + ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} IF ${is_stopped} == ${TRUE} - IF "${workspace_cr_name}" == "${EMPTY}" + IF "${workbench_cr_name}" == "${EMPTY}" IF "${namespace}" == "${EMPTY}" ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} END - ${_} ${workspace_cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} END - # Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/input[@id="${workspace_cr_name}"] - Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workspace_cr_name}"]/span[@class="pf-c-switch__toggle"] + # Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/input[@id="${workbench_cr_name}"] + Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] ELSE - Fail msg=Cannot start ${workspace_title} workspace because it is not stopped. + Fail msg=Cannot start ${workbench_title} workbench because it is not stopped. END - Wait Until Workspace Is Started From Projects Home Page workspace_title=${workspace_title} project_title=${project_title} + Wait Until Workspace Is Started From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} Wait Until Workspace Is Started From Projects Home Page - [Arguments] ${workspace_title} ${project_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} project_title=${project_title} + [Arguments] ${workbench_title} ${project_title} ${timeout}=30s + Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} Launch Workspace From Projects Home Page - [Arguments] ${workspace_title} ${project_title} + [Arguments] ${workbench_title} ${project_title} Open Data Science Projects Home Page - ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} project_title=${project_title} + ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} - Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workspace_title}"] + Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] Access To Workspace ELSE - Fail msg=Cannot launch workspace ${workspace_title} because it is not running... + Fail msg=Cannot launch workbench ${workbench_title} because it is not running... END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index b952ceede..0bea40ee0 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -10,22 +10,22 @@ ${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-de ${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] ${STORAGE_SIZE_PLUS_BTN_XP}= xpath=//div/button[@aria-label="Plus"] ${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"] -${STORAGE_WRKSP_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li +${STORAGE_WORKBENCH_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li ${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="storages"]]/div/button[text()="Add storage"] ${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add")] *** Keywords *** Storage Should Be Listed - [Arguments] ${name} ${description} ${type} ${connected_wrksp} + [Arguments] ${name} ${description} ${type} ${connected_workbench} Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${name}"] Run keyword And Continue On Failure Page Should Contain Element xpath=//td/p[text()="${description}"] Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/p[text()=" ${type}"] - IF "${connected_wrksp}" == "${NONE}" + IF "${connected_workbench}" == "${NONE}" Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] ELSE - FOR ${index} ${wrksp_title} IN ENUMERATE @{connected_wrksp} - Log ${index}: ${wrksp_title} - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${wrksp_title}"] + FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} + Log ${index}: ${workbench_title} + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${workbench_title}"] END END @@ -43,9 +43,9 @@ Storage Size Should Be Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi Create PersistenVolume Storage - [Arguments] ${project_title} ${name} ${description} ${size} ${connected_wrksp}=${NONE} ${press_cancel}=${FALSE} + [Arguments] ${project_title} ${name} ${description} ${size} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} Click Button ${STORAGE_ADD_BTN_1_XP} - Fill In New PV Data ${name} ${description} ${size} ${connected_wrksp} + Fill In New PV Data ${name} ${description} ${size} ${connected_workbench} IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE @@ -56,7 +56,7 @@ Create PersistenVolume Storage Wait Until Project Is Open project_title=${project_title} Fill In New PV Data - [Arguments] ${name} ${description} ${size} ${connected_wrksp}=${NONE} + [Arguments] ${name} ${description} ${size} ${connected_workbench}=${NONE} Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} Input Text ${STORAGE_NAME_INPUT_XP} ${name} Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} @@ -67,36 +67,36 @@ Fill In New PV Data Click Element ${STORAGE_SIZE_PLUS_BTN_XP} END END - IF "${connected_wrksp}" == "${NONE}" - Log msg=you are not connecting any workspaces to ${name} PV + IF "${connected_workbench}" == "${NONE}" + Log msg=you are not connecting any workbenchs to ${name} PV ELSE Run Keyword And Continue On Failure Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] - FOR ${wrksp_title} IN @{connected_wrksp} - ${mount_dir}= Set Variable ${connected_wrksp}[${wrksp_title}] - Set Connection Between PV And Workspace ${wrksp_title} ${mount_dir} + FOR ${workbench_title} IN @{connected_workbench} + ${mount_dir}= Set Variable ${connected_workbench}[${workbench_title}] + Set Connection Between PV And Workspace ${workbench_title} ${mount_dir} END END Set Connection Between PV And Workspace - [Arguments] ${wrksp_title} ${mount_dir} + [Arguments] ${workbench_title} ${mount_dir} Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"] Click Element xpath=//button[@aria-label="Options menu"] - Wait Until Page Contains Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] - Click Element ${STORAGE_WRKSP_SELECTOR_XP}/button[text()="${wrksp_title}"] + Wait Until Page Contains Element ${STORAGE_WORKBENCH_SELECTOR_XP}/button[text()="${workbench_title}"] + Click Element ${STORAGE_WORKBENCH_SELECTOR_XP}/button[text()="${workbench_title}"] Wait Until Page Contains Element ${STORAGE_MOUNT_DIR_INPUT_XP} Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} Delete Storage [Arguments] ${name} ${press_cancel}=${FALSE} Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] - Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] + Wait Until Page Contains Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] + Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] Wait Until Modal Appears Run Keyword And Continue On Failure Page Should Contain Confirm storage delete Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Click Button ${WRKSP_DELETE_BTN_XP} + Click Button ${WORKBENCH_DELETE_BTN_XP} END Wait Until Modal Disappears \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource similarity index 58% rename from tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource rename to tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 5bcaf76a0..5afac9174 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -5,36 +5,35 @@ Resource Projects.resource *** Variables *** -${WORKSPACE_CREATE_BTN_XP}= xpath=//button[text()="Create data science workspace"] -# ${WORKSPACE_CREATE_BTN_XP}= xpath=//a[text()="Create data science workspace"] -${WRKSP_NAME_INPUT_XP}= xpath=//input[@name="workspace-name"] -${WRKSP_DESCR_TXT_XP}= xpath=//textarea[@name="workspace-description"] -${WRKSP_IMAGE_MENU_BTN_XP}= xpath=//section[@id="notebook-image"]//button[@aria-label="Options menu"] -${WRKSP_IMAGE_ITEM_BTN_XP}= xpath=//ul[@id="workspace-image-stream-selection"]/li/button -${WRKSP_SIZE_MENU_BTN_XP}= xpath=//section[@id="deployment-size"]//button[@aria-label="Options menu"] -${WRKSP_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button -${WRKSP_STATUS_STOPPED}= Stopped -${WRKSP_STATUS_RUNNING}= Running -${WRKSP_STATUS_STARTING}= Starting... -${WRKSP_STOP_BTN_XP}= xpath=//button[text()="Stop workspace"] -${WRKSP_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] +${WORKBENCH_CREATE_BTN_XP}= xpath=//button[text()="Create workbench"] +${WORKBENCH_NAME_INPUT_XP}= xpath=//input[@name="workbench-name"] +${WORKBENCH_DESCR_TXT_XP}= xpath=//textarea[@name="workbench-description"] +${WORKBENCH_IMAGE_MENU_BTN_XP}= xpath=//section[@id="notebook-image"]//button[@aria-label="Options menu"] +${WORKBENCH_IMAGE_ITEM_BTN_XP}= xpath=//ul[@id="workbench-image-stream-selection"]/li/button +${WORKBENCH_SIZE_MENU_BTN_XP}= xpath=//section[@id="deployment-size"]//button[@aria-label="Options menu"] +${WORKBENCH_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button +${WORKBENCH_STATUS_STOPPED}= Stopped +${WORKBENCH_STATUS_RUNNING}= Running +${WORKBENCH_STATUS_STARTING}= Starting... +${WORKBENCH_STOP_BTN_XP}= xpath=//button[text()="Stop workbench"] +${WORKBENCH_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow -${WRKSP_CREATE_START_BTN_XP}= xpath=//button[text()="Create and start"] +${WORKBENCH_CREATE_START_BTN_XP}= xpath=//button[text()="Create and start"] *** Keywords *** Create Workspace - [Documentation] Creates a new workspace in a Data Science project. It assumes + [Documentation] Creates a new workbench in a Data Science project. It assumes ... the DS Project deta - [Arguments] ${wrksp_title} ${wrksp_description} ${prj_title} ${image_name} ${deployment_size} + [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${start}=${FALSE} ... ${press_cancel}=${FALSE} - Click Element ${WORKSPACE_CREATE_BTN_XP} - Wait Until Page Contains Element ${WRKSP_NAME_INPUT_XP} + Click Element ${WORKBENCH_CREATE_BTN_XP} + Wait Until Page Contains Element ${WORKBENCH_NAME_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} - Input Text ${WRKSP_NAME_INPUT_XP} ${wrksp_title} - Input Text ${WRKSP_DESCR_TXT_XP} ${wrksp_description} + Input Text ${WORKBENCH_NAME_INPUT_XP} ${workbench_title} + Input Text ${WORKBENCH_DESCR_TXT_XP} ${workbench_description} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} Select Workspace Jupyter Image image_name=${image_name} ## Select Workspace Container Size # to fix, by default Small is already select @@ -55,8 +54,8 @@ Create Workspace Click Button ${GENERIC_CANCEL_BTN_XP} ELSE IF ${start} == ${TRUE} - Wait Until Element Is Enabled ${WRKSP_CREATE_START_BTN_XP} - Click Button ${WRKSP_CREATE_START_BTN_XP} + Wait Until Element Is Enabled ${WORKBENCH_CREATE_START_BTN_XP} + Click Button ${WORKBENCH_CREATE_START_BTN_XP} ELSE Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} @@ -75,39 +74,39 @@ Select An Existent PV Select Workspace Jupyter Image [Arguments] ${image_name} - Wait Until Page Contains Element ${WRKSP_IMAGE_MENU_BTN_XP} - Click Button ${WRKSP_IMAGE_MENU_BTN_XP} - Wait Until Page Contains Element ${WRKSP_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] - Click Element ${WRKSP_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] + 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}/span[text()="${image_name}"] + Click Element ${WORKBENCH_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] Select Workspace Container Size [Arguments] ${size_name}=Small - Wait Until Page Contains Element ${WRKSP_SIZE_MENU_BTN_XP} - Click Button ${WRKSP_SIZE_MENU_BTN_XP} - Wait Until Page Contains Element ${WRKSP_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] - Click Element ${WRKSP_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] + Wait Until Page Contains Element ${WORKBENCH_SIZE_MENU_BTN_XP} + Click Button ${WORKBENCH_SIZE_MENU_BTN_XP} + Wait Until Page Contains Element ${WORKBENCH_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] + Click Element ${WORKBENCH_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] Workspace Should Be Listed - [Arguments] ${workspace_title} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${workspace_title}"] + [Arguments] ${workbench_title} + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${workbench_title}"] Workspace Status Should Be - [Arguments] ${workspace_title} ${status} - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[text()="${status}"] + [Arguments] ${workbench_title} ${status} + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[text()="${status}"] Wait Until Workspace Is Started - [Arguments] ${workspace_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} + [Arguments] ${workbench_title} ${timeout}=30s + Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} Start Workspace - [Arguments] ${workspace_title} - ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_STOPPED} + [Arguments] ${workbench_title} + ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} IF ${is_stopped} == ${TRUE} - Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[@class="pf-c-switch__toggle"] + Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[@class="pf-c-switch__toggle"] ELSE - Log msg=Cannot start ${workspace_title} workspace because it is not stopped. + Log msg=Cannot start ${workbench_title} workbench because it is not stopped. END - Wait Until Workspace Is Started workspace_title=${workspace_title} + Wait Until Workspace Is Started workbench_title=${workbench_title} Access To Workspace [Arguments] ${username}=${TEST_USER.USERNAME} ${password}=${TEST_USER.PASSWORD} ${auth_type}=${TEST_USER.AUTH_TYPE} @@ -119,56 +118,56 @@ Access To Workspace Maybe Close Popup Launch Workspace - [Arguments] ${workspace_title} - ${is_started}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} + [Arguments] ${workbench_title} + ${is_started}= Run Keyword And Return Status Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} - Click Link xpath=//tr[td/h4[text()="${workspace_title}"]]/td/a[text()="Open"] + Click Link xpath=//tr[td/h4[text()="${workbench_title}"]]/td/a[text()="Open"] Access To Workspace ELSE - Fail msg=Cannot launch workspace ${workspace_title} because it is not running... + Fail msg=Cannot launch workbench ${workbench_title} because it is not running... END Stop Workspace - [Arguments] ${workspace_title} ${press_cancel}=${FALSE} - ${is_started}= Run Keyword And Return Status Workspace Status Should Be workspace_title=${workspace_title} status=${WRKSP_STATUS_RUNNING} + [Arguments] ${workbench_title} ${press_cancel}=${FALSE} + ${is_started}= Run Keyword And Return Status Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} - Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td/label/span[@class="pf-c-switch__toggle"] + Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[@class="pf-c-switch__toggle"] Wait Until Modal Appears - Run Keyword And Continue On Failure Page Should Contain Stop workspace? - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workspace? Any changes without saving will be erased. - Run Keyword And Continue On Failure Page Should Contain To save changes, access your workspace + Run Keyword And Continue On Failure Page Should Contain Stop workbench? + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. + Run Keyword And Continue On Failure Page Should Contain To save changes, access your workbench Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Click Button ${WRKSP_STOP_BTN_XP} + Click Button ${WORKBENCH_STOP_BTN_XP} END ELSE - Fail msg=Cannot stop workspace ${workspace_title} because it is not running... + Fail msg=Cannot stop workbench ${workbench_title} because it is not running... END Delete Workspace - [Arguments] ${workspace_title} ${press_cancel}=${FALSE} - Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] - Click Element xpath=//tr[td/h4[text()="${workspace_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workspace"] + [Arguments] ${workbench_title} ${press_cancel}=${FALSE} + Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workbench"] + Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workbench"] Wait Until Modal Appears Run Keyword And Continue On Failure Page Should Contain Confirm notebook delete - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${workspace_title}? + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${workbench_title}? IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Click Button ${WRKSP_DELETE_BTN_XP} + Click Button ${WORKBENCH_DELETE_BTN_XP} END Wait Until Modal Disappears Check Launched Workspace Is The Correct One - [Arguments] ${workspace_title} ${image} ${namespace} - ${_} ${cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + [Arguments] ${workbench_title} ${image} ${namespace} + ${_} ${cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} # check notebook id from URL.. ${current_url}= Get Location Location Should Contain ${cr_name} @@ -178,11 +177,11 @@ Check Launched Workspace Is The Correct One # ${spawn_fail} = Has Spawn Failed Get Openshift Notebook CR From Workspace - [Arguments] ${workspace_title} ${namespace} + [Arguments] ${workbench_title} ${namespace} # ${res} ${cr_name}= Run Keyword And Ignore Error Oc Get kind=Notebook - # ... field_selector=metadata.annotations.openshift.io/display-name=${workspace_title},metadata.namespace=${namespace} + # ... field_selector=metadata.annotations.openshift.io/display-name=${workbench_title},metadata.namespace=${namespace} # ... fields=[metadata.name] - ${rc} ${cr_name}= Run And Return Rc And Output oc get notebook -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${workspace_title}")].metadata.name}' + ${rc} ${cr_name}= Run And Return Rc And Output oc get notebook -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${workbench_title}")].metadata.name}' [Return] ${rc} ${cr_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 7089422cd..e955d24da 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -2,7 +2,7 @@ Library SeleniumLibrary Library OpenShiftLibrary Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource -Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource Suite Setup Project Suite Setup @@ -15,12 +15,12 @@ Test Teardown Close All Browsers ${PRJ_TITLE}= ODS-CI DS Project ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature ${NB_IMAGE}= Minimal Python -${WRKSP_TITLE}= ODS-CI Workspace 1 -${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using ${NB_IMAGE} image to test DS Projects feature -${WRKSP_2_TITLE}= ODS-CI Workspace 2 -${WRKSP_2_DESCRIPTION}= ODS-CI Workspace 2 is a test workspace using ${NB_IMAGE} image to test DS Projects feature -${WRKSP_3_TITLE}= ODS-CI Workspace 2 -${WRKSP_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workspace using ${NB_IMAGE} image to test DS Projects feature +${WORKBENCH_TITLE}= ODS-CI Workspace 1 +${WORKBENCH_DESCRIPTION}= ODS-CI Workspace 1 is a test workbench using ${NB_IMAGE} image to test DS Projects feature +${WORKBENCH_2_TITLE}= ODS-CI Workspace 2 +${WORKBENCH_2_DESCRIPTION}= ODS-CI Workspace 2 is a test workbench using ${NB_IMAGE} image to test DS Projects feature +${WORKBENCH_3_TITLE}= ODS-CI Workspace 2 +${WORKBENCH_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workbench using ${NB_IMAGE} image to test DS Projects feature ${PV_BASENAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB @@ -53,30 +53,30 @@ Verify User Can Create And Start A Workspace With Ephimeral Storage [Tags] ODS-1812 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace wrksp_title=${EMPTY} wrksp_description=${EMPTY} prj_title=${PRJ_TITLE} + Create Workspace workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} press_cancel=${TRUE} - Create Workspace wrksp_title=${WRKSP_TITLE} wrksp_description=${WRKSP_DESCRIPTION} prj_title=${PRJ_TITLE} + Create Workspace workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} - Workspace Should Be Listed workspace_title=${WRKSP_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_STOPPED} + Workspace Should Be Listed workbench_title=${WORKBENCH_TITLE} + Workspace Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STOPPED} - Check Corresponding Notebook CR Exists workspace_title=${WRKSP_TITLE} namespace=${ns_name} - Start Workspace workspace_title=${WRKSP_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_TITLE} status=${WRKSP_STATUS_RUNNING} + Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} + Start Workspace workbench_title=${WORKBENCH_TITLE} + Workspace Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_RUNNING} Verify User Can Create A PV Storage [Tags] ODS-1819 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - ${workspaces}= Create Dictionary ${WRKSP_TITLE}=mount-data + ${workbenchs}= Create Dictionary ${WORKBENCH_TITLE}=mount-data Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_wrksp=${NONE} press_cancel=${TRUE} project_title=${PRJ_TITLE} + ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_wrksp=${workspaces} project_title=${PRJ_TITLE} + ... size=${PV_SIZE} connected_workbench=${workbenchs} project_title=${PRJ_TITLE} Storage Should Be Listed name=${PV_BASENAME}-A description=${PV_DESCRIPTION} - ... type=Persistent storage connected_wrksp=${workspaces} + ... type=Persistent storage connected_workbench=${workbenchs} Storage Size Should Be name=${PV_BASENAME}-A namespace=${ns_name} size=${PV_SIZE} @@ -85,36 +85,36 @@ Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${PV_BASENAME}-existent description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_wrksp=${NONE} project_title=${PRJ_TITLE} - Create Workspace wrksp_title=${WRKSP_2_TITLE} wrksp_description=${WRKSP_2_DESCRIPTION} prj_title=${PRJ_TITLE} + ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} + Create Workspace workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} ... pv_name=${PV_BASENAME}-existent pv_description=${NONE} pv_size=${NONE} start=${TRUE} - Workspace Should Be Listed workspace_title=${WRKSP_2_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STARTING} - Wait Until Workspace Is Started workspace_title=${WRKSP_2_TITLE} - # Workspace Status Should Be workspace_title=${WRKSP_2_TITLE} status=${WRKSP_STATUS_STOPPED} + Workspace Should Be Listed workbench_title=${WORKBENCH_2_TITLE} + Workspace Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} + Wait Until Workspace Is Started workbench_title=${WORKBENCH_2_TITLE} + # Workspace Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - Check Corresponding Notebook CR Exists workspace_title=${WRKSP_2_TITLE} namespace=${ns_name} + Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} Verify User Can Create And Start A Workspace Adding A New PV Storage [Tags] ODS-1816 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace wrksp_title=${WRKSP_3_TITLE} wrksp_description=${WRKSP_3_DESCRIPTION} prj_title=${PRJ_TITLE} + Create Workspace workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} ... pv_name=${PV_BASENAME}-new pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${TRUE} - Workspace Should Be Listed workspace_title=${WRKSP_3_TITLE} + Workspace Should Be Listed workbench_title=${WORKBENCH_3_TITLE} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} - Workspace Status Should Be workspace_title=${WRKSP_3_TITLE} status=${WRKSP_STATUS_STARTING} + Workspace Status Should Be workbench_title=${WORKBENCH_3_TITLE} status=${WORKBENCH_STATUS_STARTING} # the continue on failure should be temporary - Run Keyword And Continue On Failure Wait Until Workspace Is Started workspace_title=${WRKSP_3_TITLE} - Check Corresponding Notebook CR Exists workspace_title=${WRKSP_3_TITLE} namespace=${ns_name} + Run Keyword And Continue On Failure Wait Until Workspace Is Started workbench_title=${WORKBENCH_3_TITLE} + Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_3_TITLE} namespace=${ns_name} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} - ${connected_woksps}= Create List ${WRKSP_3_TITLE} + ${connected_woksps}= Create List ${WORKBENCH_3_TITLE} Storage Should Be Listed name=${PV_BASENAME}-new description=${PV_DESCRIPTION} - ... type=Persistent storage connected_wrksp=${connected_woksps} + ... type=Persistent storage connected_workbench=${connected_woksps} Storage Size Should Be name=${PV_BASENAME}-new namespace=${ns_name} size=${PV_SIZE} Verify User Can Launch A Workspace @@ -122,35 +122,35 @@ Verify User Can Launch A Workspace Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Start Workspace workspace_title=${WRKSP_TITLE} - Launch Workspace workspace_title=${WRKSP_TITLE} - Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} namespace=${ns_name} + Start Workspace workbench_title=${WORKBENCH_TITLE} + Launch Workspace workbench_title=${WORKBENCH_TITLE} + Check Launched Workspace Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub Verify User Can Stop A Workspace [Tags] ODS-1817 Open Data Science Project Details Page project_title=${PRJ_TITLE} - Stop Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} - Stop Workspace workspace_title=${WRKSP_TITLE} + Stop Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} + Stop Workspace workbench_title=${WORKBENCH_TITLE} # add checks on notebook pod is terminated Verify User Can Start And Launch A Workspace From Projects Home Page [Tags] ODS-1818 Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workspace_cr_name}= Get Openshift Notebook CR From Workspace workspace_title=${WRKSP_TITLE} namespace=${ns_name} - Start Workspace From Projects Home Page workspace_title=${WRKSP_TITLE} project_title=${PRJ_TITLE} workspace_cr_name=${workspace_cr_name} namespace=${ns_name} - Launch Workspace From Projects Home Page workspace_title=${WRKSP_TITLE} project_title=${PRJ_TITLE} - Check Launched Workspace Is The Correct One workspace_title=${WRKSP_TITLE} image=${NB_IMAGE} namespace=${ns_name} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} + Start Workspace From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} + Launch Workspace From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + Check Launched Workspace Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub Verify User Can Delete A Workspace [Tags] ODS-1813 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Delete Workspace workspace_title=${WRKSP_TITLE} press_cancel=${TRUE} - Delete Workspace workspace_title=${WRKSP_TITLE} - Check Workspace CR Is Deleted workspace_title=${WRKSP_TITLE} namespace=${ns_name} + Delete Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} + Delete Workspace workbench_title=${WORKBENCH_TITLE} + Check Workspace CR Is Deleted workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Cand Add A S3 Data Connection [Tags] ODS-Z @@ -158,7 +158,7 @@ Verify User Cand Add A S3 Data Connection Open Data Science Project Details Page project_title=${PRJ_TITLE} Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${AWS_ACCESS_KEY_ID} ... aws_secret_access=${AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} - Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_wrksp=${NONE} + Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_workbench=${NONE} Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Delete A Data Connection @@ -172,7 +172,7 @@ Verify User Can Delete A Data Connection Verify User Can Delete A Data Science Project [Tags] ODS-1784 Delete Data Science Project project_title=${PRJ_TITLE} - # check workspaces and resources get deleted too + # check workbenchs and resources get deleted too *** Keywords *** @@ -200,18 +200,18 @@ Check Corresponding Namespace Exists [Return] ${ns_name} Check Corresponding Notebook CR Exists - [Arguments] ${workspace_title} ${namespace} - ${res} ${response}= Get Openshift Notebook CR From Workspace workspace_title=${workspace_title} namespace=${namespace} + [Arguments] ${workbench_title} ${namespace} + ${res} ${response}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} IF "${response}" == "${EMPTY}" - Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workspace_title} in ${namespace} NS + Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workbench_title} in ${namespace} NS END Check Workspace CR Is Deleted - [Arguments] ${workspace_title} ${namespace} ${timeout}=10s - Wait Until Keyword Succeeds ${timeout} 2s Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} - ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workspace_title=${workspace_title} namespace=${namespace} + [Arguments] ${workbench_title} ${namespace} ${timeout}=10s + Wait Until Keyword Succeeds ${timeout} 2s Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} + ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} IF ${status} == ${TRUE} - Fail msg=The notebook CR for ${workspace_title} is still present, while it should have been deleted. + Fail msg=The notebook CR for ${workbench_title} is still present, while it should have been deleted. END Check Corresponding Data Connection Secret Exists From 607bd797b05bb17cd30b2a5c99625c1cca9938a7 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 27 Oct 2022 16:08:34 +0200 Subject: [PATCH 35/70] remove create and start option Signed-off-by: bdattoma --- .../Workbenches.resource | 13 ++----- .../415__ods_dashboard_projects.robot | 34 ++++++++----------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 5afac9174..a2a3ae3e2 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -19,7 +19,6 @@ ${WORKBENCH_STOP_BTN_XP}= xpath=//button[text()="Stop workbench" ${WORKBENCH_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow -${WORKBENCH_CREATE_START_BTN_XP}= xpath=//button[text()="Create and start"] *** Keywords *** @@ -27,8 +26,7 @@ Create Workspace [Documentation] Creates a new workbench in a Data Science project. It assumes ... the DS Project deta [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} - ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${start}=${FALSE} - ... ${press_cancel}=${FALSE} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${press_cancel}=${FALSE} Click Element ${WORKBENCH_CREATE_BTN_XP} Wait Until Page Contains Element ${WORKBENCH_NAME_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} @@ -53,13 +51,8 @@ Create Workspace IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - IF ${start} == ${TRUE} - Wait Until Element Is Enabled ${WORKBENCH_CREATE_START_BTN_XP} - Click Button ${WORKBENCH_CREATE_START_BTN_XP} - ELSE - Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} - Click Button ${GENERIC_CREATE_BTN_XP} - END + Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} + Click Button ${GENERIC_CREATE_BTN_XP} END Wait Until Modal Disappears Wait Until Project Is Open project_title=${prj_title} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index e955d24da..b33dc8601 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -4,7 +4,7 @@ Library OpenShiftLibrary Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource -Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource Suite Setup Project Suite Setup # Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page @@ -55,16 +55,15 @@ Verify User Can Create And Start A Workspace With Ephimeral Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} - ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} press_cancel=${TRUE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${TRUE} Create Workspace workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} - ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} start=${FALSE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} Workspace Should Be Listed workbench_title=${WORKBENCH_TITLE} - Workspace Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STOPPED} - + Workspace Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STARTING} + # the continue on failure should be temporary + Run Keyword And Continue On Failure Wait Until Workspace Is Started workbench_title=${WORKBENCH_3_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} - Start Workspace workbench_title=${WORKBENCH_TITLE} - Workspace Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_RUNNING} Verify User Can Create A PV Storage [Tags] ODS-1819 @@ -79,8 +78,6 @@ Verify User Can Create A PV Storage ... type=Persistent storage connected_workbench=${workbenchs} Storage Size Should Be name=${PV_BASENAME}-A namespace=${ns_name} size=${PV_SIZE} - - Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -88,11 +85,10 @@ Verify User Can Create And Start A Workspace With Existent PV Storage ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} Create Workspace workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} - ... pv_name=${PV_BASENAME}-existent pv_description=${NONE} pv_size=${NONE} start=${TRUE} + ... pv_name=${PV_BASENAME}-existent pv_description=${NONE} pv_size=${NONE} Workspace Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workspace Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} Wait Until Workspace Is Started workbench_title=${WORKBENCH_2_TITLE} - # Workspace Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STOPPED} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} @@ -102,7 +98,7 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} - ... pv_name=${PV_BASENAME}-new pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} start=${TRUE} + ... pv_name=${PV_BASENAME}-new pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} Workspace Should Be Listed workbench_title=${WORKBENCH_3_TITLE} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} @@ -117,6 +113,13 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage ... type=Persistent storage connected_workbench=${connected_woksps} Storage Size Should Be name=${PV_BASENAME}-new namespace=${ns_name} size=${PV_SIZE} +Verify User Can Stop A Workspace + [Tags] ODS-1817 + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Stop Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} + Stop Workspace workbench_title=${WORKBENCH_TITLE} + # add checks on notebook pod is terminated + Verify User Can Launch A Workspace [Tags] ODS-1815 Open Data Science Projects Home Page @@ -127,13 +130,6 @@ Verify User Can Launch A Workspace Check Launched Workspace Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub -Verify User Can Stop A Workspace - [Tags] ODS-1817 - Open Data Science Project Details Page project_title=${PRJ_TITLE} - Stop Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} - Stop Workspace workbench_title=${WORKBENCH_TITLE} - # add checks on notebook pod is terminated - Verify User Can Start And Launch A Workspace From Projects Home Page [Tags] ODS-1818 Open Data Science Projects Home Page From 70434ae5ee6d4e30766974f5dca183cf5e562589 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 27 Oct 2022 17:17:12 +0200 Subject: [PATCH 36/70] add storage deletion TC + check on storage resources Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 30 +++++++++- .../ODHDataScienceProject/Storages.resource | 18 +++++- .../415__ods_dashboard_projects.robot | 60 +++++++++++++++---- 3 files changed, 95 insertions(+), 13 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index d129bac9c..4bb73b8de 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -151,20 +151,42 @@ Start Workspace From Projects Home Page END ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} END - # Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/input[@id="${workbench_cr_name}"] Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] ELSE Fail msg=Cannot start ${workbench_title} workbench because it is not stopped. END Wait Until Workspace Is Started From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} +Stop Workspace From Projects Home Page + [Documentation] Trigger the workbench "stop" process from DS Projects home page. + ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or + ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server + [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} + ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + IF ${is_started} == ${TRUE} + IF "${workbench_cr_name}" == "${EMPTY}" + IF "${namespace}" == "${EMPTY}" + ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} + END + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} + END + Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] + ELSE + Fail msg=Cannot stop ${workbench_title} workbench because it is not running. + END + Wait Until Workspace Is Stopped From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} + Wait Until Workspace Is Started From Projects Home Page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} +Wait Until Workspace Is Stopped From Projects Home Page + [Arguments] ${workbench_title} ${project_title} ${timeout}=30s + Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} + Launch Workspace From Projects Home Page [Arguments] ${workbench_title} ${project_title} - Open Data Science Projects Home Page + # Open Data Science Projects Home Page ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] @@ -172,3 +194,7 @@ Launch Workspace From Projects Home Page ELSE Fail msg=Cannot launch workbench ${workbench_title} because it is not running... END + +Workbench Launch Link Should Be Disabled + [Arguments] ${workbench_title} ${project_title} + Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 0bea40ee0..c8a21f1b9 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -29,6 +29,17 @@ Storage Should Be Listed END END +Storage Should Not Be Listed + [Arguments] ${name} ${connected_workbench}=${NONE} + Run keyword And Continue On Failure Page Should Not Contain Element xpath=//tr[td/h4[text()="${name}"]] + IF "${connected_workbench}" == "${NONE}" + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] + ELSE + FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} + Log ${index}: ${workbench_title} + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${workbench_title}"] + END + END Storage Size Should Be [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ [Arguments] ${name} ${size} ${namespace} @@ -99,4 +110,9 @@ Delete Storage ELSE Click Button ${WORKBENCH_DELETE_BTN_XP} END - Wait Until Modal Disappears \ No newline at end of file + Wait Until Modal Disappears + +Get Openshift PVC From Storage + [Arguments] ${name} ${namespace} + ${rc} ${pvc_name}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].metadata.name}' + [Return] ${rc} ${pvc_name} \ No newline at end of file diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index b33dc8601..35863f6e3 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -67,25 +67,28 @@ Verify User Can Create And Start A Workspace With Ephimeral Storage Verify User Can Create A PV Storage [Tags] ODS-1819 + ${pv_name}= Set Variable ${PV_BASENAME}-A ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} ${workbenchs}= Create Dictionary ${WORKBENCH_TITLE}=mount-data - Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} + Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} project_title=${PRJ_TITLE} - Create PersistenVolume Storage name=${PV_BASENAME}-A description=${PV_DESCRIPTION} + Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${workbenchs} project_title=${PRJ_TITLE} - Storage Should Be Listed name=${PV_BASENAME}-A description=${PV_DESCRIPTION} + Storage Should Be Listed name=${pv_name} description=${PV_DESCRIPTION} ... type=Persistent storage connected_workbench=${workbenchs} - Storage Size Should Be name=${PV_BASENAME}-A namespace=${ns_name} size=${PV_SIZE} + Check Corresponding PersistentVolumeClaim Exists storage_name=${pv_name} namespace=${ns_name} + Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} Verify User Can Create And Start A Workspace With Existent PV Storage [Tags] ODS-1814 + ${pv_name}= Set Variable ${PV_BASENAME}-existent Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create PersistenVolume Storage name=${PV_BASENAME}-existent description=${PV_DESCRIPTION} + Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} Create Workspace workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} - ... pv_name=${PV_BASENAME}-existent pv_description=${NONE} pv_size=${NONE} + ... pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} Workspace Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workspace Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} Wait Until Workspace Is Started workbench_title=${WORKBENCH_2_TITLE} @@ -94,11 +97,12 @@ Verify User Can Create And Start A Workspace With Existent PV Storage Verify User Can Create And Start A Workspace Adding A New PV Storage [Tags] ODS-1816 + ${pv_name}= Set Variable ${PV_BASENAME}-new ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workspace workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} - ... pv_name=${PV_BASENAME}-new pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} + ... pv_name=${pv_name} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} Workspace Should Be Listed workbench_title=${WORKBENCH_3_TITLE} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} @@ -109,16 +113,16 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} ${connected_woksps}= Create List ${WORKBENCH_3_TITLE} - Storage Should Be Listed name=${PV_BASENAME}-new description=${PV_DESCRIPTION} + Storage Should Be Listed name=${pv_name} description=${PV_DESCRIPTION} ... type=Persistent storage connected_workbench=${connected_woksps} - Storage Size Should Be name=${PV_BASENAME}-new namespace=${ns_name} size=${PV_SIZE} + Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} Verify User Can Stop A Workspace [Tags] ODS-1817 Open Data Science Project Details Page project_title=${PRJ_TITLE} Stop Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} Stop Workspace workbench_title=${WORKBENCH_TITLE} - # add checks on notebook pod is terminated + # add checks on notebook pod is terminated but CR is present Verify User Can Launch A Workspace [Tags] ODS-1815 @@ -130,6 +134,15 @@ Verify User Can Launch A Workspace Check Launched Workspace Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub +Verify User Can Stop A Workspace From Projects Home Page + [Tags] ODS-1823 + Open Data Science Projects Home Page + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} + Stop Workspace From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} + Workbench Launch Link Should Be Disabled workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + # add checks on notebook pod is terminated but CR is present + Verify User Can Start And Launch A Workspace From Projects Home Page [Tags] ODS-1818 Open Data Science Projects Home Page @@ -148,6 +161,19 @@ Verify User Can Start And Launch A Workspace From Projects Home Page Delete Workspace workbench_title=${WORKBENCH_TITLE} Check Workspace CR Is Deleted workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} +Verify User Can Delete A Persistent Storage + [Tags] ODS-1824 + ${pv_name}= Set Variable ${PV_BASENAME}-TO-DELETE + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} + ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} + Delete Storage name=${pv_name} press_cancel=${TRUE} + Delete Storage name=${pv_name} press_cancel=${FALSE} + Storage Should Not Be Listed name=${pv_name} + Check Storage PersistentVolumeClaim Is Deleted storage_name=${pv_name} namespace=${ns_name} + + Verify User Cand Add A S3 Data Connection [Tags] ODS-Z ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -223,3 +249,17 @@ Check Data Connection Secret Is Deleted IF ${status} == ${TRUE} Fail msg=The secret for ${dc_name} data connection is still present, while it should have been deleted. END + +Check Corresponding PersistentVolumeClaim Exists + [Arguments] ${storage_name} ${namespace} + ${res} ${response}= Get Openshift PVC From Storage name=${storage_name} namespace=${namespace} + IF "${response}" == "${EMPTY}" + Run Keyword And Continue On Failure Fail msg=PVC not found for ${storage_name} in ${namespace} NS + END + +Check Storage PersistentVolumeClaim Is Deleted + [Arguments] ${storage_name} ${namespace} ${timeout}=10s + ${status}= Run Keyword And Return Status Check Corresponding PersistentVolumeClaim Exists storage_name=${storage_name} namespace=${namespace} + IF ${status} == ${TRUE} + Fail msg=The PVC for ${storage_name} storage is still present, while it should have been deleted. + END From 5005d8c9b393d764845b9a2a08c1403dfc15b297 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 27 Oct 2022 18:34:52 +0200 Subject: [PATCH 37/70] misc fixes Signed-off-by: bdattoma --- .../Page/ODH/ODHDashboard/ODHDashboard.robot | 5 +- .../ODHDataScienceProject/Projects.resource | 9 ++-- .../ODHDataScienceProject/Storages.resource | 2 +- .../Workbenches.resource | 50 ++++++++++++------- .../415__ods_dashboard_projects.robot | 11 ++-- 5 files changed, 46 insertions(+), 31 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index 59e1daca6..434329457 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -704,7 +704,8 @@ Open Application Switcher Menu Maybe Wait For Dashboard Loading Spinner Page [Documentation] Detecs the loading symbol (spinner) and wait for it to disappear. ... If the spinner does not appear, the keyword ignores the error. + [Arguments] ${timeout}=5s Run Keyword And Ignore Error Run Keywords - ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} ... AND - ... Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=10 + ... Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 4bb73b8de..f97a8da42 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -1,10 +1,10 @@ *** Settings *** Resource ../../../../Page/Components/Components.resource Resource ../../../../Common.robot -Resource ./Workspaces.resource +Resource ./Workbenches.resource *** Variables *** -${DS_PROJECT_XP}= //h1[text()="Data science projects"] +${DS_PROJECT_XP}= xpath=//h1[text()="Data science projects"] ${TITLE_INPUT_XP}= xpath=//input[@id="test"] ${DESCR_INPUT_XP}= xpath=//textarea[@id="test"] # ${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] @@ -28,7 +28,7 @@ Open Data Science Projects Home Page Is Data Science Projects Page Open Close Generic Modal If Present - ${page_open}= Run Keyword And Return Status Page Should Contain ${DS_PROJECT_XP} + ${page_open}= Run Keyword And Return Status Page Should Contain Element ${DS_PROJECT_XP} [Return] ${page_open} Open Data Science Project Details Page @@ -161,7 +161,7 @@ Stop Workspace From Projects Home Page [Documentation] Trigger the workbench "stop" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server - [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} + [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} ${press_cancel}=${FALSE} ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} IF "${workbench_cr_name}" == "${EMPTY}" @@ -171,6 +171,7 @@ Stop Workspace From Projects Home Page ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} END Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] + Handle Stop Workspace Confirmation Modal press_cancel=${press_cancel} ELSE Fail msg=Cannot stop ${workbench_title} workbench because it is not running. END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index c8a21f1b9..1647088f5 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -11,7 +11,7 @@ ${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] ${STORAGE_SIZE_PLUS_BTN_XP}= xpath=//div/button[@aria-label="Plus"] ${STORAGE_MOUNT_DIR_INPUT_XP}= xpath=//input[@aria-label="mount-path-folder-value"] ${STORAGE_WORKBENCH_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")]/ul/li -${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="storages"]]/div/button[text()="Add storage"] +${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="cluster-storages"]]/div/button[text()="Add cluster storage"] ${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add")] *** Keywords *** diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index a2a3ae3e2..0754c0e7d 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -6,6 +6,7 @@ Resource Projects.resource *** Variables *** ${WORKBENCH_CREATE_BTN_XP}= xpath=//button[text()="Create workbench"] +# ${WORKBENCH_CREATE_BTN_2_XP}= xpath=//footer/button[text()="Create workbench"] ${WORKBENCH_NAME_INPUT_XP}= xpath=//input[@name="workbench-name"] ${WORKBENCH_DESCR_TXT_XP}= xpath=//textarea[@name="workbench-description"] ${WORKBENCH_IMAGE_MENU_BTN_XP}= xpath=//section[@id="notebook-image"]//button[@aria-label="Options menu"] @@ -16,7 +17,7 @@ ${WORKBENCH_STATUS_STOPPED}= Stopped ${WORKBENCH_STATUS_RUNNING}= Running ${WORKBENCH_STATUS_STARTING}= Starting... ${WORKBENCH_STOP_BTN_XP}= xpath=//button[text()="Stop workbench"] -${WORKBENCH_DELETE_BTN_XP}= xpath=//button[text()="Delete notebook"] +${WORKBENCH_DELETE_BTN_XP}= xpath=//button[text()="Delete workbench"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow @@ -29,10 +30,10 @@ Create Workspace ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${press_cancel}=${FALSE} Click Element ${WORKBENCH_CREATE_BTN_XP} Wait Until Page Contains Element ${WORKBENCH_NAME_INPUT_XP} - Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} + Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_XP} Input Text ${WORKBENCH_NAME_INPUT_XP} ${workbench_title} Input Text ${WORKBENCH_DESCR_TXT_XP} ${workbench_description} - Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} + Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_XP} Select Workspace Jupyter Image image_name=${image_name} ## Select Workspace Container Size # to fix, by default Small is already select IF "${storage}" == "Persistent" @@ -51,8 +52,8 @@ Create Workspace IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} - Click Button ${GENERIC_CREATE_BTN_XP} + Wait Until Element Is Enabled ${WORKBENCH_CREATE_BTN_XP} + Click Button ${WORKBENCH_CREATE_BTN_XP} END Wait Until Modal Disappears Wait Until Project Is Open project_title=${prj_title} @@ -126,23 +127,36 @@ Stop Workspace IF ${is_started} == ${TRUE} Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[@class="pf-c-switch__toggle"] Wait Until Modal Appears - Run Keyword And Continue On Failure Page Should Contain Stop workbench? - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. - Run Keyword And Continue On Failure Page Should Contain To save changes, access your workbench - Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] - Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] - Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] - IF ${press_cancel} == ${TRUE} - Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE - Click Button ${WORKBENCH_STOP_BTN_XP} - END - - + Hanlde Stop Workspace Confirmation Modal press_cancel=${press_cancel} + # Run Keyword And Continue On Failure Page Should Contain Stop workbench? + # Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. + # Run Keyword And Continue On Failure Page Should Contain To save changes, access your workbench + # Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] + # Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] + # Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] + # IF ${press_cancel} == ${TRUE} + # Click Button ${GENERIC_CANCEL_BTN_XP} + # ELSE + # Click Button ${WORKBENCH_STOP_BTN_XP} + # END ELSE Fail msg=Cannot stop workbench ${workbench_title} because it is not running... END +Handle Stop Workspace Confirmation Modal + [Arguments] ${press_cancel}=${FALSE} + Run Keyword And Continue On Failure Page Should Contain Stop workbench? + Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. + Run Keyword And Continue On Failure Page Should Contain To save changes, access your workbench + Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] + Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] + Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] + IF ${press_cancel} == ${TRUE} + Click Button ${GENERIC_CANCEL_BTN_XP} + ELSE + Click Button ${WORKBENCH_STOP_BTN_XP} + END + Delete Workspace [Arguments] ${workbench_title} ${press_cancel}=${FALSE} Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 35863f6e3..27f1a0ba4 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -19,7 +19,7 @@ ${WORKBENCH_TITLE}= ODS-CI Workspace 1 ${WORKBENCH_DESCRIPTION}= ODS-CI Workspace 1 is a test workbench using ${NB_IMAGE} image to test DS Projects feature ${WORKBENCH_2_TITLE}= ODS-CI Workspace 2 ${WORKBENCH_2_DESCRIPTION}= ODS-CI Workspace 2 is a test workbench using ${NB_IMAGE} image to test DS Projects feature -${WORKBENCH_3_TITLE}= ODS-CI Workspace 2 +${WORKBENCH_3_TITLE}= ODS-CI Workspace 3 ${WORKBENCH_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workbench using ${NB_IMAGE} image to test DS Projects feature ${PV_BASENAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature @@ -173,18 +173,17 @@ Verify User Can Delete A Persistent Storage Storage Should Not Be Listed name=${pv_name} Check Storage PersistentVolumeClaim Is Deleted storage_name=${pv_name} namespace=${ns_name} - Verify User Cand Add A S3 Data Connection - [Tags] ODS-Z + [Tags] ODS-1825 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${AWS_ACCESS_KEY_ID} - ... aws_secret_access=${AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${S3.AWS_ACCESS_KEY_ID} + ... aws_secret_access=${S3.AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_workbench=${NONE} Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Delete A Data Connection - [Tags] ODS-ZY + [Tags] ODS-1826 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Delete Data Connection name=${DC_S3_NAME} press_cancel=${True} From be6e9cb6931b4dc31ccfd80d2a2505dec4b42db7 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 28 Oct 2022 16:44:06 +0200 Subject: [PATCH 38/70] refactoring + misc fixes Signed-off-by: bdattoma --- .../DataConnections.resource | 39 ++++--- .../ODHDataScienceProject/Projects.resource | 60 ++++++---- .../ODHDataScienceProject/Storages.resource | 62 +++++----- .../Workbenches.resource | 103 ++++++++--------- .../415__ods_dashboard_projects.robot | 108 ++++++++++-------- 5 files changed, 198 insertions(+), 174 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index fdfca1133..279761e92 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -13,7 +13,7 @@ ${S3_REGION_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_DEFA ${DC_SECTION_XP}= xpath=//div[div//h4[@id="data-connections"]] ${DC_ADD_BTN_1_XP}= ${DC_SECTION_XP}/div/button[text()="Add data connection"] ${DC_ADD_BTN_2_XP}= xpath=//footer/button[text()="Add data connection"] -${DC_DELETE_BTN_XP}= xpath=//button[text()="Delete data connection"] +# ${DC_DELETE_BTN_XP}= xpath=//button[text()="Delete data connection"] *** Keywords *** @@ -37,17 +37,21 @@ Create S3 Data Connection Data Connection Should Be Listed [Arguments] ${name} ${type} ${connected_workbench} - Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td/h4[text()="${name}"] - Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[text()=" ${type}"] + Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td[@data-label="Name"]/h4[text()="${name}"] + Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[text()="No connections"] + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[text()="No connections"] ELSE FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} Log ${index}: ${workbench_title} - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${workbench_title}"] + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] END END +Data Connection Should Not Be Listed + [Arguments] ${name} + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]] + Get Openshift Secret From Data Connection [Arguments] ${dc_name} ${namespace} ${rc} ${secret_name}= Run And Return Rc And Output oc get secret -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${dc_name}")].metadata.name}' @@ -55,15 +59,16 @@ Get Openshift Secret From Data Connection Delete Data Connection [Arguments] ${name} ${press_cancel}=${FALSE} - Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] - Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] - Wait Until Modal Appears - Run Keyword And Continue On Failure Page Should Contain Confirm data connection delete - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? - IF ${press_cancel} == ${TRUE} - Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE - Click Button ${DC_DELETE_BTN_XP} - END - Wait Until Modal Disappears \ No newline at end of file + # Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + # Wait Until Page Contains Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] + # Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] + # Wait Until Modal Appears + # Run Keyword And Continue On Failure Page Should Contain Confirm data connection delete + # Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? + # IF ${press_cancel} == ${TRUE} + # Click Button ${GENERIC_CANCEL_BTN_XP} + # ELSE + # Click Button ${DC_DELETE_BTN_XP} + # END + # Wait Until Modal Disappears + Handle Deletion Confirmation Modal item_title=${name} item_type=data connection press_cancel=${press_cancel} \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index f97a8da42..a4c9b2829 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -5,8 +5,9 @@ Resource ./Workbenches.resource *** Variables *** ${DS_PROJECT_XP}= xpath=//h1[text()="Data science projects"] -${TITLE_INPUT_XP}= xpath=//input[@id="test"] -${DESCR_INPUT_XP}= xpath=//textarea[@id="test"] +${TITLE_INPUT_XP}= xpath=//input[@id="manage-project-modal-name"] +${DESCR_INPUT_XP}= xpath=//textarea[@id="manage-project-modal-description"] +${RESOURCE_INPUT_XP}= xpath=//input[@id="resource-manage-project-modal-name"] # ${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] # ${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] ${GENERIC_CREATE_BTN_XP}= xpath=//button[text()="Create"] @@ -82,18 +83,29 @@ Project's Owner Should Be Run keyword And Continue On Failure Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project - [Arguments] ${title} ${description} + [Arguments] ${title} ${description} ${resource_name}=${NONE} Click Button ${PROJECT_CREATE_BTN_XP} - # Click Button Create data science project Wait Until Page Contains Element ${TITLE_INPUT_XP} Run Keyword And Warn On Failure Element Should Be Disabled ${GENERIC_CREATE_BTN_XP} Input Text ${TITLE_INPUT_XP} ${title} Input Text ${DESCR_INPUT_XP} ${description} + Run Keyword And Continue On Failure Validate Generated Resource Name project_title=${title} + IF "${resource_name}" == "${NONE}" + Clear Element Text ${RESOURCE_INPUT_XP} + Input Text ${RESOURCE_INPUT_XP} ${resource_name} + END Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} Wait Until Modal Disappears Wait Until Project Is Open project_title=${title} +Validate Generated Resource Name + [Arguments] ${project_title} + ${generated_res_name}= Get Element Attribute ${RESOURCE_INPUT_XP} value + ${lower}= Convert To Lower Case ${project_title} + ${no_spec_chars}= Replace String Using Regexp ${lower} [^A-Za-z0-9-\\s]+ ${EMPTY} + ${expected}= Replace String Using Regexp ${no_spec_chars} ${SPACE} - + Should Be Equal As Strings ${generated_res_name} ${expected} Get Openshift Namespace From Data Science Project [Arguments] ${project_title} @@ -132,70 +144,72 @@ Delete All Data Science Projects From CLI Delete Data Science Projects From CLI ocp_projects=${to_delete} END -Workspace Status Should Be From Projects Home Page +Workbench Status Should Be From Projects Home Page [Arguments] ${workbench_title} ${status} ${project_title} ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[text()="${status}"] -Start Workspace From Projects Home Page +Start Workbench From Projects Home Page [Documentation] Trigger the workbench "start" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} - ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} + ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} IF ${is_stopped} == ${TRUE} IF "${workbench_cr_name}" == "${EMPTY}" IF "${namespace}" == "${EMPTY}" ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} END - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} END Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] ELSE Fail msg=Cannot start ${workbench_title} workbench because it is not stopped. END - Wait Until Workspace Is Started From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} + Wait Until Workbench Is Started From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} -Stop Workspace From Projects Home Page +Stop Workbench From Projects Home Page [Documentation] Trigger the workbench "stop" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} ${press_cancel}=${FALSE} - ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} IF "${workbench_cr_name}" == "${EMPTY}" IF "${namespace}" == "${EMPTY}" ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} END - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} END Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] - Handle Stop Workspace Confirmation Modal press_cancel=${press_cancel} + Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ELSE Fail msg=Cannot stop ${workbench_title} workbench because it is not running. END - Wait Until Workspace Is Stopped From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} + Wait Until Workbench Is Stopped From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} -Wait Until Workspace Is Started From Projects Home Page +Wait Until Workbench Is Started From Projects Home Page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} -Wait Until Workspace Is Stopped From Projects Home Page +Wait Until Workbench Is Stopped From Projects Home Page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} + Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} -Launch Workspace From Projects Home Page +Launch Workbench From Projects Home Page [Arguments] ${workbench_title} ${project_title} # Open Data Science Projects Home Page - ${is_started}= Run Keyword And Return Status Workspace Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] - Access To Workspace + Access To Workbench ELSE Fail msg=Cannot launch workbench ${workbench_title} because it is not running... END Workbench Launch Link Should Be Disabled [Arguments] ${workbench_title} ${project_title} - Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] + # Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] + ${link_status}= Get Element Attribute xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled + Should Be Equal As Strings ${link_status} true \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 1647088f5..06fefded9 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -5,6 +5,7 @@ Resource Projects.resource *** Variables *** +${STORAGE_SECTION_XP}= xpath=//div[div//h4[@id="storages"]] ${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"] ${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"] ${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] @@ -17,36 +18,28 @@ ${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add") *** Keywords *** Storage Should Be Listed [Arguments] ${name} ${description} ${type} ${connected_workbench} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${name}"] - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/p[text()="${description}"] - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/p[text()=" ${type}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/h4[text()="${name}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/p[text()="${description}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[@data-label="Type"]/p[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] + Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[text()="No connections"] ELSE FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} - Log ${index}: ${workbench_title} - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${workbench_title}"] + Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] END END Storage Should Not Be Listed - [Arguments] ${name} ${connected_workbench}=${NONE} - Run keyword And Continue On Failure Page Should Not Contain Element xpath=//tr[td/h4[text()="${name}"]] - IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td[text()="No connections"] - ELSE - FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} - Log ${index}: ${workbench_title} - Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${name}"]]/td/ul/li[text()="${workbench_title}"] - END - END + [Arguments] ${name} + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]] + Storage Size Should Be [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ [Arguments] ${name} ${size} ${namespace} - Click Element xpath=//tr[td/h4[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] - Wait Until Element Is Visible xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"] - Wait Until Page Contains Element xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] - ${displayed_size}= Get Text xpath=//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] + Click Element ${STORAGE_SECTION_XP}//tr[td/h4[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] + Wait Until Element Is Visible ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"] + Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] + ${displayed_size}= Get Text ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] Run keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].spec.resources.requests.storage}' Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi @@ -84,11 +77,11 @@ Fill In New PV Data Run Keyword And Continue On Failure Element Should Be Enabled xpath=//div[contains(@class,"modal")]//div[contains(@class,"pf-c-select")] FOR ${workbench_title} IN @{connected_workbench} ${mount_dir}= Set Variable ${connected_workbench}[${workbench_title}] - Set Connection Between PV And Workspace ${workbench_title} ${mount_dir} + Set Connection Between PV And Workbench ${workbench_title} ${mount_dir} END END -Set Connection Between PV And Workspace +Set Connection Between PV And Workbench [Arguments] ${workbench_title} ${mount_dir} Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"] Click Element xpath=//button[@aria-label="Options menu"] @@ -99,18 +92,19 @@ Set Connection Between PV And Workspace Delete Storage [Arguments] ${name} ${press_cancel}=${FALSE} - Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] - Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] - Wait Until Modal Appears - Run Keyword And Continue On Failure Page Should Contain Confirm storage delete - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? - IF ${press_cancel} == ${TRUE} - Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE - Click Button ${WORKBENCH_DELETE_BTN_XP} - END - Wait Until Modal Disappears + # Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + # Wait Until Page Contains Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] + # Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] + # Wait Until Modal Appears + # Run Keyword And Continue On Failure Page Should Contain Confirm storage delete + # Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? + # IF ${press_cancel} == ${TRUE} + # Click Button ${GENERIC_CANCEL_BTN_XP} + # ELSE + # Click Button ${WORKBENCH_DELETE_BTN_XP} + # END + # Wait Until Modal Disappears + Handle Deletion Confirmation Modal item_title=${name} item_type=storage press_cancel=${press_cancel} Get Openshift PVC From Storage [Arguments] ${name} ${namespace} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 0754c0e7d..18c50cdc0 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -5,6 +5,7 @@ Resource Projects.resource *** Variables *** +${WORKBENCH_SECTION_XP}= xpath=//div[div//h4[@id="workbenches"]] ${WORKBENCH_CREATE_BTN_XP}= xpath=//button[text()="Create workbench"] # ${WORKBENCH_CREATE_BTN_2_XP}= xpath=//footer/button[text()="Create workbench"] ${WORKBENCH_NAME_INPUT_XP}= xpath=//input[@name="workbench-name"] @@ -17,13 +18,12 @@ ${WORKBENCH_STATUS_STOPPED}= Stopped ${WORKBENCH_STATUS_RUNNING}= Running ${WORKBENCH_STATUS_STARTING}= Starting... ${WORKBENCH_STOP_BTN_XP}= xpath=//button[text()="Stop workbench"] -${WORKBENCH_DELETE_BTN_XP}= xpath=//button[text()="Delete workbench"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow *** Keywords *** -Create Workspace +Create Workbench [Documentation] Creates a new workbench in a Data Science project. It assumes ... the DS Project deta [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} @@ -34,8 +34,8 @@ Create Workspace Input Text ${WORKBENCH_NAME_INPUT_XP} ${workbench_title} Input Text ${WORKBENCH_DESCR_TXT_XP} ${workbench_description} Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_XP} - Select Workspace Jupyter Image image_name=${image_name} - ## Select Workspace Container Size # to fix, by default Small is already select + Select Workbench Jupyter Image image_name=${image_name} + ## Select Workbench Container Size # to fix, by default Small is already select IF "${storage}" == "Persistent" IF ${pv_existent} == ${TRUE} Click Element xpath=//input[@name="persistent-existing-storage-type-radio"] @@ -66,43 +66,47 @@ Select An Existent PV Wait Until Page Contains Element xpath=//div[contains(@class,"pf-c-select")]/ul/li/button[text()="${name}"] Click Element xpath=//ul/li/button[text()="${name}"] -Select Workspace Jupyter Image +Select Workbench Jupyter Image [Arguments] ${image_name} 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}/span[text()="${image_name}"] Click Element ${WORKBENCH_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] -Select Workspace Container Size +Select Workbench Container Size [Arguments] ${size_name}=Small Wait Until Page Contains Element ${WORKBENCH_SIZE_MENU_BTN_XP} Click Button ${WORKBENCH_SIZE_MENU_BTN_XP} Wait Until Page Contains Element ${WORKBENCH_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] Click Element ${WORKBENCH_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] -Workspace Should Be Listed +Workbench Should Be Listed [Arguments] ${workbench_title} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/h4[text()="${workbench_title}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[text()="${workbench_title}"] -Workspace Status Should Be +Workbench Should Not Be Listed + [Arguments] ${workbench_title} + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[text()="${workbench_title}"] + +Workbench Status Should Be [Arguments] ${workbench_title} ${status} - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[text()="${status}"] + Run keyword And Continue On Failure Page Should Contain Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td[@data-label="Status"]/label/span[text()="${status}"] -Wait Until Workspace Is Started +Wait Until Workbench Is Started [Arguments] ${workbench_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} + Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} -Start Workspace +Start Workbench [Arguments] ${workbench_title} - ${is_stopped}= Run Keyword And Return Status Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} + ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} IF ${is_stopped} == ${TRUE} - Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[@class="pf-c-switch__toggle"] + Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td[@data-label="Status"]/label/span[@class="pf-c-switch__toggle"] ELSE Log msg=Cannot start ${workbench_title} workbench because it is not stopped. END - Wait Until Workspace Is Started workbench_title=${workbench_title} + Wait Until Workbench Is Started workbench_title=${workbench_title} -Access To Workspace +Access To Workbench [Arguments] ${username}=${TEST_USER.USERNAME} ${password}=${TEST_USER.PASSWORD} ${auth_type}=${TEST_USER.AUTH_TYPE} Switch Window NEW Run Keyword And Warn On Failure Login To Openshift ${username} ${password} ${auth_type} @@ -111,39 +115,28 @@ Access To Workspace Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s Maybe Close Popup -Launch Workspace +Launch Workbench [Arguments] ${workbench_title} - ${is_started}= Run Keyword And Return Status Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} - Click Link xpath=//tr[td/h4[text()="${workbench_title}"]]/td/a[text()="Open"] - Access To Workspace + Click Link ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td/a[text()="Open"] + Access To Workbench ELSE Fail msg=Cannot launch workbench ${workbench_title} because it is not running... END -Stop Workspace +Stop Workbench [Arguments] ${workbench_title} ${press_cancel}=${FALSE} - ${is_started}= Run Keyword And Return Status Workspace Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} - Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td/label/span[@class="pf-c-switch__toggle"] + Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td[@data-label="Status"]/label/span[@class="pf-c-switch__toggle"] Wait Until Modal Appears - Hanlde Stop Workspace Confirmation Modal press_cancel=${press_cancel} - # Run Keyword And Continue On Failure Page Should Contain Stop workbench? - # Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. - # Run Keyword And Continue On Failure Page Should Contain To save changes, access your workbench - # Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] - # Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] - # Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] - # IF ${press_cancel} == ${TRUE} - # Click Button ${GENERIC_CANCEL_BTN_XP} - # ELSE - # Click Button ${WORKBENCH_STOP_BTN_XP} - # END + Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ELSE Fail msg=Cannot stop workbench ${workbench_title} because it is not running... END -Handle Stop Workspace Confirmation Modal +Handle Stop Workbench Confirmation Modal [Arguments] ${press_cancel}=${FALSE} Run Keyword And Continue On Failure Page Should Contain Stop workbench? Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. @@ -157,37 +150,41 @@ Handle Stop Workspace Confirmation Modal Click Button ${WORKBENCH_STOP_BTN_XP} END -Delete Workspace - [Arguments] ${workbench_title} ${press_cancel}=${FALSE} - Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workbench"] - Click Element xpath=//tr[td/h4[text()="${workbench_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete workbench"] +Handle Deletion Confirmation Modal + [Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} + Click Element xpath=//tr[td[@data-label="Name"]/h4[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]/h4[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] + Click Element xpath=//tr[td[@data-label="Name"]/h4[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] Wait Until Modal Appears - Run Keyword And Continue On Failure Page Should Contain Confirm notebook delete - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${workbench_title}? + Run Keyword And Continue On Failure Page Should Contain Delete ${item_type}? + Run Keyword And Continue On Failure Page Should Contain This action cannot be undone. + Run Keyword And Continue On Failure Page Should Contain Confirm deletion by typing ${item_title} below: + Run Keyword And Continue On Failure Element Should Be Disabled xpath=//button[text()="Delete ${item_type}"] + Input Text xpath=//input[@id="delete-modal-input"] ${item_title} + Wait Until Element Is Enabled xpath=//button[text()="Delete ${item_type}"] IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Click Button ${WORKBENCH_DELETE_BTN_XP} + Click Button xpath=//button[text()="Delete ${item_type}"] END Wait Until Modal Disappears -Check Launched Workspace Is The Correct One + +Delete Workbench + [Arguments] ${workbench_title} ${press_cancel}=${FALSE} + Handle Deletion Confirmation Modal item_title=${workbench_title} item_type=workbench press_cancel=${press_cancel} + +Check Launched Workbench Is The Correct One [Arguments] ${workbench_title} ${image} ${namespace} - ${_} ${cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} - # check notebook id from URL.. + ${_} ${cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} ${current_url}= Get Location Location Should Contain ${cr_name} Location Should Contain ${namespace} Open New Notebook In Jupyterlab Menu Spawned Image Check ${IMAGE_ID_MAPPING}[${image}] - # ${spawn_fail} = Has Spawn Failed -Get Openshift Notebook CR From Workspace +Get Openshift Notebook CR From Workbench [Arguments] ${workbench_title} ${namespace} - # ${res} ${cr_name}= Run Keyword And Ignore Error Oc Get kind=Notebook - # ... field_selector=metadata.annotations.openshift.io/display-name=${workbench_title},metadata.namespace=${namespace} - # ... fields=[metadata.name] ${rc} ${cr_name}= Run And Return Rc And Output oc get notebook -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${workbench_title}")].metadata.name}' [Return] ${rc} ${cr_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 27f1a0ba4..52017c52c 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -13,14 +13,15 @@ Test Teardown Close All Browsers *** Variables *** ${PRJ_TITLE}= ODS-CI DS Project +${PRJ_RESOURCE_NAME}= ods-ci-ds-project-test ${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature ${NB_IMAGE}= Minimal Python -${WORKBENCH_TITLE}= ODS-CI Workspace 1 -${WORKBENCH_DESCRIPTION}= ODS-CI Workspace 1 is a test workbench using ${NB_IMAGE} image to test DS Projects feature -${WORKBENCH_2_TITLE}= ODS-CI Workspace 2 -${WORKBENCH_2_DESCRIPTION}= ODS-CI Workspace 2 is a test workbench using ${NB_IMAGE} image to test DS Projects feature -${WORKBENCH_3_TITLE}= ODS-CI Workspace 3 -${WORKBENCH_3_DESCRIPTION}= ODS-CI Workspace 3 is a test workbench using ${NB_IMAGE} image to test DS Projects feature +${WORKBENCH_TITLE}= ODS-CI Workbench 1 +${WORKBENCH_DESCRIPTION}= ODS-CI Workbench 1 is a test workbench using ${NB_IMAGE} image to test DS Projects feature +${WORKBENCH_2_TITLE}= ODS-CI Workbench 2 +${WORKBENCH_2_DESCRIPTION}= ODS-CI Workbench 2 is a test workbench using ${NB_IMAGE} image to test DS Projects feature +${WORKBENCH_3_TITLE}= ODS-CI Workbench 3 +${WORKBENCH_3_DESCRIPTION}= ODS-CI Workbench 3 is a test workbench using ${NB_IMAGE} image to test DS Projects feature ${PV_BASENAME}= ods-ci-pv ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB @@ -32,37 +33,41 @@ ${DC_S3_TYPE}= Object storage *** Test Cases *** -Verify User Cannot Create Project Without Title +Verify User Cannot Create Project With Empty Fields [Tags] ODS-1783 - [Setup] Launch Data Science Project Main Page Create Project With Empty Title And Expect Error # add close modal + +Verify User Cannot Create Project Using Special Chars In Resource Name + [Tags] ODS-1783 + Create Project With Special Chars In Resource Name And Expect Error + # add close modal Verify User Can Create A Data Science Project [Tags] ODS-1775 [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page - Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} + Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} resource_name=${PRJ_RESOURCE_NAME} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} -Verify User Can Create And Start A Workspace With Ephimeral Storage +Verify User Can Create And Start A Workbench With Ephimeral Storage [Tags] ODS-1812 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} + Create Workbench workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${TRUE} - Create Workspace workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} + Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} - Workspace Should Be Listed workbench_title=${WORKBENCH_TITLE} - Workspace Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STARTING} + Workbench Should Be Listed workbench_title=${WORKBENCH_TITLE} + Workbench Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STARTING} # the continue on failure should be temporary - Run Keyword And Continue On Failure Wait Until Workspace Is Started workbench_title=${WORKBENCH_3_TITLE} + Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Create A PV Storage @@ -80,35 +85,35 @@ Verify User Can Create A PV Storage Check Corresponding PersistentVolumeClaim Exists storage_name=${pv_name} namespace=${ns_name} Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} -Verify User Can Create And Start A Workspace With Existent PV Storage +Verify User Can Create And Start A Workbench With Existent PV Storage [Tags] ODS-1814 ${pv_name}= Set Variable ${PV_BASENAME}-existent Open Data Science Project Details Page project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} - Create Workspace workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} + Create Workbench workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} ... pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} - Workspace Should Be Listed workbench_title=${WORKBENCH_2_TITLE} - Workspace Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} - Wait Until Workspace Is Started workbench_title=${WORKBENCH_2_TITLE} + Workbench Should Be Listed workbench_title=${WORKBENCH_2_TITLE} + Workbench Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} + Wait Until Workbench Is Started workbench_title=${WORKBENCH_2_TITLE} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} -Verify User Can Create And Start A Workspace Adding A New PV Storage +Verify User Can Create And Start A Workbench Adding A New PV Storage [Tags] ODS-1816 ${pv_name}= Set Variable ${PV_BASENAME}-new ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} prj_title=${PRJ_TITLE} + Create Workbench workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} ... pv_name=${pv_name} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} - Workspace Should Be Listed workbench_title=${WORKBENCH_3_TITLE} + Workbench Should Be Listed workbench_title=${WORKBENCH_3_TITLE} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} - Workspace Status Should Be workbench_title=${WORKBENCH_3_TITLE} status=${WORKBENCH_STATUS_STARTING} + Workbench Status Should Be workbench_title=${WORKBENCH_3_TITLE} status=${WORKBENCH_STATUS_STARTING} # the continue on failure should be temporary - Run Keyword And Continue On Failure Wait Until Workspace Is Started workbench_title=${WORKBENCH_3_TITLE} + Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_3_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_3_TITLE} namespace=${ns_name} Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} @@ -117,49 +122,50 @@ Verify User Can Create And Start A Workspace Adding A New PV Storage ... type=Persistent storage connected_workbench=${connected_woksps} Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} -Verify User Can Stop A Workspace +Verify User Can Stop A Workbench [Tags] ODS-1817 Open Data Science Project Details Page project_title=${PRJ_TITLE} - Stop Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} - Stop Workspace workbench_title=${WORKBENCH_TITLE} + Stop Workbench workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} + Stop Workbench workbench_title=${WORKBENCH_TITLE} # add checks on notebook pod is terminated but CR is present -Verify User Can Launch A Workspace +Verify User Can Launch A Workbench [Tags] ODS-1815 Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Start Workspace workbench_title=${WORKBENCH_TITLE} - Launch Workspace workbench_title=${WORKBENCH_TITLE} - Check Launched Workspace Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} + Start Workbench workbench_title=${WORKBENCH_TITLE} + Launch Workbench workbench_title=${WORKBENCH_TITLE} + Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub -Verify User Can Stop A Workspace From Projects Home Page +Verify User Can Stop A Workbench From Projects Home Page [Tags] ODS-1823 Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} - Stop Workspace From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} + Stop Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Workbench Launch Link Should Be Disabled workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} # add checks on notebook pod is terminated but CR is present -Verify User Can Start And Launch A Workspace From Projects Home Page +Verify User Can Start And Launch A Workbench From Projects Home Page [Tags] ODS-1818 Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workspace workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} - Start Workspace From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} - Launch Workspace From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} - Check Launched Workspace Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} + Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} + Launch Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Switch Window Open Data Hub - Verify User Can Delete A Workspace + Verify User Can Delete A Workbench [Tags] ODS-1813 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Delete Workspace workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} - Delete Workspace workbench_title=${WORKBENCH_TITLE} - Check Workspace CR Is Deleted workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} + Delete Workbench workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} + Delete Workbench workbench_title=${WORKBENCH_TITLE} + Workbench Should Not Be Listed workbench_title=${WORKBENCH_TITLE} + Check Workbench CR Is Deleted workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Delete A Persistent Storage [Tags] ODS-1824 @@ -188,6 +194,7 @@ Verify User Can Delete A Data Connection Open Data Science Project Details Page project_title=${PRJ_TITLE} Delete Data Connection name=${DC_S3_NAME} press_cancel=${True} Delete Data Connection name=${DC_S3_NAME} + Data Connection Should Not Be Listed name=${DC_S3_NAME} Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Delete A Data Science Project @@ -195,6 +202,10 @@ Verify User Can Delete A Data Science Project Delete Data Science Project project_title=${PRJ_TITLE} # check workbenchs and resources get deleted too +Test + [Tags] should + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Workbench Should Be Listed workbench_title=${WORKBENCH_3_TITLE} *** Keywords *** Project Suite Setup @@ -214,6 +225,10 @@ Create Project With Empty Title And Expect Error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} +Create Project With Special Chars In Resource Name And Expect Error + ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ + Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} resource_name=ods-ci-@-project#name + Check Corresponding Namespace Exists [Arguments] ${project_title} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title} @@ -222,14 +237,13 @@ Check Corresponding Namespace Exists Check Corresponding Notebook CR Exists [Arguments] ${workbench_title} ${namespace} - ${res} ${response}= Get Openshift Notebook CR From Workspace workbench_title=${workbench_title} namespace=${namespace} + ${res} ${response}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} IF "${response}" == "${EMPTY}" Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workbench_title} in ${namespace} NS END -Check Workspace CR Is Deleted +Check Workbench CR Is Deleted [Arguments] ${workbench_title} ${namespace} ${timeout}=10s - Wait Until Keyword Succeeds ${timeout} 2s Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} IF ${status} == ${TRUE} Fail msg=The notebook CR for ${workbench_title} is still present, while it should have been deleted. From 969856e83a7e1dbe7982cf18e4267a5b57160dc0 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 28 Oct 2022 17:35:57 +0200 Subject: [PATCH 39/70] misc fixes on deletion + more refactoring Signed-off-by: bdattoma --- tests/Resources/OCP.resource | 6 +++++ .../DataConnections.resource | 13 +--------- .../ODHDataScienceProject/Projects.resource | 25 ++++--------------- .../ODHDataScienceProject/Storages.resource | 15 ++--------- .../Workbenches.resource | 16 +++++++++--- .../415__ods_dashboard_projects.robot | 21 ++++++++++++---- 6 files changed, 42 insertions(+), 54 deletions(-) diff --git a/tests/Resources/OCP.resource b/tests/Resources/OCP.resource index 8a3a9dbcd..2230dd235 100644 --- a/tests/Resources/OCP.resource +++ b/tests/Resources/OCP.resource @@ -49,6 +49,12 @@ Verify CR Status Should Be Equal ${cr_obj_dictionary.status.conditions[0].type} Available Should Be Equal ${cr_obj_dictionary.status.conditions[0].status} True +Namespace Should Not Exist + [Arguments] ${namespace} + ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${namespace} + IF ${present} == ${TRUE} + Fail msg=The namespace ${namespace} exists! + END Is RHODS Self-Managed [Documentation] Returns ${FALSE} if RHODS Managed (i.e., Cloud version) is installed ... in the cluster (e.g., usually on OSD, ROSA). diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 279761e92..7938f4c1a 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -59,16 +59,5 @@ Get Openshift Secret From Data Connection Delete Data Connection [Arguments] ${name} ${press_cancel}=${FALSE} - # Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - # Wait Until Page Contains Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] - # Click Element ${DC_SECTION_XP}//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete data connection"] - # Wait Until Modal Appears - # Run Keyword And Continue On Failure Page Should Contain Confirm data connection delete - # Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? - # IF ${press_cancel} == ${TRUE} - # Click Button ${GENERIC_CANCEL_BTN_XP} - # ELSE - # Click Button ${DC_DELETE_BTN_XP} - # END - # Wait Until Modal Disappears + Click Action From Actions Menu item_title=${name} item_type=data connection action=Delete Handle Deletion Confirmation Modal item_title=${name} item_type=data connection press_cancel=${press_cancel} \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index a4c9b2829..1814cd407 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -44,30 +44,15 @@ Open Data Science Project Details Page Maybe Wait For Dashboard Loading Spinner Page Delete Data Science Project - [Arguments] ${project_title} + [Arguments] ${project_title} ${press_cancel}=${FALSE} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} Open Data Science Projects Home Page END Project Should Be Listed project_title=${project_title} - Open Actions Menu Of Project project_title=${project_title} - Click Delete From Action Menu project_title=${project_title} - ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title} - ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${ns_name} - IF ${present} == ${TRUE} - Fail msg=The namespace for ${project_title} project was not deleted using UI actions.. - END - -Open Actions Menu Of Project - [Arguments] ${project_title} - Project Should Be Listed project_title=${project_title} - Click Element ${ACTIONS_BTN_XP} - -Click Delete From Action Menu - [Arguments] ${project_title} - Wait Until Page Contains Element ${DELETE_ACTION_BTN_XP} - Click Element ${DELETE_ACTION_BTN_XP} - Click Button Delete + Click Action From Actions Menu item_title=${project_title} item_type=project action=Delete + Handle Deletion Confirmation Modal item_title=${project_title} item_type=project press_cancel=${press_cancel} + ... additional_msg=It will destroy all workbenches, storages, data connections and other resources in ${project_title} Wait Until Project Is Open [Arguments] ${project_title} @@ -212,4 +197,4 @@ Workbench Launch Link Should Be Disabled [Arguments] ${workbench_title} ${project_title} # Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] ${link_status}= Get Element Attribute xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled - Should Be Equal As Strings ${link_status} true \ No newline at end of file + Should Be Equal As Strings ${link_status} true diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 06fefded9..5ffbce6f2 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -5,7 +5,7 @@ Resource Projects.resource *** Variables *** -${STORAGE_SECTION_XP}= xpath=//div[div//h4[@id="storages"]] +${STORAGE_SECTION_XP}= xpath=//div[div//h4[@id="cluster-storages"]] ${STORAGE_NAME_INPUT_XP}= xpath=//input[@name="create-new-storage-name"] ${STORAGE_DESCR_INPUT_XP}= xpath=//textarea[@name="create-new-storage-description"] ${STORAGE_SIZE_INPUT_XP}= xpath=//div/input[@aria-label="Input"] @@ -92,18 +92,7 @@ Set Connection Between PV And Workbench Delete Storage [Arguments] ${name} ${press_cancel}=${FALSE} - # Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - # Wait Until Page Contains Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] - # Click Element xpath=//tr[td/h4[text()="${name}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete storage"] - # Wait Until Modal Appears - # Run Keyword And Continue On Failure Page Should Contain Confirm storage delete - # Run Keyword And Continue On Failure Page Should Contain Are you sure you want to delete ${name}? - # IF ${press_cancel} == ${TRUE} - # Click Button ${GENERIC_CANCEL_BTN_XP} - # ELSE - # Click Button ${WORKBENCH_DELETE_BTN_XP} - # END - # Wait Until Modal Disappears + Click Action From Actions Menu item_title=${name} item_type=storage action=Delete Handle Deletion Confirmation Modal item_title=${name} item_type=storage press_cancel=${press_cancel} Get Openshift PVC From Storage diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 18c50cdc0..5b4c429f8 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -150,14 +150,21 @@ Handle Stop Workbench Confirmation Modal Click Button ${WORKBENCH_STOP_BTN_XP} END +Click Action From Actions Menu + [Arguments] ${item_title} ${item_type} ${action} + Click Element xpath=//tr[td[@data-label="Name"]/*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]/*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] + Click Element xpath=//tr[td[@data-label="Name"]/*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] + + Handle Deletion Confirmation Modal - [Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} - Click Element xpath=//tr[td[@data-label="Name"]/h4[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]/h4[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] - Click Element xpath=//tr[td[@data-label="Name"]/h4[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] + [Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} ${additional_msg}=${NONE} Wait Until Modal Appears Run Keyword And Continue On Failure Page Should Contain Delete ${item_type}? Run Keyword And Continue On Failure Page Should Contain This action cannot be undone. + IF "${additional_msg}" != "${NONE}" + Run Keyword And Continue On Failure Page Should Contain ${additional_msg} + END Run Keyword And Continue On Failure Page Should Contain Confirm deletion by typing ${item_title} below: Run Keyword And Continue On Failure Element Should Be Disabled xpath=//button[text()="Delete ${item_type}"] Input Text xpath=//input[@id="delete-modal-input"] ${item_title} @@ -172,6 +179,7 @@ Handle Deletion Confirmation Modal Delete Workbench [Arguments] ${workbench_title} ${press_cancel}=${FALSE} + Click Action From Actions Menu item_title=${workbench_title} item_type=workbench action=Delete Handle Deletion Confirmation Modal item_title=${workbench_title} item_type=workbench press_cancel=${press_cancel} Check Launched Workbench Is The Correct One diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 52017c52c..1dd35420e 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -1,6 +1,7 @@ *** Settings *** Library SeleniumLibrary Library OpenShiftLibrary +Resource ../../../Resources/OCP.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -96,7 +97,8 @@ Verify User Can Create And Start A Workbench With Existent PV Storage ... pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} - Wait Until Workbench Is Started workbench_title=${WORKBENCH_2_TITLE} + # continue on failure is temporary + Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_2_TITLE} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} @@ -197,15 +199,19 @@ Verify User Can Delete A Data Connection Data Connection Should Not Be Listed name=${DC_S3_NAME} Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} +Test + [Tags] should + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Storage Should Be Listed name=ods-ci-pv-A description=${PV_DESCRIPTION} + ... type=Persistent storage connected_workbench=${NONE} + Verify User Can Delete A Data Science Project [Tags] ODS-1784 + ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Delete Data Science Project project_title=${PRJ_TITLE} + Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too -Test - [Tags] should - Open Data Science Project Details Page project_title=${PRJ_TITLE} - Workbench Should Be Listed workbench_title=${WORKBENCH_3_TITLE} *** Keywords *** Project Suite Setup @@ -276,3 +282,8 @@ Check Storage PersistentVolumeClaim Is Deleted IF ${status} == ${TRUE} Fail msg=The PVC for ${storage_name} storage is still present, while it should have been deleted. END + +Check Project Is Deleted + [Arguments] ${namespace} + Wait Until Keyword Succeeds 10s 2s Namespace Should Not Exist namespace=${namespace} + \ No newline at end of file From 6ccb399c3c60d0c99a926345706c58c1f4f706eb Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 2 Nov 2022 16:58:49 +0100 Subject: [PATCH 40/70] add check on button enablement in storage modal Signed-off-by: bdattoma --- .../ODHDashboard/ODHDataScienceProject/Storages.resource | 4 ++++ .../415__ods_dashboard_projects.robot | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 5ffbce6f2..970830378 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -62,8 +62,10 @@ Create PersistenVolume Storage Fill In New PV Data [Arguments] ${name} ${description} ${size} ${connected_workbench}=${NONE} Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} + Run Keyword And Continue On Failure Element Should Be Disabled ${STORAGE_ADD_BTN_2_XP} Input Text ${STORAGE_NAME_INPUT_XP} ${name} Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} + Run Keyword And Continue On Failure Element Should Be Enabled ${STORAGE_ADD_BTN_2_XP} Input Text ${STORAGE_DESCR_INPUT_XP} ${description} Clear Element Text ${STORAGE_SIZE_INPUT_XP} IF ${size} > 1 @@ -78,6 +80,7 @@ Fill In New PV Data FOR ${workbench_title} IN @{connected_workbench} ${mount_dir}= Set Variable ${connected_workbench}[${workbench_title}] Set Connection Between PV And Workbench ${workbench_title} ${mount_dir} + Run Keyword And Continue On Failure Element Should Be Enabled ${STORAGE_ADD_BTN_2_XP} END END @@ -88,6 +91,7 @@ Set Connection Between PV And Workbench Wait Until Page Contains Element ${STORAGE_WORKBENCH_SELECTOR_XP}/button[text()="${workbench_title}"] Click Element ${STORAGE_WORKBENCH_SELECTOR_XP}/button[text()="${workbench_title}"] Wait Until Page Contains Element ${STORAGE_MOUNT_DIR_INPUT_XP} + Run Keyword And Continue On Failure Element Should Be Disabled ${STORAGE_ADD_BTN_2_XP} Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} Delete Storage diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 1dd35420e..6fb24bdb0 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -199,12 +199,6 @@ Verify User Can Delete A Data Connection Data Connection Should Not Be Listed name=${DC_S3_NAME} Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} -Test - [Tags] should - Open Data Science Project Details Page project_title=${PRJ_TITLE} - Storage Should Be Listed name=ods-ci-pv-A description=${PV_DESCRIPTION} - ... type=Persistent storage connected_workbench=${NONE} - Verify User Can Delete A Data Science Project [Tags] ODS-1784 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} From 623e85a9e85bffb29a61cedbc9d764cf9b4c3cc9 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 4 Nov 2022 18:55:03 +0100 Subject: [PATCH 41/70] add kw to add key-values env variables Signed-off-by: bdattoma --- .../Workbenches.resource | 57 +++++++++++++++++-- .../415__ods_dashboard_projects.robot | 9 +++ 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 5b4c429f8..bf5fe90a7 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -7,19 +7,21 @@ Resource Projects.resource *** Variables *** ${WORKBENCH_SECTION_XP}= xpath=//div[div//h4[@id="workbenches"]] ${WORKBENCH_CREATE_BTN_XP}= xpath=//button[text()="Create workbench"] -# ${WORKBENCH_CREATE_BTN_2_XP}= xpath=//footer/button[text()="Create workbench"] +${WORKBENCH_CREATE_BTN_2_XP}= xpath=//button[@id="create-button"] ${WORKBENCH_NAME_INPUT_XP}= xpath=//input[@name="workbench-name"] ${WORKBENCH_DESCR_TXT_XP}= xpath=//textarea[@name="workbench-description"] ${WORKBENCH_IMAGE_MENU_BTN_XP}= xpath=//section[@id="notebook-image"]//button[@aria-label="Options menu"] ${WORKBENCH_IMAGE_ITEM_BTN_XP}= xpath=//ul[@id="workbench-image-stream-selection"]/li/button ${WORKBENCH_SIZE_MENU_BTN_XP}= xpath=//section[@id="deployment-size"]//button[@aria-label="Options menu"] ${WORKBENCH_SIZE_ITEM_BTN_XP}= xpath=//ul[@id="container-size"]/li/button +${WORKBENCH_ADD_VAR_BTN_XP}= xpath=//button[text()="Add variable"] ${WORKBENCH_STATUS_STOPPED}= Stopped ${WORKBENCH_STATUS_RUNNING}= Running ${WORKBENCH_STATUS_STARTING}= Starting... ${WORKBENCH_STOP_BTN_XP}= xpath=//button[text()="Stop workbench"] &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow +${KEYVALUE_TYPE}= Key / value *** Keywords *** @@ -27,15 +29,18 @@ Create Workbench [Documentation] Creates a new workbench in a Data Science project. It assumes ... the DS Project deta [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} - ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${press_cancel}=${FALSE} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${press_cancel}=${FALSE} ${envs}=${NONE} Click Element ${WORKBENCH_CREATE_BTN_XP} Wait Until Page Contains Element ${WORKBENCH_NAME_INPUT_XP} - Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_XP} + Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_2_XP} Input Text ${WORKBENCH_NAME_INPUT_XP} ${workbench_title} Input Text ${WORKBENCH_DESCR_TXT_XP} ${workbench_description} - Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_XP} + Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_2_XP} Select Workbench Jupyter Image image_name=${image_name} ## Select Workbench Container Size # to fix, by default Small is already select + IF "${envs}" != "${NONE}" + Add Environment Variables In Workbench env_variables=${envs} + END IF "${storage}" == "Persistent" IF ${pv_existent} == ${TRUE} Click Element xpath=//input[@name="persistent-existing-storage-type-radio"] @@ -52,12 +57,52 @@ Create Workbench IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} ELSE - Wait Until Element Is Enabled ${WORKBENCH_CREATE_BTN_XP} - Click Button ${WORKBENCH_CREATE_BTN_XP} + Wait Until Element Is Enabled ${WORKBENCH_CREATE_BTN_2_XP} + Click Button ${WORKBENCH_CREATE_BTN_2_XP} END Wait Until Modal Disappears Wait Until Project Is Open project_title=${prj_title} +Add Environment Variables In Workbench + [Arguments] ${env_variables} + Click Element ${WORKBENCH_ADD_VAR_BTN_XP} + FOR ${idx} ${env_variable} IN ENUMERATE @{env_variables} + ${k8s__type}= Set Variable ${env_variable}[k8s_type] + ${input_type}= Set Variable ${env_variable}[input_type] + Remove From Dictionary ${env_variable} k8s_type input_type + Select Environment Variable Types k8s_type=${k8s__type} input_type=${input_type} + IF "${input_type}" == "${KEYVALUE_TYPE}" + ${n_pairs}= Get Length ${env_variable.keys()} + FOR ${pair_idx} ${key} ${value} IN ENUMERATE &{env_variable} + Log ${pair_idx}-${key}-${value} + Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//input[@aria-label="key of item ${pair_idx}"] + Input Text xpath=//input[@aria-label="key of item ${pair_idx}"] ${key} + Input Text xpath=//input[@aria-label="value of item ${pair_idx}"] ${value} + # Add Environment Variable key=${key} value=${value} type=${env_type} + IF ${n_pairs}-${pair_idx} > 1 + Click Button Add another variable + END + END + END + END + +Select Environment Variable Types + [Arguments] ${k8s_type} ${input_type} + Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button + Click Element xpath=//section[@aria-label="Environment variables"]//div[contains(@class,"pf-c-select")]/button + Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"] + Click Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"] + Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]//button[div/span[text()="Select one"]] + Click Element xpath=//section[@aria-label="Environment variables"]//button[div/span[text()="Select one"]] + Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] + Click Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] + +Remove All Environment Variables + ${remove_buttons}= Get WebElements xpath=//section[@id="environment-variable"]//button + FOR ${rb} IN @{remove_buttons} + Click Element ${rb} + END + Select An Existent PV [Arguments] ${name} Run Keyword And Continue On Failure Wait Until Element Is Enabled xpath=//input[@placeholder="Select a persistent storage"] diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 6fb24bdb0..9631062f1 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -206,6 +206,15 @@ Verify User Can Delete A Data Science Project Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too +Verify env variables + [Tags] ODS-XYZ + ${envs_var}= Create Dictionary env_nameA=TestVarA env_nameB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} + ${envs_list}= Create List ${envs_var} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workbench workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${FALSE} envs=${envs_list} + *** Keywords *** Project Suite Setup From f9034c564585d185e574f858dcc8a8e27c2f9f35 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 8 Nov 2022 18:38:28 +0100 Subject: [PATCH 42/70] fix latest html changes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 8 ++++---- .../ODHDataScienceProject/Workbenches.resource | 12 ++++++------ .../415__ods_dashboard_projects.robot | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 1814cd407..540adb508 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -61,11 +61,11 @@ Wait Until Project Is Open Project Should Be Listed [Arguments] ${project_title} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/a[text()="${project_title}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//td/div/a[text()="${project_title}"] Project's Owner Should Be [Arguments] ${project_title} ${expected_username} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td[a[text()="${project_title}"]]/small[text()="${expected_username}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//td[div/a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project [Arguments] ${title} ${description} ${resource_name}=${NONE} @@ -75,7 +75,7 @@ Create Data Science Project Input Text ${TITLE_INPUT_XP} ${title} Input Text ${DESCR_INPUT_XP} ${description} Run Keyword And Continue On Failure Validate Generated Resource Name project_title=${title} - IF "${resource_name}" == "${NONE}" + IF "${resource_name}" != "${NONE}" Clear Element Text ${RESOURCE_INPUT_XP} Input Text ${RESOURCE_INPUT_XP} ${resource_name} END @@ -98,7 +98,7 @@ Get Openshift Namespace From Data Science Project IF ${is_open} == ${FALSE} Open Data Science Projects Home Page END - ${project_link}= Get Element Attribute xpath=//td/a[text()="${project_title}"] href + ${project_link}= Get Element Attribute xpath=//td/div/a[text()="${project_title}"] href ${ns_name}= Split String From Right separator=/ max_split=1 string=${project_link} [Return] ${ns_name[1]} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index bf5fe90a7..d9f7e3150 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -127,15 +127,15 @@ Select Workbench Container Size Workbench Should Be Listed [Arguments] ${workbench_title} - Run keyword And Continue On Failure Wait Until Page Contains Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[text()="${workbench_title}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] Workbench Should Not Be Listed [Arguments] ${workbench_title} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[text()="${workbench_title}"] + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] Workbench Status Should Be [Arguments] ${workbench_title} ${status} - Run keyword And Continue On Failure Page Should Contain Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td[@data-label="Status"]/label/span[text()="${status}"] + Run keyword And Continue On Failure Page Should Contain Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//p[text()="${status}"] Wait Until Workbench Is Started [Arguments] ${workbench_title} ${timeout}=30s @@ -145,7 +145,7 @@ Start Workbench [Arguments] ${workbench_title} ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} IF ${is_stopped} == ${TRUE} - Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td[@data-label="Status"]/label/span[@class="pf-c-switch__toggle"] + Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"] ELSE Log msg=Cannot start ${workbench_title} workbench because it is not stopped. END @@ -164,7 +164,7 @@ Launch Workbench [Arguments] ${workbench_title} ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} - Click Link ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td/a[text()="Open"] + Click Link ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td/a[text()="Open"] Access To Workbench ELSE Fail msg=Cannot launch workbench ${workbench_title} because it is not running... @@ -174,7 +174,7 @@ Stop Workbench [Arguments] ${workbench_title} ${press_cancel}=${FALSE} ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} - Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${workbench_title}"]]/td[@data-label="Status"]/label/span[@class="pf-c-switch__toggle"] + Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"] Wait Until Modal Appears Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ELSE diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 9631062f1..8d8681aab 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -226,8 +226,8 @@ Project Suite Teardown Delete All Data Science Projects From CLI Launch Data Science Project Main Page - [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} - Launch Dashboard ocp_user_name=${username} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} + [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} + Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Project With Empty Title And Expect Error From 88aea3931587319431674ea441200b856423009f Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 10 Nov 2022 16:15:40 +0100 Subject: [PATCH 43/70] fix latest html changes + env variable test Signed-off-by: bdattoma --- tests/Resources/OCP.resource | 2 +- .../DataConnections.resource | 10 ++-- .../ODHDataScienceProject/Projects.resource | 10 ++-- .../ODHDataScienceProject/Storages.resource | 17 +++--- .../Workbenches.resource | 6 +-- .../415__ods_dashboard_projects.robot | 54 ++++++++++++++----- 6 files changed, 64 insertions(+), 35 deletions(-) diff --git a/tests/Resources/OCP.resource b/tests/Resources/OCP.resource index 2230dd235..8fc63ff1c 100644 --- a/tests/Resources/OCP.resource +++ b/tests/Resources/OCP.resource @@ -51,7 +51,7 @@ Verify CR Status Namespace Should Not Exist [Arguments] ${namespace} - ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${namespace} + ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=${namespace} IF ${present} == ${TRUE} Fail msg=The namespace ${namespace} exists! END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 7938f4c1a..96d51c609 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -37,20 +37,20 @@ Create S3 Data Connection Data Connection Should Be Listed [Arguments] ${name} ${type} ${connected_workbench} - Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td[@data-label="Name"]/h4[text()="${name}"] - Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[text()=" ${type}"] + Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] + Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[text()="No connections"] + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()="No connections"] ELSE FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} Log ${index}: ${workbench_title} - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] + Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] END END Data Connection Should Not Be Listed [Arguments] ${name} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]] + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] Get Openshift Secret From Data Connection [Arguments] ${dc_name} ${namespace} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 540adb508..5670bba5e 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -133,7 +133,7 @@ Workbench Status Should Be From Projects Home Page [Arguments] ${workbench_title} ${status} ${project_title} ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[text()="${status}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[div//label[@for="${workbench_cr_name}"]]//p[text()="${status}"] Start Workbench From Projects Home Page [Documentation] Trigger the workbench "start" process from DS Projects home page. @@ -148,7 +148,7 @@ Start Workbench From Projects Home Page END ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} END - Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] + Click Element xpath=//tr[td/div/a[text()="${project_title}"]]/td/div//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] ELSE Fail msg=Cannot start ${workbench_title} workbench because it is not stopped. END @@ -167,7 +167,7 @@ Stop Workbench From Projects Home Page END ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} END - Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] + Click Element xpath=//tr[td/div/a[text()="${project_title}"]]/td/div//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ELSE Fail msg=Cannot stop ${workbench_title} workbench because it is not running. @@ -187,7 +187,7 @@ Launch Workbench From Projects Home Page # Open Data Science Projects Home Page ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} - Click Element xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] + Click Element xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] Access To Workbench ELSE Fail msg=Cannot launch workbench ${workbench_title} because it is not running... @@ -196,5 +196,5 @@ Launch Workbench From Projects Home Page Workbench Launch Link Should Be Disabled [Arguments] ${workbench_title} ${project_title} # Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] - ${link_status}= Get Element Attribute xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled + ${link_status}= Get Element Attribute xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled Should Be Equal As Strings ${link_status} true diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 970830378..8b3a2d246 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -18,25 +18,25 @@ ${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add") *** Keywords *** Storage Should Be Listed [Arguments] ${name} ${description} ${type} ${connected_workbench} - Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/h4[text()="${name}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/p[text()="${description}"] - Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[@data-label="Type"]/p[text()=" ${type}"] + Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Type"]/p[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[text()="No connections"] + Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()="No connections"] ELSE FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} - Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] + Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] END END Storage Should Not Be Listed [Arguments] ${name} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4[text()="${name}"]] + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] Storage Size Should Be [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ [Arguments] ${name} ${size} ${namespace} - Click Element ${STORAGE_SECTION_XP}//tr[td/h4[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] + Click Element ${STORAGE_SECTION_XP}//tr[td/h4/div[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] Wait Until Element Is Visible ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"] Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] ${displayed_size}= Get Text ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] @@ -61,11 +61,12 @@ Create PersistenVolume Storage Fill In New PV Data [Arguments] ${name} ${description} ${size} ${connected_workbench}=${NONE} + ${is_storage_modal}= Run Keyword And Return Status Page Should Contain Element ${STORAGE_ADD_BTN_2_XP} Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} - Run Keyword And Continue On Failure Element Should Be Disabled ${STORAGE_ADD_BTN_2_XP} + Run Keyword If ${is_storage_modal} == ${TRUE} Run Keyword And Continue On Failure Element Should Be Disabled ${STORAGE_ADD_BTN_2_XP} Input Text ${STORAGE_NAME_INPUT_XP} ${name} Wait Until Page Contains Element ${STORAGE_DESCR_INPUT_XP} - Run Keyword And Continue On Failure Element Should Be Enabled ${STORAGE_ADD_BTN_2_XP} + Run Keyword If ${is_storage_modal} == ${TRUE} Run Keyword And Continue On Failure Element Should Be Enabled ${STORAGE_ADD_BTN_2_XP} Input Text ${STORAGE_DESCR_INPUT_XP} ${description} Clear Element Text ${STORAGE_SIZE_INPUT_XP} IF ${size} > 1 diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index d9f7e3150..98ae39857 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -197,9 +197,9 @@ Handle Stop Workbench Confirmation Modal Click Action From Actions Menu [Arguments] ${item_title} ${item_type} ${action} - Click Element xpath=//tr[td[@data-label="Name"]/*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] - Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]/*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] - Click Element xpath=//tr[td[@data-label="Name"]/*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] + Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] + Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] + Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] Handle Deletion Confirmation Modal diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 8d8681aab..d5e43aaac 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -139,7 +139,7 @@ Verify User Can Launch A Workbench Start Workbench workbench_title=${WORKBENCH_TITLE} Launch Workbench workbench_title=${WORKBENCH_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} - Switch Window Open Data Hub + # Switch Window Open Data Hub Verify User Can Stop A Workbench From Projects Home Page [Tags] ODS-1823 @@ -158,7 +158,7 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Launch Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} - Switch Window Open Data Hub + # Switch Window Open Data Hub Verify User Can Delete A Workbench [Tags] ODS-1813 @@ -199,6 +199,20 @@ Verify User Can Delete A Data Connection Data Connection Should Not Be Listed name=${DC_S3_NAME} Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} +Verify User Can Create A Workbench With Environment Variables + [Tags] ODS-XYZ + ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} + ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} + ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} + Open Data Science Project Details Page project_title=${PRJ_TITLE} + Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${FALSE} envs=${envs_list} + Wait Until Workbench Is Started workbench_title=${workbench_title} + Launch Workbench workbench_title=${WORKBENCH_TITLE} + Check Environment Variables Exist env_variables=${envs_list} + + Verify User Can Delete A Data Science Project [Tags] ODS-1784 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -206,15 +220,11 @@ Verify User Can Delete A Data Science Project Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too -Verify env variables - [Tags] ODS-XYZ - ${envs_var}= Create Dictionary env_nameA=TestVarA env_nameB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} - ${envs_list}= Create List ${envs_var} - Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workbench workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} - ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} - ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${FALSE} envs=${envs_list} - +Verify oc get + [Tags] project-get + #OpenshiftLibrary.Oc Get kind=Namespace name=ods-ci-no-existent + OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=ods-ci + # OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=ods-ci-no-existent *** Keywords *** Project Suite Setup @@ -288,5 +298,23 @@ Check Storage PersistentVolumeClaim Is Deleted Check Project Is Deleted [Arguments] ${namespace} - Wait Until Keyword Succeeds 10s 2s Namespace Should Not Exist namespace=${namespace} - \ No newline at end of file + Wait Until Keyword Succeeds 10s 1s Namespace Should Not Exist namespace=${namespace} + +Check Environment Variables Exist + [Arguments] ${env_variables} + Add and Run JupyterLab Code Cell in Active Notebook import os; print(os.environ["JUPYTER_IMAGE"].split("/")[-1].split(":")[0]) + FOR ${idx} ${env_variable} IN ENUMERATE @{env_variables} + ${k8s__type}= Set Variable ${env_variable}[k8s_type] + ${input_type}= Set Variable ${env_variable}[input_type] + Remove From Dictionary ${env_variable} k8s_type input_type + Select Environment Variable Types k8s_type=${k8s__type} input_type=${input_type} + # IF "${input_type}" == "${KEYVALUE_TYPE}" + ${n_pairs}= Get Length ${env_variable.keys()} + FOR ${pair_idx} ${key} ${value} IN ENUMERATE &{env_variable} + Log ${pair_idx}-${key}-${value} + Run Keyword And Continue On Failure Run Cell And Check Output print(os.environ["${key}"]) ${value} + END + # END + END + Open With JupyterLab Menu Edit Select All Cells + Open With JupyterLab Menu Edit Delete Cells \ No newline at end of file From 3bea1f7ff8d4096aabec4a422b64d600bda8a72e Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 11 Nov 2022 18:40:28 +0100 Subject: [PATCH 44/70] minor changes Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index d5e43aaac..915978701 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -51,8 +51,8 @@ Verify User Can Create A Data Science Project Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} resource_name=${PRJ_RESOURCE_NAME} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} - Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} - # Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} + # Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} Verify User Can Create And Start A Workbench With Ephimeral Storage @@ -200,7 +200,7 @@ Verify User Can Delete A Data Connection Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Create A Workbench With Environment Variables - [Tags] ODS-XYZ + [Tags] ODS-1864 ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} From ebbdd66a8ebb84b59e817cb4398e995a0586d2bb Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 11 Nov 2022 18:45:05 +0100 Subject: [PATCH 45/70] remove unnecessary code Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 915978701..93fc857c4 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -220,11 +220,6 @@ Verify User Can Delete A Data Science Project Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too -Verify oc get - [Tags] project-get - #OpenshiftLibrary.Oc Get kind=Namespace name=ods-ci-no-existent - OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=ods-ci - # OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=ods-ci-no-existent *** Keywords *** Project Suite Setup From 5fe02edb9ba198923cf3c1951bc934344e818d1d Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 14 Nov 2022 17:18:01 +0100 Subject: [PATCH 46/70] add test for user access Signed-off-by: bdattoma --- .../Page/ODH/ODHDashboard/ODHDashboard.robot | 2 +- .../ODHDataScienceProject/Projects.resource | 19 ++++ .../415__ods_dashboard_projects.robot | 86 ++++++++++++++++++- 3 files changed, 105 insertions(+), 2 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index 434329457..c41a4d3fd 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -704,7 +704,7 @@ Open Application Switcher Menu Maybe Wait For Dashboard Loading Spinner Page [Documentation] Detecs the loading symbol (spinner) and wait for it to disappear. ... If the spinner does not appear, the keyword ignores the error. - [Arguments] ${timeout}=5s + [Arguments] ${timeout}=10s Run Keyword And Ignore Error Run Keywords ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} ... AND diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 5670bba5e..333aa8f19 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -63,6 +63,10 @@ Project Should Be Listed [Arguments] ${project_title} Run keyword And Continue On Failure Page Should Contain Element xpath=//td/div/a[text()="${project_title}"] +Project Should Not Be Listed + [Arguments] ${project_title} + Run keyword And Continue On Failure Page Should Not Contain Element xpath=//td/div/a[text()="${project_title}"] + Project's Owner Should Be [Arguments] ${project_title} ${expected_username} Run keyword And Continue On Failure Page Should Contain Element xpath=//td[div/a[text()="${project_title}"]]/small[text()="${expected_username}"] @@ -198,3 +202,18 @@ Workbench Launch Link Should Be Disabled # Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] ${link_status}= Get Element Attribute xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled Should Be Equal As Strings ${link_status} true + +Get All Displayed Projects + ${projects_names}= Create List + ${elements}= Get WebElements xpath=//td[@data-label="Name"]/div/a + FOR ${element} IN @{elements} + ${name}= Get Text ${element} + Append To List ${projects_names} ${name} + END + [Return] ${projects_names} + +Number Of Displayed Projects Should Be + [Arguments] ${expected_number} + ${listed}= Get All Displayed Projects + ${n_listed}= Get Length ${listed} + Run Keyword And Continue On Failure Should Be Equal As Integers ${n_listed} ${expected_number} \ No newline at end of file diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 93fc857c4..69cd5aa59 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -43,7 +43,47 @@ Verify User Cannot Create Project Using Special Chars In Resource Name [Tags] ODS-1783 Create Project With Special Chars In Resource Name And Expect Error # add close modal - + +Verify User Can Access Only Itw Owned Projects + [Tags] ODS-1868 + [Setup] Set Variables For User Access Test + Launch Data Science Project Main Page username=${TEST_USER_3.USERNAME} password=${TEST_USER_3.PASSWORD} + Open Data Science Projects Home Page + Create Data Science Project title=${PRJ_1_USER3} description=${EMPTY} + Open Data Science Projects Home Page + Project Should Be Listed project_title=${PRJ_1_USER3} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_1_USER3} + Open Data Science Projects Home Page + Create Data Science Project title=${PRJ_2_USER3} description=${EMPTY} + Open Data Science Projects Home Page + Project Should Be Listed project_title=${PRJ_2_USER3} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_2_USER3} + Launch Data Science Project Main Page username=${TEST_USER_4.USERNAME} password=${TEST_USER_4.PASSWORD} + Create Data Science Project title=${PRJ_A_USER4} description=${EMPTY} + Open Data Science Projects Home Page + Number Of Displayed Projects Should Be expected_number=1 + Project Should Be Listed project_title=${PRJ_A_USER4} + Project's Owner Should Be expected_username=${TEST_USER_4.USERNAME} project_title=${PRJ_A_USER4} + Project Should Not Be Listed project_title=${PRJ_1_USER3} + Project Should Not Be Listed project_title=${PRJ_2_USER3} + Switch Browser 1 + Number Of Displayed Projects Should Be expected_number=2 + Project Should Not Be Listed project_title=${PRJ_A_USER4} + Project Should Be Listed project_title=${PRJ_1_USER3} + Project Should Be Listed project_title=${PRJ_2_USER3} + Launch Data Science Project Main Page username=${TEST_USER.USERNAME} password=${TEST_USER.PASSWORD} + Capture Page Screenshot + Number Of Displayed Projects Should Be expected_number=3 + Project Should Be Listed project_title=${PRJ_1_USER3} + Project Should Be Listed project_title=${PRJ_2_USER3} + Project Should Be Listed project_title=${PRJ_A_USER4} + Launch Data Science Project Main Page username=${OCP_ADMIN_USER.USERNAME} password=${OCP_ADMIN_USER.PASSWORD} ocp_user_auth_type=${OCP_ADMIN_USER.AUTH_TYPE} + Capture Page Screenshot + Number Of Displayed Projects Should Be expected_number=1 + Project Should Be Listed project_title=${PRJ_1_USER3} + Project Should Be Listed project_title=${PRJ_2_USER3} + Project Should Be Listed project_title=${PRJ_A_USER4} + Verify User Can Create A Data Science Project [Tags] ODS-1775 [Setup] Launch Data Science Project Main Page @@ -220,6 +260,45 @@ Verify User Can Delete A Data Science Project Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too +Verify User Can Access Only Its Owned Projects + [Tags] ODS-1868 + [Setup] Set Variables For User Access Test + Launch Data Science Project Main Page username=${TEST_USER_3.USERNAME} password=${TEST_USER_3.PASSWORD} + Open Data Science Projects Home Page + Create Data Science Project title=${PRJ_1_USER3} description=${EMPTY} + Open Data Science Projects Home Page + Project Should Be Listed project_title=${PRJ_1_USER3} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_1_USER3} + Open Data Science Projects Home Page + Create Data Science Project title=${PRJ_2_USER3} description=${EMPTY} + Open Data Science Projects Home Page + Project Should Be Listed project_title=${PRJ_2_USER3} + Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_2_USER3} + Launch Data Science Project Main Page username=${TEST_USER_4.USERNAME} password=${TEST_USER_4.PASSWORD} + Create Data Science Project title=${PRJ_A_USER4} description=${EMPTY} + Open Data Science Projects Home Page + Number Of Displayed Projects Should Be expected_number=1 + Project Should Be Listed project_title=${PRJ_A_USER4} + Project's Owner Should Be expected_username=${TEST_USER_4.USERNAME} project_title=${PRJ_A_USER4} + Project Should Not Be Listed project_title=${PRJ_1_USER3} + Project Should Not Be Listed project_title=${PRJ_2_USER3} + Switch Browser 1 + Number Of Displayed Projects Should Be expected_number=2 + Project Should Not Be Listed project_title=${PRJ_A_USER4} + Project Should Be Listed project_title=${PRJ_1_USER3} + Project Should Be Listed project_title=${PRJ_2_USER3} + Launch Data Science Project Main Page username=${TEST_USER.USERNAME} password=${TEST_USER.PASSWORD} + Capture Page Screenshot + Number Of Displayed Projects Should Be expected_number=3 + Project Should Be Listed project_title=${PRJ_1_USER3} + Project Should Be Listed project_title=${PRJ_2_USER3} + Project Should Be Listed project_title=${PRJ_A_USER4} + Launch Data Science Project Main Page username=${OCP_ADMIN_USER.USERNAME} password=${OCP_ADMIN_USER.PASSWORD} ocp_user_auth_type=${OCP_ADMIN_USER.AUTH_TYPE} + Capture Page Screenshot + Number Of Displayed Projects Should Be expected_number=1 + Project Should Be Listed project_title=${PRJ_1_USER3} + Project Should Be Listed project_title=${PRJ_2_USER3} + Project Should Be Listed project_title=${PRJ_A_USER4} *** Keywords *** Project Suite Setup @@ -230,6 +309,11 @@ Project Suite Teardown Close All Browsers Delete All Data Science Projects From CLI +Set Variables For User Access Test + Set Suite Variable ${PRJ_1_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#1 + Set Suite Variable ${PRJ_2_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#2 + Set Suite Variable ${PRJ_A_USER4} ${PRJ_TITLE}-${TEST_USER_4.USERNAME}-#A + Launch Data Science Project Main Page [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} browser_options=${BROWSER.OPTIONS} From 50bced5b3c1d595d5fb2a5d23863078d5341eeb6 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 14 Nov 2022 17:29:58 +0100 Subject: [PATCH 47/70] remove duplication Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 69cd5aa59..a35d6c74d 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -260,46 +260,6 @@ Verify User Can Delete A Data Science Project Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too -Verify User Can Access Only Its Owned Projects - [Tags] ODS-1868 - [Setup] Set Variables For User Access Test - Launch Data Science Project Main Page username=${TEST_USER_3.USERNAME} password=${TEST_USER_3.PASSWORD} - Open Data Science Projects Home Page - Create Data Science Project title=${PRJ_1_USER3} description=${EMPTY} - Open Data Science Projects Home Page - Project Should Be Listed project_title=${PRJ_1_USER3} - Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_1_USER3} - Open Data Science Projects Home Page - Create Data Science Project title=${PRJ_2_USER3} description=${EMPTY} - Open Data Science Projects Home Page - Project Should Be Listed project_title=${PRJ_2_USER3} - Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_2_USER3} - Launch Data Science Project Main Page username=${TEST_USER_4.USERNAME} password=${TEST_USER_4.PASSWORD} - Create Data Science Project title=${PRJ_A_USER4} description=${EMPTY} - Open Data Science Projects Home Page - Number Of Displayed Projects Should Be expected_number=1 - Project Should Be Listed project_title=${PRJ_A_USER4} - Project's Owner Should Be expected_username=${TEST_USER_4.USERNAME} project_title=${PRJ_A_USER4} - Project Should Not Be Listed project_title=${PRJ_1_USER3} - Project Should Not Be Listed project_title=${PRJ_2_USER3} - Switch Browser 1 - Number Of Displayed Projects Should Be expected_number=2 - Project Should Not Be Listed project_title=${PRJ_A_USER4} - Project Should Be Listed project_title=${PRJ_1_USER3} - Project Should Be Listed project_title=${PRJ_2_USER3} - Launch Data Science Project Main Page username=${TEST_USER.USERNAME} password=${TEST_USER.PASSWORD} - Capture Page Screenshot - Number Of Displayed Projects Should Be expected_number=3 - Project Should Be Listed project_title=${PRJ_1_USER3} - Project Should Be Listed project_title=${PRJ_2_USER3} - Project Should Be Listed project_title=${PRJ_A_USER4} - Launch Data Science Project Main Page username=${OCP_ADMIN_USER.USERNAME} password=${OCP_ADMIN_USER.PASSWORD} ocp_user_auth_type=${OCP_ADMIN_USER.AUTH_TYPE} - Capture Page Screenshot - Number Of Displayed Projects Should Be expected_number=1 - Project Should Be Listed project_title=${PRJ_1_USER3} - Project Should Be Listed project_title=${PRJ_2_USER3} - Project Should Be Listed project_title=${PRJ_A_USER4} - *** Keywords *** Project Suite Setup Set Library Search Order SeleniumLibrary From f9f4bed4ebda85f0719cdd0e1d2f2ec0eed4807b Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 15 Nov 2022 19:24:24 +0100 Subject: [PATCH 48/70] various fixes Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 16 +++--- .../Workbenches.resource | 11 +++- .../415__ods_dashboard_projects.robot | 57 ++++++++++--------- 3 files changed, 47 insertions(+), 37 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 333aa8f19..3f847abcf 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -121,23 +121,21 @@ Delete Data Science Projects From CLI Delete All Data Science Projects From CLI [Documentation] Deletes all the Openshift Projects which have been created ... via DataScienceProjects feature, using OpenshiftLibrary - ${res} ${projects}= Run Keyword And Ignore Error Oc Get kind=Project label_selector=opendatahub.io/user=htpasswd-2dcluster-2dadmin-2duser - IF "${res}" == "FAIL" + ${res} ${projects_names}= Run And Return Rc And Output oc get projects -o json | jq '.items[] | select((.metadata.annotations."openshift.io/display-name" != null) and (.metadata.annotations."openshift.io/display-name" | endswith("[DSP]"))) | .metadata.name' + IF ${res} == ${EMPTY} Log msg=There are probably no DS Projects to delete in teardown. ELSE - @{to_delete}= Create List - FOR ${project} IN @{projects} - Log ${project['metadata']['name']} - Append To List ${to_delete} ${project['metadata']['name']} - END - Delete Data Science Projects From CLI ocp_projects=${to_delete} + ${projects_names}= Replace String ${projects_names} " ${EMPTY} + ${projects_names}= Text To List ${projects_names} + Delete Data Science Projects From CLI ocp_projects=${projects_names} END Workbench Status Should Be From Projects Home Page [Arguments] ${workbench_title} ${status} ${project_title} ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[div//label[@for="${workbench_cr_name}"]]//p[text()="${status}"] + # Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[div//label[@for="${workbench_cr_name}"]]//p[text()="${status}"] + Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[@data-label="Status"]//div[div/label[@for="${workbench_cr_name}"]]/div/p[text()="${status}"] Start Workbench From Projects Home Page [Documentation] Trigger the workbench "start" process from DS Projects home page. diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 98ae39857..ebeeda6ac 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -39,7 +39,8 @@ Create Workbench Select Workbench Jupyter Image image_name=${image_name} ## Select Workbench Container Size # to fix, by default Small is already select IF "${envs}" != "${NONE}" - Add Environment Variables In Workbench env_variables=${envs} + ${envs_copy}= Copy List ${envs} deepcopy=${TRUE} + Add Environment Variables In Workbench env_variables=${envs_copy} END IF "${storage}" == "Persistent" IF ${pv_existent} == ${TRUE} @@ -66,6 +67,7 @@ Create Workbench Add Environment Variables In Workbench [Arguments] ${env_variables} Click Element ${WORKBENCH_ADD_VAR_BTN_XP} + ${n_objects}= Get Length ${env_variables} FOR ${idx} ${env_variable} IN ENUMERATE @{env_variables} ${k8s__type}= Set Variable ${env_variable}[k8s_type] ${input_type}= Set Variable ${env_variable}[input_type] @@ -82,7 +84,12 @@ Add Environment Variables In Workbench IF ${n_pairs}-${pair_idx} > 1 Click Button Add another variable END - END + END + END + Sleep 5s + Capture Page Screenshot + IF ${n_objects}-${idx} > 1 + Click Button Add more variables END END diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index a35d6c74d..427fe42d2 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -7,7 +7,7 @@ Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProjec Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource Suite Setup Project Suite Setup -# Suite Teardown Project Suite Teardown +Suite Teardown Project Suite Teardown Test Setup Launch Data Science Project Main Page Test Teardown Close All Browsers @@ -44,7 +44,7 @@ Verify User Cannot Create Project Using Special Chars In Resource Name Create Project With Special Chars In Resource Name And Expect Error # add close modal -Verify User Can Access Only Itw Owned Projects +Verify User Can Access Only Its Owned Projects [Tags] ODS-1868 [Setup] Set Variables For User Access Test Launch Data Science Project Main Page username=${TEST_USER_3.USERNAME} password=${TEST_USER_3.PASSWORD} @@ -79,7 +79,7 @@ Verify User Can Access Only Itw Owned Projects Project Should Be Listed project_title=${PRJ_A_USER4} Launch Data Science Project Main Page username=${OCP_ADMIN_USER.USERNAME} password=${OCP_ADMIN_USER.PASSWORD} ocp_user_auth_type=${OCP_ADMIN_USER.AUTH_TYPE} Capture Page Screenshot - Number Of Displayed Projects Should Be expected_number=1 + Number Of Displayed Projects Should Be expected_number=3 Project Should Be Listed project_title=${PRJ_1_USER3} Project Should Be Listed project_title=${PRJ_2_USER3} Project Should Be Listed project_title=${PRJ_A_USER4} @@ -91,7 +91,6 @@ Verify User Can Create A Data Science Project Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} resource_name=${PRJ_RESOURCE_NAME} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} - # Project's Owner Should Be expected_username=${OCP_ADMIN_USER.USERNAME} project_title=${PRJ_TITLE} Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} @@ -133,7 +132,7 @@ Verify User Can Create And Start A Workbench With Existent PV Storage Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} Create Workbench workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} - ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} + ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} ... pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} @@ -242,15 +241,18 @@ Verify User Can Delete A Data Connection Verify User Can Create A Workbench With Environment Variables [Tags] ODS-1864 ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} - ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} - ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} + # temporary not working with more variables..fix will come soon + # ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} + # ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} + ${envs_list}= Create List ${envs_var_secrets} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} + Create Workbench workbench_title=${WORKBENCH_TITLE}-envs workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${FALSE} envs=${envs_list} - Wait Until Workbench Is Started workbench_title=${workbench_title} - Launch Workbench workbench_title=${WORKBENCH_TITLE} - Check Environment Variables Exist env_variables=${envs_list} + Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE}-envs + Launch Workbench workbench_title=${WORKBENCH_TITLE}-envs + Log ${envs_list} + Check Environment Variables Exist exp_env_variables=${envs_list} Verify User Can Delete A Data Science Project @@ -260,6 +262,7 @@ Verify User Can Delete A Data Science Project Check Project Is Deleted namespace=${ns_name} # check workbenchs and resources get deleted too + *** Keywords *** Project Suite Setup Set Library Search Order SeleniumLibrary @@ -304,7 +307,7 @@ Check Workbench CR Is Deleted [Arguments] ${workbench_title} ${namespace} ${timeout}=10s ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} IF ${status} == ${TRUE} - Fail msg=The notebook CR for ${workbench_title} is still present, while it should have been deleted. + Fail msg=The notebook CR for ${workbench_title} is still present, while it should have been deleted. END Check Corresponding Data Connection Secret Exists @@ -318,7 +321,7 @@ Check Data Connection Secret Is Deleted [Arguments] ${dc_name} ${namespace} ${timeout}=10s ${status}= Run Keyword And Return Status Check Corresponding Data Connection Secret Exists dc_name=${dc_name} namespace=${namespace} IF ${status} == ${TRUE} - Fail msg=The secret for ${dc_name} data connection is still present, while it should have been deleted. + Fail msg=The secret for ${dc_name} data connection is still present, while it should have been deleted. END Check Corresponding PersistentVolumeClaim Exists @@ -332,7 +335,7 @@ Check Storage PersistentVolumeClaim Is Deleted [Arguments] ${storage_name} ${namespace} ${timeout}=10s ${status}= Run Keyword And Return Status Check Corresponding PersistentVolumeClaim Exists storage_name=${storage_name} namespace=${namespace} IF ${status} == ${TRUE} - Fail msg=The PVC for ${storage_name} storage is still present, while it should have been deleted. + Fail msg=The PVC for ${storage_name} storage is still present, while it should have been deleted. END Check Project Is Deleted @@ -340,20 +343,22 @@ Check Project Is Deleted Wait Until Keyword Succeeds 10s 1s Namespace Should Not Exist namespace=${namespace} Check Environment Variables Exist - [Arguments] ${env_variables} - Add and Run JupyterLab Code Cell in Active Notebook import os; print(os.environ["JUPYTER_IMAGE"].split("/")[-1].split(":")[0]) - FOR ${idx} ${env_variable} IN ENUMERATE @{env_variables} - ${k8s__type}= Set Variable ${env_variable}[k8s_type] - ${input_type}= Set Variable ${env_variable}[input_type] - Remove From Dictionary ${env_variable} k8s_type input_type - Select Environment Variable Types k8s_type=${k8s__type} input_type=${input_type} + [Arguments] ${exp_env_variables} + Open With JupyterLab Menu File New Notebook + Sleep 1s + Maybe Close Popup + Maybe Select Kernel + # Add and Run JupyterLab Code Cell in Active Notebook import os + FOR ${idx} ${env_variable_dict} IN ENUMERATE @{exp_env_variables} + Remove From Dictionary ${env_variable_dict} k8s_type input_type # IF "${input_type}" == "${KEYVALUE_TYPE}" - ${n_pairs}= Get Length ${env_variable.keys()} - FOR ${pair_idx} ${key} ${value} IN ENUMERATE &{env_variable} + ${n_pairs}= Get Length ${env_variable_dict.keys()} + FOR ${pair_idx} ${key} ${value} IN ENUMERATE &{env_variable_dict} Log ${pair_idx}-${key}-${value} - Run Keyword And Continue On Failure Run Cell And Check Output print(os.environ["${key}"]) ${value} - END + Run Keyword And Continue On Failure Run Cell And Check Output import os;print(os.environ["${key}"]) ${value} + Capture Page Screenshot + END # END END Open With JupyterLab Menu Edit Select All Cells - Open With JupyterLab Menu Edit Delete Cells \ No newline at end of file + Open With JupyterLab Menu Edit Delete Cells From 9337332f6bcb8c1a5fba09ed2726e44a12b00713 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 16 Nov 2022 15:58:12 +0100 Subject: [PATCH 49/70] fix test with multiple env variables Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 4 +-- .../Workbenches.resource | 25 ++++++++----------- .../415__ods_dashboard_projects.robot | 8 +++--- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 3f847abcf..5b90477a1 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -8,8 +8,6 @@ ${DS_PROJECT_XP}= xpath=//h1[text()="Data science projects"] ${TITLE_INPUT_XP}= xpath=//input[@id="manage-project-modal-name"] ${DESCR_INPUT_XP}= xpath=//textarea[@id="manage-project-modal-description"] ${RESOURCE_INPUT_XP}= xpath=//input[@id="resource-manage-project-modal-name"] -# ${TITLE_INPUT_XP}= xpath=//input[@aria-label="Project name"] -# ${DESCR_INPUT_XP}= xpath=//textarea[@aria-label="Project description"] ${GENERIC_CREATE_BTN_XP}= xpath=//button[text()="Create"] ${GENERIC_CANCEL_BTN_XP}= xpath=//button[text()="Cancel"] ${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project"] @@ -122,7 +120,7 @@ Delete All Data Science Projects From CLI [Documentation] Deletes all the Openshift Projects which have been created ... via DataScienceProjects feature, using OpenshiftLibrary ${res} ${projects_names}= Run And Return Rc And Output oc get projects -o json | jq '.items[] | select((.metadata.annotations."openshift.io/display-name" != null) and (.metadata.annotations."openshift.io/display-name" | endswith("[DSP]"))) | .metadata.name' - IF ${res} == ${EMPTY} + IF "${res}" == "${EMPTY}" Log msg=There are probably no DS Projects to delete in teardown. ELSE ${projects_names}= Replace String ${projects_names} " ${EMPTY} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index ebeeda6ac..9fc9cf1ad 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -68,39 +68,36 @@ Add Environment Variables In Workbench [Arguments] ${env_variables} Click Element ${WORKBENCH_ADD_VAR_BTN_XP} ${n_objects}= Get Length ${env_variables} - FOR ${idx} ${env_variable} IN ENUMERATE @{env_variables} + FOR ${idx} ${env_variable} IN ENUMERATE @{env_variables} start=1 ${k8s__type}= Set Variable ${env_variable}[k8s_type] ${input_type}= Set Variable ${env_variable}[input_type] Remove From Dictionary ${env_variable} k8s_type input_type - Select Environment Variable Types k8s_type=${k8s__type} input_type=${input_type} + Select Environment Variable Types k8s_type=${k8s__type} input_type=${input_type} variable_index=${idx} IF "${input_type}" == "${KEYVALUE_TYPE}" ${n_pairs}= Get Length ${env_variable.keys()} FOR ${pair_idx} ${key} ${value} IN ENUMERATE &{env_variable} Log ${pair_idx}-${key}-${value} Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//input[@aria-label="key of item ${pair_idx}"] - Input Text xpath=//input[@aria-label="key of item ${pair_idx}"] ${key} - Input Text xpath=//input[@aria-label="value of item ${pair_idx}"] ${value} - # Add Environment Variable key=${key} value=${value} type=${env_type} + Input Text xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${idx}]//input[@aria-label="key of item ${pair_idx}"] ${key} + Input Text xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${idx}]//input[@aria-label="value of item ${pair_idx}"] ${value} IF ${n_pairs}-${pair_idx} > 1 - Click Button Add another variable + Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${idx}]//button[text()="Add another variable"] END END END - Sleep 5s - Capture Page Screenshot - IF ${n_objects}-${idx} > 1 - Click Button Add more variables + IF ${n_objects}-${idx} > 0 + Click Button Add more variables END END Select Environment Variable Types - [Arguments] ${k8s_type} ${input_type} - Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button - Click Element xpath=//section[@aria-label="Environment variables"]//div[contains(@class,"pf-c-select")]/button + [Arguments] ${k8s_type} ${input_type} ${variable_index} + Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button + Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//div[contains(@class,"pf-c-select")]/button Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"] Click Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"] Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]//button[div/span[text()="Select one"]] - Click Element xpath=//section[@aria-label="Environment variables"]//button[div/span[text()="Select one"]] + Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//button[div/span[text()="Select one"]] Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] Click Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 427fe42d2..5680c9bab 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -241,17 +241,14 @@ Verify User Can Delete A Data Connection Verify User Can Create A Workbench With Environment Variables [Tags] ODS-1864 ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} - # temporary not working with more variables..fix will come soon - # ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} - # ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} - ${envs_list}= Create List ${envs_var_secrets} + ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} + ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workbench workbench_title=${WORKBENCH_TITLE}-envs workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${FALSE} envs=${envs_list} Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE}-envs Launch Workbench workbench_title=${WORKBENCH_TITLE}-envs - Log ${envs_list} Check Environment Variables Exist exp_env_variables=${envs_list} @@ -348,6 +345,7 @@ Check Environment Variables Exist Sleep 1s Maybe Close Popup Maybe Select Kernel + Sleep 3s # Add and Run JupyterLab Code Cell in Active Notebook import os FOR ${idx} ${env_variable_dict} IN ENUMERATE @{exp_env_variables} Remove From Dictionary ${env_variable_dict} k8s_type input_type From 3f15342b3bfcb59a9be3199cafcf15666323a414 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 16 Nov 2022 16:11:46 +0100 Subject: [PATCH 50/70] fix teardown to remove specific projects Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 5680c9bab..183eb1f06 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -263,16 +263,20 @@ Verify User Can Delete A Data Science Project *** Keywords *** Project Suite Setup Set Library Search Order SeleniumLibrary + ${to_delete}= Create List ${PRJ_TITLE} + Set Suite Variable ${PROJECTS_TO_DELETE} ${to_delete} # RHOSi Setup Project Suite Teardown Close All Browsers - Delete All Data Science Projects From CLI + # Delete All Data Science Projects From CLI + Delete Data Science Projects From CLI ocp_projects=${PROJECTS_TO_DELETE} Set Variables For User Access Test Set Suite Variable ${PRJ_1_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#1 Set Suite Variable ${PRJ_2_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#2 Set Suite Variable ${PRJ_A_USER4} ${PRJ_TITLE}-${TEST_USER_4.USERNAME}-#A + Append To List ${PROJECTS_TO_DELETE} ${PRJ_1_USER3} ${PRJ_2_USER3} ${PRJ_A_USER4} Launch Data Science Project Main Page [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} From f5e48d14b4ff2dec3c9ac5aafe0b6fa15f3770c1 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 16 Nov 2022 17:53:33 +0100 Subject: [PATCH 51/70] fix teardown to remove specific projects Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 11 +++++++---- .../415__ods_dashboard_projects.robot | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 5b90477a1..c2db744ec 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -107,12 +107,15 @@ Get Openshift Namespace From Data Science Project Delete Data Science Projects From CLI [Documentation] Deletets the Openshift Projects using OpenshiftLibrary [Arguments] ${ocp_projects} - FOR ${project} IN @{ocp_projects} - ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project name=${project} - IF ${present} == ${FALSE} + FOR ${displayed_name} IN @{ocp_projects} + ${dp_with_suffix}= Set Variable ${displayed_name}\[DSP] + ${project_k8s_name}= Run oc get projects -o json | jq '.items[] | select((.metadata.annotations."openshift.io/display-name" != null) and (.metadata.annotations."openshift.io/display-name"=="${dp_with_suffix}")) | .metadata.name' + ${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} Continue For Loop ELSE - OpenshiftLibrary.Oc Delete kind=Project name=${project} + OpenshiftLibrary.Oc Delete kind=Project name=${project_k8s_name} END END diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 183eb1f06..472ff29cb 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -251,7 +251,6 @@ Verify User Can Create A Workbench With Environment Variables Launch Workbench workbench_title=${WORKBENCH_TITLE}-envs Check Environment Variables Exist exp_env_variables=${envs_list} - Verify User Can Delete A Data Science Project [Tags] ODS-1784 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} From 67260c7835459f80922869c220bd93f1f66a49e4 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 16 Nov 2022 19:22:47 +0100 Subject: [PATCH 52/70] fix launch dashboard Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 472ff29cb..7f5804ca1 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -279,7 +279,8 @@ Set Variables For User Access Test Launch Data Science Project Main Page [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} - Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} browser_options=${BROWSER.OPTIONS} + Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} + dashboard_url=${ODH_DASHBOARD_URL} browser={BROWSER.NAME} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Project With Empty Title And Expect Error From 9ec116882f907518e0ad668d5fd27a3e4c661c55 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 16 Nov 2022 19:37:56 +0100 Subject: [PATCH 53/70] fix launch dashboard Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 7f5804ca1..9da72b97e 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -280,7 +280,7 @@ Set Variables For User Access Test Launch Data Science Project Main Page [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} - dashboard_url=${ODH_DASHBOARD_URL} browser={BROWSER.NAME} browser_options=${BROWSER.OPTIONS} + ... dashboard_url=${ODH_DASHBOARD_URL} browser={BROWSER.NAME} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Project With Empty Title And Expect Error From 2ef1b41fd74d980c8c2296615eb2cd672d5bb8ab Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 10:36:00 +0100 Subject: [PATCH 54/70] fix launch dashboard Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 9da72b97e..55d1f5509 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -280,7 +280,7 @@ Set Variables For User Access Test Launch Data Science Project Main Page [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} - ... dashboard_url=${ODH_DASHBOARD_URL} browser={BROWSER.NAME} browser_options=${BROWSER.OPTIONS} + ... dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Project With Empty Title And Expect Error From db48a2082fe9d2236ce0aa118ee4a46843222f6b Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 11:51:59 +0100 Subject: [PATCH 55/70] reduce timeout of wait + add modal close + fix modal closure Signed-off-by: bdattoma --- tests/Resources/Common.robot | 2 +- tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot | 2 +- .../415__ods_dashboard_projects.robot | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Resources/Common.robot b/tests/Resources/Common.robot index 62c92cb5a..77434091e 100644 --- a/tests/Resources/Common.robot +++ b/tests/Resources/Common.robot @@ -194,7 +194,7 @@ Is Generic Modal Displayed [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s IF ${partial_match} == ${TRUE} ${is_displayed}= Run Keyword And Return Status - ... Page Should Contain Element xpath=//*[contains(id,"${id}")] + ... Page Should Contain Element xpath=//*[contains(@id,"${id}")] ELSE ${is_displayed}= Run Keyword And Return Status ... Page Should Contain Element xpath=//*[@id="${id}")] diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index c41a4d3fd..434329457 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -704,7 +704,7 @@ Open Application Switcher Menu Maybe Wait For Dashboard Loading Spinner Page [Documentation] Detecs the loading symbol (spinner) and wait for it to disappear. ... If the spinner does not appear, the keyword ignores the error. - [Arguments] ${timeout}=10s + [Arguments] ${timeout}=5s Run Keyword And Ignore Error Run Keywords ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} ... AND diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 55d1f5509..162b74c2f 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -37,12 +37,12 @@ ${DC_S3_TYPE}= Object storage Verify User Cannot Create Project With Empty Fields [Tags] ODS-1783 Create Project With Empty Title And Expect Error - # add close modal + Close Generic Modal If Present Verify User Cannot Create Project Using Special Chars In Resource Name [Tags] ODS-1783 Create Project With Special Chars In Resource Name And Expect Error - # add close modal + Close Generic Modal If Present Verify User Can Access Only Its Owned Projects [Tags] ODS-1868 From 9bf9b8572ca603a8ab941f5a46db9816494d1a6f Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 13:31:04 +0100 Subject: [PATCH 56/70] add some docs + minor fixes Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 162b74c2f..9fefd66b9 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -36,16 +36,21 @@ ${DC_S3_TYPE}= Object storage *** Test Cases *** Verify User Cannot Create Project With Empty Fields [Tags] ODS-1783 + [Documentation] Verifies users is not allowed to create a project with Empty title Create Project With Empty Title And Expect Error Close Generic Modal If Present Verify User Cannot Create Project Using Special Chars In Resource Name - [Tags] ODS-1783 + [Tags] ODS-1875 + [Documentation] Verifies users is not allowed to create a project with a custom resource name + ... containing special characters like "@" or "!" Create Project With Special Chars In Resource Name And Expect Error Close Generic Modal If Present Verify User Can Access Only Its Owned Projects [Tags] ODS-1868 + [Documentation] Verifies each user can access only thei owned projects. Except for + ... cluster and dedicated admins which should be able to fetch all the DS Projects [Setup] Set Variables For User Access Test Launch Data Science Project Main Page username=${TEST_USER_3.USERNAME} password=${TEST_USER_3.PASSWORD} Open Data Science Projects Home Page @@ -86,6 +91,7 @@ Verify User Can Access Only Its Owned Projects Verify User Can Create A Data Science Project [Tags] ODS-1775 + [Documentation] Verifies users can create a DS project [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} resource_name=${PRJ_RESOURCE_NAME} @@ -96,6 +102,7 @@ Verify User Can Create A Data Science Project Verify User Can Create And Start A Workbench With Ephimeral Storage [Tags] ODS-1812 + [Documentation] Verifies users can create workbench using Ephemeral storage ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workbench workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} @@ -106,12 +113,12 @@ Verify User Can Create And Start A Workbench With Ephimeral Storage ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STARTING} - # the continue on failure should be temporary Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Create A PV Storage [Tags] ODS-1819 + [Documentation] Verifies users can create PersistenVolume storage ${pv_name}= Set Variable ${PV_BASENAME}-A ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -127,6 +134,7 @@ Verify User Can Create A PV Storage Verify User Can Create And Start A Workbench With Existent PV Storage [Tags] ODS-1814 + [Documentation] Verifies users can create a workbench and connect an existent PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-existent Open Data Science Project Details Page project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} @@ -136,13 +144,13 @@ Verify User Can Create And Start A Workbench With Existent PV Storage ... pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} - # continue on failure is temporary Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_2_TITLE} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} Verify User Can Create And Start A Workbench Adding A New PV Storage [Tags] ODS-1816 + [Documentation] Verifies users can create a workbench and connect a new PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-new ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -153,7 +161,6 @@ Verify User Can Create And Start A Workbench Adding A New PV Storage Reload Page Wait Until Project Is Open project_title=${PRJ_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_3_TITLE} status=${WORKBENCH_STATUS_STARTING} - # the continue on failure should be temporary Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_3_TITLE} Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_3_TITLE} namespace=${ns_name} Reload Page @@ -165,6 +172,7 @@ Verify User Can Create And Start A Workbench Adding A New PV Storage Verify User Can Stop A Workbench [Tags] ODS-1817 + [Documentation] Verifies users can stop a running workbench from project details page Open Data Science Project Details Page project_title=${PRJ_TITLE} Stop Workbench workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} Stop Workbench workbench_title=${WORKBENCH_TITLE} @@ -172,16 +180,17 @@ Verify User Can Stop A Workbench Verify User Can Launch A Workbench [Tags] ODS-1815 + [Documentation] Verifies users can launch/open a running workbench from project details page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Start Workbench workbench_title=${WORKBENCH_TITLE} Launch Workbench workbench_title=${WORKBENCH_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} - # Switch Window Open Data Hub Verify User Can Stop A Workbench From Projects Home Page [Tags] ODS-1823 + [Documentation] Verifies users can stop a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} @@ -191,16 +200,17 @@ Verify User Can Stop A Workbench From Projects Home Page Verify User Can Start And Launch A Workbench From Projects Home Page [Tags] ODS-1818 + [Documentation] Verifies users can launch/open a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Launch Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} - # Switch Window Open Data Hub Verify User Can Delete A Workbench [Tags] ODS-1813 + [Documentation] Verifies users can delete a workbench ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Delete Workbench workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} @@ -210,6 +220,7 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Verify User Can Delete A Persistent Storage [Tags] ODS-1824 + [Documentation] Verifies users can delete a PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-TO-DELETE ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -222,6 +233,7 @@ Verify User Can Delete A Persistent Storage Verify User Cand Add A S3 Data Connection [Tags] ODS-1825 + [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${S3.AWS_ACCESS_KEY_ID} @@ -231,6 +243,7 @@ Verify User Cand Add A S3 Data Connection Verify User Can Delete A Data Connection [Tags] ODS-1826 + [Documentation] Verifies users can delete a Data connection ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Delete Data Connection name=${DC_S3_NAME} press_cancel=${True} @@ -240,6 +253,7 @@ Verify User Can Delete A Data Connection Verify User Can Create A Workbench With Environment Variables [Tags] ODS-1864 + [Documentation] Verifies users can create a workbench and inject environment variables during creation ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} @@ -253,6 +267,7 @@ Verify User Can Create A Workbench With Environment Variables Verify User Can Delete A Data Science Project [Tags] ODS-1784 + [Documentation] Verifies users can delete a Data Science project ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Delete Data Science Project project_title=${PRJ_TITLE} Check Project Is Deleted namespace=${ns_name} @@ -289,7 +304,7 @@ Create Project With Empty Title And Expect Error Create Project With Special Chars In Resource Name And Expect Error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ - Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} resource_name=ods-ci-@-project#name + Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${PRJ_TITLE}-spec-chars description=${EMPTY} resource_name=ods-ci-@-project#name Check Corresponding Namespace Exists [Arguments] ${project_title} From 8e72894d88855ee15f2407c09afc44601105f4a7 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 14:59:44 +0100 Subject: [PATCH 57/70] add rhosi setup/teardown Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 9fefd66b9..8c1341367 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -279,12 +279,13 @@ Project Suite Setup Set Library Search Order SeleniumLibrary ${to_delete}= Create List ${PRJ_TITLE} Set Suite Variable ${PROJECTS_TO_DELETE} ${to_delete} - # RHOSi Setup + RHOSi Setup Project Suite Teardown Close All Browsers # Delete All Data Science Projects From CLI Delete Data Science Projects From CLI ocp_projects=${PROJECTS_TO_DELETE} + RHOSi Teardown Set Variables For User Access Test Set Suite Variable ${PRJ_1_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#1 From a6a2c1d6f2a32615d7eb9880bf9d435f3a5e5043 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 15:59:48 +0100 Subject: [PATCH 58/70] add documentation attributes Signed-off-by: bdattoma --- tests/Resources/Common.robot | 10 ++++++++ .../ODHDataScienceProject/Projects.resource | 22 ++++++++++++++---- .../ODHDataScienceProject/Storages.resource | 10 +++++++- .../Workbenches.resource | 23 ++++++++++++++++++- .../415__ods_dashboard_projects.robot | 18 +++++++++++++++ 5 files changed, 77 insertions(+), 6 deletions(-) diff --git a/tests/Resources/Common.robot b/tests/Resources/Common.robot index 77434091e..eaa4340fd 100644 --- a/tests/Resources/Common.robot +++ b/tests/Resources/Common.robot @@ -191,6 +191,9 @@ Get OAuth Cookie [Return] ${cookie.value} Is Generic Modal Displayed + [Documentation] Checks if a modal window is displayed on the page. + ... It assumes the html "id" contains "pf-modal", but it can be + ... piloted with ${id} and ${partial_match} arguments [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s IF ${partial_match} == ${TRUE} ${is_displayed}= Run Keyword And Return Status @@ -202,6 +205,9 @@ Is Generic Modal Displayed [Return] ${is_displayed} Wait Until Modal Disappears + [Documentation] Waits until a modal window disappears from the page. + ... It assumes the html "id" contains "pf-modal", but it can be + ... piloted with ${id} and ${partial_match} arguments [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s ${is_modal}= Is Generic Modal Displayed IF ${is_modal} == ${TRUE} @@ -215,6 +221,9 @@ Wait Until Modal Disappears END Wait Until Modal Appears + [Documentation] Waits until a modal window appears on the page. + ... It assumes the html "id" contains "pf-modal", but it can be + ... piloted with ${id} and ${partial_match} arguments [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s ${is_modal}= Is Generic Modal Displayed IF ${is_modal} == ${FALSE} @@ -228,6 +237,7 @@ Wait Until Modal Appears END Close Generic Modal If Present + [Documentation] Close a modal window from the page and waits for it to disappear ${is_modal}= Is Generic Modal Displayed IF ${is_modal} == ${TRUE} Click Element xpath=//button[@aria-label="Close"] diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index c2db744ec..4c2ec5a85 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -42,6 +42,8 @@ Open Data Science Project Details Page Maybe Wait For Dashboard Loading Spinner Page Delete Data Science Project + [Documentation] Deletes a given DS project. It allows cancelling the operation + ... by setting the ${press_cancel} argument [Arguments] ${project_title} ${press_cancel}=${FALSE} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} @@ -53,23 +55,28 @@ Delete Data Science Project ... additional_msg=It will destroy all workbenches, storages, data connections and other resources in ${project_title} Wait Until Project Is Open + [Documentation] Waits until a DS Project Details page is laoded [Arguments] ${project_title} Wait Until Page Contains Element xpath=//h1[contains(text(),"${project_title}")] timeout=30 Maybe Wait For Dashboard Loading Spinner Page Project Should Be Listed + [Documentation] Checks a Project is available in DS Project home page [Arguments] ${project_title} Run keyword And Continue On Failure Page Should Contain Element xpath=//td/div/a[text()="${project_title}"] Project Should Not Be Listed + [Documentation] Checks a Project is not available in DS Project home page [Arguments] ${project_title} Run keyword And Continue On Failure Page Should Not Contain Element xpath=//td/div/a[text()="${project_title}"] Project's Owner Should Be + [Documentation] Checks if the owner of a DS project is displayed and corresponds to the expected one [Arguments] ${project_title} ${expected_username} Run keyword And Continue On Failure Page Should Contain Element xpath=//td[div/a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project + [Documentation] Creates a DS Project with the given ${title}, ${description} and ${resource_name} [Arguments] ${title} ${description} ${resource_name}=${NONE} Click Button ${PROJECT_CREATE_BTN_XP} Wait Until Page Contains Element ${TITLE_INPUT_XP} @@ -87,6 +94,7 @@ Create Data Science Project Wait Until Project Is Open project_title=${title} Validate Generated Resource Name + [Documentation] Checks if the generated resource name matches the expected validation regex [Arguments] ${project_title} ${generated_res_name}= Get Element Attribute ${RESOURCE_INPUT_XP} value ${lower}= Convert To Lower Case ${project_title} @@ -95,6 +103,7 @@ Validate Generated Resource Name Should Be Equal As Strings ${generated_res_name} ${expected} Get Openshift Namespace From Data Science Project + [Documentation] Gets the resource name of a DS Project starting from the Displayed Name [Arguments] ${project_title} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} @@ -132,6 +141,7 @@ Delete All Data Science Projects From CLI END Workbench Status Should Be From Projects Home Page + [Documentation] Checks the workbench status is the expected one, from the DS Project home page [Arguments] ${workbench_title} ${status} ${project_title} ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} @@ -139,7 +149,7 @@ Workbench Status Should Be From Projects Home Page Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[@data-label="Status"]//div[div/label[@for="${workbench_cr_name}"]]/div/p[text()="${status}"] Start Workbench From Projects Home Page - [Documentation] Trigger the workbench "start" process from DS Projects home page. + [Documentation] Triggers the workbench "start" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} @@ -158,7 +168,7 @@ Start Workbench From Projects Home Page Wait Until Workbench Is Started From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} Stop Workbench From Projects Home Page - [Documentation] Trigger the workbench "stop" process from DS Projects home page. + [Documentation] Triggers the workbench "stop" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} ${press_cancel}=${FALSE} @@ -178,16 +188,18 @@ Stop Workbench From Projects Home Page Wait Until Workbench Is Stopped From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} Wait Until Workbench Is Started From Projects Home Page + [Documentation] Waits until the workbench status is "RUNNING", from the DS Project home page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} Wait Until Workbench Is Stopped From Projects Home Page + [Documentation] Waits until the workbench status is "STOPPED", from the DS Project home page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} Launch Workbench From Projects Home Page + [Documentation] Launches a running workbench from DS Projects home page. [Arguments] ${workbench_title} ${project_title} - # Open Data Science Projects Home Page ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} Click Element xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] @@ -197,12 +209,13 @@ Launch Workbench From Projects Home Page END Workbench Launch Link Should Be Disabled + [Documentation] Checks the workbench launch link is disabled from DS Projects home page. [Arguments] ${workbench_title} ${project_title} - # Element Should Be Disabled xpath=//tr[td/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] ${link_status}= Get Element Attribute xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled Should Be Equal As Strings ${link_status} true Get All Displayed Projects + [Documentation] Gets all the DS projects visible in the DS Projects home page ${projects_names}= Create List ${elements}= Get WebElements xpath=//td[@data-label="Name"]/div/a FOR ${element} IN @{elements} @@ -212,6 +225,7 @@ Get All Displayed Projects [Return] ${projects_names} Number Of Displayed Projects Should Be + [Documentation] Checks the number the DS projects visible in the DS Projects home page is expected [Arguments] ${expected_number} ${listed}= Get All Displayed Projects ${n_listed}= Get Length ${listed} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 8b3a2d246..2677be9cc 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -17,6 +17,7 @@ ${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add") *** Keywords *** Storage Should Be Listed + [Documentation] Checks storage is listed in DS Project details page [Arguments] ${name} ${description} ${type} ${connected_workbench} Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/p[text()="${description}"] @@ -30,11 +31,13 @@ Storage Should Be Listed END Storage Should Not Be Listed + [Documentation] Checks storage is not listed in DS Project details page [Arguments] ${name} Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] Storage Size Should Be - [Documentation] https://kubernetes.io/docs/reference/kubectl/jsonpath/ + [Documentation] Checks displayed PV size corresponds to PV size in Openshift. + ... Query on Openshift annotation based on this syntax: https://kubernetes.io/docs/reference/kubectl/jsonpath/ [Arguments] ${name} ${size} ${namespace} Click Element ${STORAGE_SECTION_XP}//tr[td/h4/div[text()="${name}"]]/td/button[contains(@id,"expand-toggle")] Wait Until Element Is Visible ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"] @@ -47,6 +50,7 @@ Storage Size Should Be Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi Create PersistenVolume Storage + [Documentation] Create a PersistenVolume storage in DS Project details page [Arguments] ${project_title} ${name} ${description} ${size} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} Click Button ${STORAGE_ADD_BTN_1_XP} Fill In New PV Data ${name} ${description} ${size} ${connected_workbench} @@ -60,6 +64,7 @@ Create PersistenVolume Storage Wait Until Project Is Open project_title=${project_title} Fill In New PV Data + [Documentation] Compiles the modal for creating a new PersistenVolume storage in DS Project details page [Arguments] ${name} ${description} ${size} ${connected_workbench}=${NONE} ${is_storage_modal}= Run Keyword And Return Status Page Should Contain Element ${STORAGE_ADD_BTN_2_XP} Wait Until Page Contains Element ${STORAGE_NAME_INPUT_XP} @@ -86,6 +91,7 @@ Fill In New PV Data END Set Connection Between PV And Workbench + [Documentation] Connects a PV to an existent workbench [Arguments] ${workbench_title} ${mount_dir} Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"] Click Element xpath=//button[@aria-label="Options menu"] @@ -96,11 +102,13 @@ Set Connection Between PV And Workbench Input Text ${STORAGE_MOUNT_DIR_INPUT_XP} ${mount_dir} Delete Storage + [Documentation] Deletes a cluster storage from DS Project details page [Arguments] ${name} ${press_cancel}=${FALSE} Click Action From Actions Menu item_title=${name} item_type=storage action=Delete Handle Deletion Confirmation Modal item_title=${name} item_type=storage press_cancel=${press_cancel} Get Openshift PVC From Storage + [Documentation] Retrieves the PVC resource name from Openshift given the Displayed Name in DS Project details page [Arguments] ${name} ${namespace} ${rc} ${pvc_name}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].metadata.name}' [Return] ${rc} ${pvc_name} \ No newline at end of file diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 9fc9cf1ad..02adeafd8 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -27,7 +27,8 @@ ${KEYVALUE_TYPE}= Key / value *** Keywords *** Create Workbench [Documentation] Creates a new workbench in a Data Science project. It assumes - ... the DS Project deta + ... the DS Project deta. It allows to add new or existent PV storage, + ... add Environment variables and select Jupyter image [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${press_cancel}=${FALSE} ${envs}=${NONE} Click Element ${WORKBENCH_CREATE_BTN_XP} @@ -65,6 +66,7 @@ Create Workbench Wait Until Project Is Open project_title=${prj_title} Add Environment Variables In Workbench + [Documentation] Adds the environment variables through the workbench creation page [Arguments] ${env_variables} Click Element ${WORKBENCH_ADD_VAR_BTN_XP} ${n_objects}= Get Length ${env_variables} @@ -91,6 +93,7 @@ Add Environment Variables In Workbench END Select Environment Variable Types + [Documentation] Selects the type of environment variable in the workbench creation page: Secret vs Config Map [Arguments] ${k8s_type} ${input_type} ${variable_index} Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//div[contains(@class,"pf-c-select")]/button @@ -102,12 +105,14 @@ Select Environment Variable Types Click Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] Remove All Environment Variables + [Documentation] Removes all the added environment variables from the workbench creation page ${remove_buttons}= Get WebElements xpath=//section[@id="environment-variable"]//button FOR ${rb} IN @{remove_buttons} Click Element ${rb} END Select An Existent PV + [Documentation] Selects an existent PV Storage in the workbench creation page [Arguments] ${name} Run Keyword And Continue On Failure Wait Until Element Is Enabled xpath=//input[@placeholder="Select a persistent storage"] Click Element xpath=//input[@placeholder="Select a persistent storage"] @@ -116,6 +121,7 @@ Select An Existent PV Click Element xpath=//ul/li/button[text()="${name}"] Select Workbench Jupyter Image + [Documentation] Selects a Jupyter image in the workbench creation page [Arguments] ${image_name} Wait Until Page Contains Element ${WORKBENCH_IMAGE_MENU_BTN_XP} Click Button ${WORKBENCH_IMAGE_MENU_BTN_XP} @@ -123,6 +129,7 @@ Select Workbench Jupyter Image Click Element ${WORKBENCH_IMAGE_ITEM_BTN_XP}/span[text()="${image_name}"] Select Workbench Container Size + [Documentation] Selects the container size in the workbench creation page [Arguments] ${size_name}=Small Wait Until Page Contains Element ${WORKBENCH_SIZE_MENU_BTN_XP} Click Button ${WORKBENCH_SIZE_MENU_BTN_XP} @@ -130,22 +137,27 @@ Select Workbench Container Size Click Element ${WORKBENCH_SIZE_ITEM_BTN_XP}/span[text()="${size_name}"] Workbench Should Be Listed + [Documentation] Checks a workbench is listed in the DS Project details page [Arguments] ${workbench_title} Run keyword And Continue On Failure Wait Until Page Contains Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] Workbench Should Not Be Listed + [Documentation] Checks a workbench is not listed in the DS Project details page [Arguments] ${workbench_title} Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] Workbench Status Should Be + [Documentation] Checks a workbench status is the expected one in the DS Project details page [Arguments] ${workbench_title} ${status} Run keyword And Continue On Failure Page Should Contain Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//p[text()="${status}"] Wait Until Workbench Is Started + [Documentation] Waits until workbench status is "RUNNING" in the DS Project details page [Arguments] ${workbench_title} ${timeout}=30s Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} Start Workbench + [Documentation] Starts a workbench from the DS Project details page [Arguments] ${workbench_title} ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} IF ${is_stopped} == ${TRUE} @@ -156,6 +168,7 @@ Start Workbench Wait Until Workbench Is Started workbench_title=${workbench_title} Access To Workbench + [Documentation] Gets access to a workbench from DS Project details page after it got launched [Arguments] ${username}=${TEST_USER.USERNAME} ${password}=${TEST_USER.PASSWORD} ${auth_type}=${TEST_USER.AUTH_TYPE} Switch Window NEW Run Keyword And Warn On Failure Login To Openshift ${username} ${password} ${auth_type} @@ -165,6 +178,7 @@ Access To Workbench Maybe Close Popup Launch Workbench + [Documentation] Launches a workbench from DS Project details page [Arguments] ${workbench_title} ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} @@ -175,6 +189,7 @@ Launch Workbench END Stop Workbench + [Documentation] Stops a workbench from DS Project details page [Arguments] ${workbench_title} ${press_cancel}=${FALSE} ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} @@ -186,6 +201,7 @@ Stop Workbench END Handle Stop Workbench Confirmation Modal + [Documentation] Handles modal to stop workbench [Arguments] ${press_cancel}=${FALSE} Run Keyword And Continue On Failure Page Should Contain Stop workbench? Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. @@ -200,6 +216,7 @@ Handle Stop Workbench Confirmation Modal END Click Action From Actions Menu + [Documentation] Clicks an action from Actions menu (3-dots menu on the right) [Arguments] ${item_title} ${item_type} ${action} Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] @@ -207,6 +224,7 @@ Click Action From Actions Menu Handle Deletion Confirmation Modal + [Documentation] Handles confirmation modal on item deletion [Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} ${additional_msg}=${NONE} Wait Until Modal Appears Run Keyword And Continue On Failure Page Should Contain Delete ${item_type}? @@ -227,11 +245,13 @@ Handle Deletion Confirmation Modal Delete Workbench + [Documentation] Deletes a workbench [Arguments] ${workbench_title} ${press_cancel}=${FALSE} Click Action From Actions Menu item_title=${workbench_title} item_type=workbench action=Delete Handle Deletion Confirmation Modal item_title=${workbench_title} item_type=workbench press_cancel=${press_cancel} Check Launched Workbench Is The Correct One + [Documentation] Checks if the launched workbench is the expected one [Arguments] ${workbench_title} ${image} ${namespace} ${_} ${cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} ${current_url}= Get Location @@ -241,6 +261,7 @@ Check Launched Workbench Is The Correct One Spawned Image Check ${IMAGE_ID_MAPPING}[${image}] Get Openshift Notebook CR From Workbench + [Documentation] Retrieves name of Notebook CR corresponding to a workbench [Arguments] ${workbench_title} ${namespace} ${rc} ${cr_name}= Run And Return Rc And Output oc get notebook -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${workbench_title}")].metadata.name}' [Return] ${rc} ${cr_name} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 8c1341367..43ab165d8 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -276,44 +276,55 @@ Verify User Can Delete A Data Science Project *** Keywords *** Project Suite Setup + [Documentation] Suite setup steps for testing DSG. 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 Project Suite Teardown + [Documentation] Suite teardown steps after testing DSG. 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 Set Variables For User Access Test + [Documentation] Creates titles for testing projects used in basic access testing Set Suite Variable ${PRJ_1_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#1 Set Suite Variable ${PRJ_2_USER3} ${PRJ_TITLE}-${TEST_USER_3.USERNAME}-#2 Set Suite Variable ${PRJ_A_USER4} ${PRJ_TITLE}-${TEST_USER_4.USERNAME}-#A Append To List ${PROJECTS_TO_DELETE} ${PRJ_1_USER3} ${PRJ_2_USER3} ${PRJ_A_USER4} Launch Data Science Project Main Page + [Documentation] Launch DS Projects page in RHODS Dashboard using a given user [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} ... dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Project With Empty Title And Expect Error + [Documentation] Tries to create a DS project with emtpy title and checks the Selenium error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} Create Project With Special Chars In Resource Name And Expect Error + [Documentation] Tries to create a DS project by overwriting the resource name + ... with a custom one containing special characters, and checks the Selenium error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${PRJ_TITLE}-spec-chars description=${EMPTY} resource_name=ods-ci-@-project#name Check Corresponding Namespace Exists + [Documentation] Checks if a DS Project has its own corresponding Openshift namespace [Arguments] ${project_title} ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title} Oc Get kind=Project name=${ns_name} [Return] ${ns_name} Check Corresponding Notebook CR Exists + [Documentation] Checks if a workbench has its own Notebook CustomResource [Arguments] ${workbench_title} ${namespace} ${res} ${response}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} IF "${response}" == "${EMPTY}" @@ -321,6 +332,7 @@ Check Corresponding Notebook CR Exists END Check Workbench CR Is Deleted + [Documentation] Checks if when a workbench is deleted its Notebook CustomResource gets deleted too [Arguments] ${workbench_title} ${namespace} ${timeout}=10s ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} IF ${status} == ${TRUE} @@ -328,6 +340,7 @@ Check Workbench CR Is Deleted END Check Corresponding Data Connection Secret Exists + [Documentation] Checks if a S3 Data Connection has its corresponding Openshift Secret [Arguments] ${dc_name} ${namespace} ${res} ${response}= Get Openshift Secret From Data Connection dc_name=${dc_name} namespace=${namespace} IF "${response}" == "${EMPTY}" @@ -335,6 +348,7 @@ Check Corresponding Data Connection Secret Exists END Check Data Connection Secret Is Deleted + [Documentation] Checks if when a S3 Data Connection is deleted its Openshift Secret gets deleted too [Arguments] ${dc_name} ${namespace} ${timeout}=10s ${status}= Run Keyword And Return Status Check Corresponding Data Connection Secret Exists dc_name=${dc_name} namespace=${namespace} IF ${status} == ${TRUE} @@ -342,6 +356,7 @@ Check Data Connection Secret Is Deleted END Check Corresponding PersistentVolumeClaim Exists + [Documentation] Checks if a PV cluster storage has its corresponding Openshift PersistentVolumeClaim [Arguments] ${storage_name} ${namespace} ${res} ${response}= Get Openshift PVC From Storage name=${storage_name} namespace=${namespace} IF "${response}" == "${EMPTY}" @@ -349,6 +364,7 @@ Check Corresponding PersistentVolumeClaim Exists END Check Storage PersistentVolumeClaim Is Deleted + [Documentation] Checks if when a PV cluster storage is deleted its Openshift PersistentVolumeClaim gets deleted too [Arguments] ${storage_name} ${namespace} ${timeout}=10s ${status}= Run Keyword And Return Status Check Corresponding PersistentVolumeClaim Exists storage_name=${storage_name} namespace=${namespace} IF ${status} == ${TRUE} @@ -356,10 +372,12 @@ Check Storage PersistentVolumeClaim Is Deleted END Check Project Is Deleted + [Documentation] Checks if when a DS Project is deleted its Openshift namespace gets deleted too [Arguments] ${namespace} Wait Until Keyword Succeeds 10s 1s Namespace Should Not Exist namespace=${namespace} Check Environment Variables Exist + [Documentation] Runs code in JupyterLab to check if the expected environment variables are available [Arguments] ${exp_env_variables} Open With JupyterLab Menu File New Notebook Sleep 1s From e6d4a8a5b0cb6bc824d3550ef03b44622c06b164 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 16:02:13 +0100 Subject: [PATCH 59/70] add documentation attributes for DC resource file Signed-off-by: bdattoma --- .../ODHDataScienceProject/DataConnections.resource | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 96d51c609..428c3234e 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -13,11 +13,11 @@ ${S3_REGION_DC_INPUT_XP}= xpath=//input[@aria-label="AWS field AWS_DEFA ${DC_SECTION_XP}= xpath=//div[div//h4[@id="data-connections"]] ${DC_ADD_BTN_1_XP}= ${DC_SECTION_XP}/div/button[text()="Add data connection"] ${DC_ADD_BTN_2_XP}= xpath=//footer/button[text()="Add data connection"] -# ${DC_DELETE_BTN_XP}= xpath=//button[text()="Delete data connection"] *** Keywords *** Create S3 Data Connection + [Documentation] Creates a S3 Data Connection from DS Project details page [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${aws_s3_endpoint} ${aws_region} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} Click Button ${DC_ADD_BTN_1_XP} Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} @@ -36,6 +36,7 @@ Create S3 Data Connection Wait Until Project Is Open project_title=${project_title} Data Connection Should Be Listed + [Documentation] Checks a Data Connection is listed in DS Project details page [Arguments] ${name} ${type} ${connected_workbench} Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()=" ${type}"] @@ -49,15 +50,18 @@ Data Connection Should Be Listed END Data Connection Should Not Be Listed + [Documentation] Checks a Data Connection is not listed in DS Project details page [Arguments] ${name} Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] Get Openshift Secret From Data Connection + [Documentation] Retrieves name of Openshift secret corresponding to a given S3 Data Connection based on Dispayed name in DS Project details page [Arguments] ${dc_name} ${namespace} ${rc} ${secret_name}= Run And Return Rc And Output oc get secret -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${dc_name}")].metadata.name}' [Return] ${rc} ${secret_name} Delete Data Connection + [Documentation] Deletes a Data Connection from DS Project details page [Arguments] ${name} ${press_cancel}=${FALSE} Click Action From Actions Menu item_title=${name} item_type=data connection action=Delete Handle Deletion Confirmation Modal item_title=${name} item_type=data connection press_cancel=${press_cancel} \ No newline at end of file From 11ea825f529ca3aa14f12084abd85af7fc45c9f1 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 16:20:19 +0100 Subject: [PATCH 60/70] add QG tags + smoke tests Signed-off-by: bdattoma --- .../ODHDataScienceProject/Projects.resource | 1 + .../415__ods_dashboard_projects.robot | 50 ++++++++++++------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 4c2ec5a85..4fe9a7497 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -14,6 +14,7 @@ ${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project ${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"] ${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"] ${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"] +${SPAWNER_LINK}= xpath=//a[text()="Launch Jupyter"] *** Keywords *** diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 43ab165d8..efd342991 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -30,25 +30,37 @@ ${PV_SIZE}= 2 ${DC_S3_NAME}= ods-ci-s3 ${DC_S3_ENDPOINT}= custom.endpoint.s3.com ${DC_S3_REGION}= ods-ci-region -${DC_S3_TYPE}= Object storage +${DC_S3_TYPE}= Object storage[Tags] Sanity ODS *** Test Cases *** +Verify Data Science Project Page Is Accessible + [Tags] Smoke ODS-1876 + Open Data Science Projects Home Page + Page Should Contain Element ${PROJECT_CREATE_BTN_XP} + +Verify User Can Access Jupyter Launcher From DS Project Page + [Tags] Smoke ODS-1877 + Open Data Science Projects Home Page + Page Should Contain Element ${SPAWNER_LINK} + Click Element ${SPAWNER_LINK} + Wait Until JupyterHub Spawner Is Ready + Verify User Cannot Create Project With Empty Fields - [Tags] ODS-1783 + [Tags] Sanity ODS-1783 [Documentation] Verifies users is not allowed to create a project with Empty title Create Project With Empty Title And Expect Error Close Generic Modal If Present Verify User Cannot Create Project Using Special Chars In Resource Name - [Tags] ODS-1875 + [Tags] Sanity ODS-1875 [Documentation] Verifies users is not allowed to create a project with a custom resource name ... containing special characters like "@" or "!" Create Project With Special Chars In Resource Name And Expect Error Close Generic Modal If Present Verify User Can Access Only Its Owned Projects - [Tags] ODS-1868 + [Tags] Sanity ODS-1868 [Documentation] Verifies each user can access only thei owned projects. Except for ... cluster and dedicated admins which should be able to fetch all the DS Projects [Setup] Set Variables For User Access Test @@ -90,7 +102,7 @@ Verify User Can Access Only Its Owned Projects Project Should Be Listed project_title=${PRJ_A_USER4} Verify User Can Create A Data Science Project - [Tags] ODS-1775 + [Tags] Sanity ODS-1775 [Documentation] Verifies users can create a DS project [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page @@ -101,7 +113,7 @@ Verify User Can Create A Data Science Project ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} Verify User Can Create And Start A Workbench With Ephimeral Storage - [Tags] ODS-1812 + [Tags] Sanity ODS-1812 [Documentation] Verifies users can create workbench using Ephemeral storage ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -117,7 +129,7 @@ Verify User Can Create And Start A Workbench With Ephimeral Storage Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Create A PV Storage - [Tags] ODS-1819 + [Tags] Sanity ODS-1819 [Documentation] Verifies users can create PersistenVolume storage ${pv_name}= Set Variable ${PV_BASENAME}-A ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -133,7 +145,7 @@ Verify User Can Create A PV Storage Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} Verify User Can Create And Start A Workbench With Existent PV Storage - [Tags] ODS-1814 + [Tags] Sanity ODS-1814 [Documentation] Verifies users can create a workbench and connect an existent PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-existent Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -149,7 +161,7 @@ Verify User Can Create And Start A Workbench With Existent PV Storage Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} Verify User Can Create And Start A Workbench Adding A New PV Storage - [Tags] ODS-1816 + [Tags] Sanity ODS-1816 [Documentation] Verifies users can create a workbench and connect a new PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-new ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -171,7 +183,7 @@ Verify User Can Create And Start A Workbench Adding A New PV Storage Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} Verify User Can Stop A Workbench - [Tags] ODS-1817 + [Tags] Sanity ODS-1817 [Documentation] Verifies users can stop a running workbench from project details page Open Data Science Project Details Page project_title=${PRJ_TITLE} Stop Workbench workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} @@ -179,7 +191,7 @@ Verify User Can Stop A Workbench # add checks on notebook pod is terminated but CR is present Verify User Can Launch A Workbench - [Tags] ODS-1815 + [Tags] Sanity ODS-1815 [Documentation] Verifies users can launch/open a running workbench from project details page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -189,7 +201,7 @@ Verify User Can Launch A Workbench Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Verify User Can Stop A Workbench From Projects Home Page - [Tags] ODS-1823 + [Tags] Sanity ODS-1823 [Documentation] Verifies users can stop a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -199,7 +211,7 @@ Verify User Can Stop A Workbench From Projects Home Page # add checks on notebook pod is terminated but CR is present Verify User Can Start And Launch A Workbench From Projects Home Page - [Tags] ODS-1818 + [Tags] Sanity ODS-1818 [Documentation] Verifies users can launch/open a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -209,7 +221,7 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Verify User Can Delete A Workbench - [Tags] ODS-1813 + [Tags] Sanity ODS-1813 [Documentation] Verifies users can delete a workbench ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -219,7 +231,7 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Check Workbench CR Is Deleted workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Delete A Persistent Storage - [Tags] ODS-1824 + [Tags] Sanity ODS-1824 [Documentation] Verifies users can delete a PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-TO-DELETE ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -232,7 +244,7 @@ Verify User Can Delete A Persistent Storage Check Storage PersistentVolumeClaim Is Deleted storage_name=${pv_name} namespace=${ns_name} Verify User Cand Add A S3 Data Connection - [Tags] ODS-1825 + [Tags] Sanity ODS-1825 [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -242,7 +254,7 @@ Verify User Cand Add A S3 Data Connection Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Delete A Data Connection - [Tags] ODS-1826 + [Tags] Sanity ODS-1826 [Documentation] Verifies users can delete a Data connection ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -252,7 +264,7 @@ Verify User Can Delete A Data Connection Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Create A Workbench With Environment Variables - [Tags] ODS-1864 + [Tags] Sanity ODS-1864 [Documentation] Verifies users can create a workbench and inject environment variables during creation ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} @@ -266,7 +278,7 @@ Verify User Can Create A Workbench With Environment Variables Check Environment Variables Exist exp_env_variables=${envs_list} Verify User Can Delete A Data Science Project - [Tags] ODS-1784 + [Tags] Sanity ODS-1784 [Documentation] Verifies users can delete a Data Science project ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Delete Data Science Project project_title=${PRJ_TITLE} From 6697c63d05fdf1a67a5c830ca16ecf2f2907d12b Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 16:33:09 +0100 Subject: [PATCH 61/70] fix typo Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index efd342991..4ad18a82c 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -243,7 +243,7 @@ Verify User Can Delete A Persistent Storage Storage Should Not Be Listed name=${pv_name} Check Storage PersistentVolumeClaim Is Deleted storage_name=${pv_name} namespace=${ns_name} -Verify User Cand Add A S3 Data Connection +Verify User Can Add A S3 Data Connection [Tags] Sanity ODS-1825 [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} From b11c771f9ff9ed7534a623bd3f4540ed6671d478 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 16:36:37 +0100 Subject: [PATCH 62/70] add some dummy values Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 4ad18a82c..2a785ef59 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -28,6 +28,8 @@ ${PV_DESCRIPTION}= ods-ci-pv is a PV created to test DS Projects feature # PV size are in GB ${PV_SIZE}= 2 ${DC_S3_NAME}= ods-ci-s3 +${DC_S3_AWS_SECRET_ACCESS_KEY}= custom dummy secret access key +${DC_S3_AWS_ACCESS_KEY}= custom dummy access key id ${DC_S3_ENDPOINT}= custom.endpoint.s3.com ${DC_S3_REGION}= ods-ci-region ${DC_S3_TYPE}= Object storage[Tags] Sanity ODS @@ -248,8 +250,8 @@ Verify User Can Add A S3 Data Connection [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${S3.AWS_ACCESS_KEY_ID} - ... aws_secret_access=${S3.AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${DC_S3_AWS_SECRET_ACCESS_KEY} + ... aws_secret_access=${DC_S3_AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_workbench=${NONE} Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} From f2a5e3588e944980e62f53158ba392302d41e2a9 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Thu, 17 Nov 2022 17:09:33 +0100 Subject: [PATCH 63/70] fix copy paste error Signed-off-by: bdattoma --- .../415__ods_dashboard_projects.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 2a785ef59..c9a995039 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -32,7 +32,7 @@ ${DC_S3_AWS_SECRET_ACCESS_KEY}= custom dummy secret access key ${DC_S3_AWS_ACCESS_KEY}= custom dummy access key id ${DC_S3_ENDPOINT}= custom.endpoint.s3.com ${DC_S3_REGION}= ods-ci-region -${DC_S3_TYPE}= Object storage[Tags] Sanity ODS +${DC_S3_TYPE}= Object storage *** Test Cases *** From 8fbe979c7e7847c9918f6357ba2a8c44a60776d2 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 18 Nov 2022 10:46:21 +0100 Subject: [PATCH 64/70] fix robocp alerts Signed-off-by: bdattoma --- .../DataConnections.resource | 1 + .../ODHDataScienceProject/Projects.resource | 55 ++++++++---- .../ODHDataScienceProject/Storages.resource | 1 + .../Workbenches.resource | 58 ++++++++----- .../415__ods_dashboard_projects.robot | 85 ++++++++++++------- 5 files changed, 133 insertions(+), 67 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 428c3234e..8e61ff493 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -1,4 +1,5 @@ *** Settings *** +Documentation Collection of keywords to interact with Data Connections Resource ../../../../Page/Components/Components.resource Resource ../../../../Common.robot Resource Projects.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 4fe9a7497..2f5f31119 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -1,8 +1,10 @@ *** Settings *** +Documentation Collection of keywords to interact with Data Science Projects Resource ../../../../Page/Components/Components.resource Resource ../../../../Common.robot Resource ./Workbenches.resource + *** Variables *** ${DS_PROJECT_XP}= xpath=//h1[text()="Data science projects"] ${TITLE_INPUT_XP}= xpath=//input[@id="manage-project-modal-name"] @@ -27,6 +29,7 @@ Open Data Science Projects Home Page Maybe Wait For Dashboard Loading Spinner Page Is Data Science Projects Page Open + [Documentation] Checks if Data Science Projects home page is open. Returns TRUE or FALSE Close Generic Modal If Present ${page_open}= Run Keyword And Return Status Page Should Contain Element ${DS_PROJECT_XP} [Return] ${page_open} @@ -52,8 +55,9 @@ Delete Data Science Project END Project Should Be Listed project_title=${project_title} Click Action From Actions Menu item_title=${project_title} item_type=project action=Delete - Handle Deletion Confirmation Modal item_title=${project_title} item_type=project press_cancel=${press_cancel} - ... additional_msg=It will destroy all workbenches, storages, data connections and other resources in ${project_title} + Handle Deletion Confirmation Modal item_title=${project_title} item_type=project + ... press_cancel=${press_cancel} + ... additional_msg=It will destroy all workbenches, storages, data connections and other resources in ${project_title} Wait Until Project Is Open [Documentation] Waits until a DS Project Details page is laoded @@ -64,17 +68,18 @@ Wait Until Project Is Open Project Should Be Listed [Documentation] Checks a Project is available in DS Project home page [Arguments] ${project_title} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td/div/a[text()="${project_title}"] + Run Keyword And Continue On Failure Page Should Contain Element xpath=//td/div/a[text()="${project_title}"] Project Should Not Be Listed [Documentation] Checks a Project is not available in DS Project home page [Arguments] ${project_title} - Run keyword And Continue On Failure Page Should Not Contain Element xpath=//td/div/a[text()="${project_title}"] + Run Keyword And Continue On Failure Page Should Not Contain Element xpath=//td/div/a[text()="${project_title}"] Project's Owner Should Be [Documentation] Checks if the owner of a DS project is displayed and corresponds to the expected one [Arguments] ${project_title} ${expected_username} - Run keyword And Continue On Failure Page Should Contain Element xpath=//td[div/a[text()="${project_title}"]]/small[text()="${expected_username}"] + Run Keyword And Continue On Failure + ... Page Should Contain Element xpath=//td[div/a[text()="${project_title}"]]/small[text()="${expected_username}"] Create Data Science Project [Documentation] Creates a DS Project with the given ${title}, ${description} and ${resource_name} @@ -145,35 +150,45 @@ Workbench Status Should Be From Projects Home Page [Documentation] Checks the workbench status is the expected one, from the DS Project home page [Arguments] ${workbench_title} ${status} ${project_title} ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} - # Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[div//label[@for="${workbench_cr_name}"]]//p[text()="${status}"] - Run keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[@data-label="Status"]//div[div/label[@for="${workbench_cr_name}"]]/div/p[text()="${status}"] + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} + ... namespace=${namespace} + Run Keyword And Continue On Failure Page Should Contain Element xpath=//tr[td/div/a[text()="${project_title}"]]/td[@data-label="Status"]//div[div/label[@for="${workbench_cr_name}"]]/div/p[text()="${status}"] Start Workbench From Projects Home Page [Documentation] Triggers the workbench "start" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} - ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} + ${is_stopped}= Run Keyword And Return Status + ... Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} + ... status=${WORKBENCH_STATUS_STOPPED} + ... project_title=${project_title} IF ${is_stopped} == ${TRUE} IF "${workbench_cr_name}" == "${EMPTY}" IF "${namespace}" == "${EMPTY}" ${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title} END - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} + ${_} ${workbench_cr_name}= + ... Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} + ... namespace=${namespace} END Click Element xpath=//tr[td/div/a[text()="${project_title}"]]/td/div//label[@for="${workbench_cr_name}"]/span[@class="pf-c-switch__toggle"] ELSE Fail msg=Cannot start ${workbench_title} workbench because it is not stopped. END - Wait Until Workbench Is Started From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} + Wait Until Workbench Is Started From Projects Home Page workbench_title=${workbench_title} + ... project_title=${project_title} Stop Workbench From Projects Home Page [Documentation] Triggers the workbench "stop" process from DS Projects home page. ... It needs ${workbench_title} and ${project_title} at least. If ${namespace} and/or ... ${workbench_cr_name} are given too, the kw spares one or two calls to openshift API server - [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} ${workbench_cr_name}=${EMPTY} ${press_cancel}=${FALSE} - ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + [Arguments] ${workbench_title} ${project_title} ${namespace}=${EMPTY} + ... ${workbench_cr_name}=${EMPTY} ${press_cancel}=${FALSE} + ${is_started}= Run Keyword And Return Status + ... Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} + ... status=${WORKBENCH_STATUS_RUNNING} + ... project_title=${project_title} IF ${is_started} == ${TRUE} IF "${workbench_cr_name}" == "${EMPTY}" IF "${namespace}" == "${EMPTY}" @@ -186,22 +201,26 @@ Stop Workbench From Projects Home Page ELSE Fail msg=Cannot stop ${workbench_title} workbench because it is not running. END - Wait Until Workbench Is Stopped From Projects Home Page workbench_title=${workbench_title} project_title=${project_title} + Wait Until Workbench Is Stopped From Projects Home Page workbench_title=${workbench_title} + ... project_title=${project_title} Wait Until Workbench Is Started From Projects Home Page [Documentation] Waits until the workbench status is "RUNNING", from the DS Project home page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} Wait Until Workbench Is Stopped From Projects Home Page [Documentation] Waits until the workbench status is "STOPPED", from the DS Project home page [Arguments] ${workbench_title} ${project_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} + Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be From Projects Home Page + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} project_title=${project_title} Launch Workbench From Projects Home Page [Documentation] Launches a running workbench from DS Projects home page. [Arguments] ${workbench_title} ${project_title} - ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be From Projects Home Page + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} project_title=${project_title} IF ${is_started} == ${TRUE} Click Element xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] Access To Workbench @@ -230,4 +249,4 @@ Number Of Displayed Projects Should Be [Arguments] ${expected_number} ${listed}= Get All Displayed Projects ${n_listed}= Get Length ${listed} - Run Keyword And Continue On Failure Should Be Equal As Integers ${n_listed} ${expected_number} \ No newline at end of file + Run Keyword And Continue On Failure Should Be Equal As Integers ${n_listed} ${expected_number} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 2677be9cc..4e305b497 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -1,4 +1,5 @@ *** Settings *** +Documentation Collection of keywords to interact with Storages Resource ../../../../Page/Components/Components.resource Resource ../../../../Common.robot Resource Projects.resource diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 02adeafd8..a0a1f4b3a 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -1,4 +1,5 @@ *** Settings *** +Documentation Collection of keywords to interact with Workbenches Resource ../../../../Page/Components/Components.resource Resource ../../../../Common.robot Resource Projects.resource @@ -22,6 +23,7 @@ ${WORKBENCH_STOP_BTN_XP}= xpath=//button[text()="Stop workbench" &{IMAGE_ID_MAPPING}= Minimal Python=s2i-minimal-notebook CUDA=minimal-gpu PyTorch=pytorch ... Standard Data Science=s2i-generic-data-science-notebook TensorFlow=tensorflow ${KEYVALUE_TYPE}= Key / value +${ENV_VARIABLES_SECTION_XP}= xpath=//section[@aria-label="Environment variables"] *** Keywords *** @@ -30,7 +32,8 @@ Create Workbench ... the DS Project deta. It allows to add new or existent PV storage, ... add Environment variables and select Jupyter image [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} - ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} ${press_cancel}=${FALSE} ${envs}=${NONE} + ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} + ... ${press_cancel}=${FALSE} ${envs}=${NONE} Click Element ${WORKBENCH_CREATE_BTN_XP} Wait Until Page Contains Element ${WORKBENCH_NAME_INPUT_XP} Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_2_XP} @@ -38,7 +41,7 @@ Create Workbench Input Text ${WORKBENCH_DESCR_TXT_XP} ${workbench_description} Run Keyword And Continue On Failure Element Should Be Disabled ${WORKBENCH_CREATE_BTN_2_XP} Select Workbench Jupyter Image image_name=${image_name} - ## Select Workbench Container Size # to fix, by default Small is already select + # Select Workbench Container Size # to fix, by default Small is already select IF "${envs}" != "${NONE}" ${envs_copy}= Copy List ${envs} deepcopy=${TRUE} Add Environment Variables In Workbench env_variables=${envs_copy} @@ -79,11 +82,14 @@ Add Environment Variables In Workbench ${n_pairs}= Get Length ${env_variable.keys()} FOR ${pair_idx} ${key} ${value} IN ENUMERATE &{env_variable} Log ${pair_idx}-${key}-${value} - Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//input[@aria-label="key of item ${pair_idx}"] - Input Text xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${idx}]//input[@aria-label="key of item ${pair_idx}"] ${key} - Input Text xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${idx}]//input[@aria-label="value of item ${pair_idx}"] ${value} + Run Keyword And Continue On Failure Wait Until Page Contains Element + ... xpath=//input[@aria-label="key of item ${pair_idx}"] + Input Text ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//input[@aria-label="key of item ${pair_idx}"] + ... ${key} + Input Text ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//input[@aria-label="value of item ${pair_idx}"] + ... ${value} IF ${n_pairs}-${pair_idx} > 1 - Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${idx}]//button[text()="Add another variable"] + Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//button[text()="Add another variable"] END END END @@ -95,12 +101,14 @@ Add Environment Variables In Workbench Select Environment Variable Types [Documentation] Selects the type of environment variable in the workbench creation page: Secret vs Config Map [Arguments] ${k8s_type} ${input_type} ${variable_index} - Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button - Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//div[contains(@class,"pf-c-select")]/button + Run Keyword And Continue On Failure Wait Until Page Contains Element + ... ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${variable_index}]//div[@class="pf-l-stack__item"]/div[contains(@class,"pf-c-select")]/button + Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${variable_index}]//div[contains(@class,"pf-c-select")]/button Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"] Click Element xpath=//ul[@role="listbox"]/li/button[text()="${k8s_type}"] - Run Keyword And Continue On Failure Wait Until Page Contains Element xpath=//section[@aria-label="Environment variables"]//button[div/span[text()="Select one"]] - Click Element xpath=//section[@aria-label="Environment variables"]/div[@class="pf-l-split"][${variable_index}]//button[div/span[text()="Select one"]] + Run Keyword And Continue On Failure + ... Wait Until Page Contains Element ${ENV_VARIABLES_SECTION_XP}//button[div/span[text()="Select one"]] + Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${variable_index}]//button[div/span[text()="Select one"]] Wait Until Page Contains Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] Click Element xpath=//ul[@role="listbox"]/li/button[text()="${input_type}"] @@ -114,7 +122,8 @@ Remove All Environment Variables Select An Existent PV [Documentation] Selects an existent PV Storage in the workbench creation page [Arguments] ${name} - Run Keyword And Continue On Failure Wait Until Element Is Enabled xpath=//input[@placeholder="Select a persistent storage"] + Run Keyword And Continue On Failure + ... Wait Until Element Is Enabled xpath=//input[@placeholder="Select a persistent storage"] Click Element xpath=//input[@placeholder="Select a persistent storage"] Wait Until Page Contains Element xpath=//ul/li/button[text()="${name}"] Wait Until Page Contains Element xpath=//div[contains(@class,"pf-c-select")]/ul/li/button[text()="${name}"] @@ -139,27 +148,35 @@ Select Workbench Container Size Workbench Should Be Listed [Documentation] Checks a workbench is listed in the DS Project details page [Arguments] ${workbench_title} - Run keyword And Continue On Failure Wait Until Page Contains Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] + Run keyword And Continue On Failure + ... Wait Until Page Contains Element + ... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] Workbench Should Not Be Listed [Documentation] Checks a workbench is not listed in the DS Project details page [Arguments] ${workbench_title} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] + Run keyword And Continue On Failure + ... Wait Until Page Does Not Contain Element + ... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/h4[div[text()="${workbench_title}"]] Workbench Status Should Be [Documentation] Checks a workbench status is the expected one in the DS Project details page [Arguments] ${workbench_title} ${status} - Run keyword And Continue On Failure Page Should Contain Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//p[text()="${status}"] + Run keyword And Continue On Failure + ... Page Should Contain Element + ... ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//p[text()="${status}"] Wait Until Workbench Is Started [Documentation] Waits until workbench status is "RUNNING" in the DS Project details page [Arguments] ${workbench_title} ${timeout}=30s - Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} + Wait Until Keyword Succeeds ${timeout} 5s Workbench Status Should Be + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} Start Workbench [Documentation] Starts a workbench from the DS Project details page [Arguments] ${workbench_title} - ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} + ${is_stopped}= Run Keyword And Return Status Workbench Status Should Be + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STOPPED} IF ${is_stopped} == ${TRUE} Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"] ELSE @@ -180,7 +197,8 @@ Access To Workbench Launch Workbench [Documentation] Launches a workbench from DS Project details page [Arguments] ${workbench_title} - ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} Click Link ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td/a[text()="Open"] Access To Workbench @@ -191,7 +209,8 @@ Launch Workbench Stop Workbench [Documentation] Stops a workbench from DS Project details page [Arguments] ${workbench_title} ${press_cancel}=${FALSE} - ${is_started}= Run Keyword And Return Status Workbench Status Should Be workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} + ${is_started}= Run Keyword And Return Status Workbench Status Should Be + ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"] Wait Until Modal Appears @@ -204,7 +223,8 @@ Handle Stop Workbench Confirmation Modal [Documentation] Handles modal to stop workbench [Arguments] ${press_cancel}=${FALSE} Run Keyword And Continue On Failure Page Should Contain Stop workbench? - Run Keyword And Continue On Failure Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. + Run Keyword And Continue On Failure + ... Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased. Run Keyword And Continue On Failure Page Should Contain To save changes, access your workbench Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"] Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"] diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index c9a995039..23109aa9a 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -1,4 +1,5 @@ *** Settings *** +Documentation Suite to test Data Science Projects (a.k.a DSG) feature Library SeleniumLibrary Library OpenShiftLibrary Resource ../../../Resources/OCP.resource @@ -96,7 +97,8 @@ Verify User Can Access Only Its Owned Projects Project Should Be Listed project_title=${PRJ_1_USER3} Project Should Be Listed project_title=${PRJ_2_USER3} Project Should Be Listed project_title=${PRJ_A_USER4} - Launch Data Science Project Main Page username=${OCP_ADMIN_USER.USERNAME} password=${OCP_ADMIN_USER.PASSWORD} ocp_user_auth_type=${OCP_ADMIN_USER.AUTH_TYPE} + Launch Data Science Project Main Page username=${OCP_ADMIN_USER.USERNAME} password=${OCP_ADMIN_USER.PASSWORD} + ... ocp_user_auth_type=${OCP_ADMIN_USER.AUTH_TYPE} Capture Page Screenshot Number Of Displayed Projects Should Be expected_number=3 Project Should Be Listed project_title=${PRJ_1_USER3} @@ -108,7 +110,8 @@ Verify User Can Create A Data Science Project [Documentation] Verifies users can create a DS project [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page - Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} resource_name=${PRJ_RESOURCE_NAME} + Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} + ... resource_name=${PRJ_RESOURCE_NAME} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} Project's Owner Should Be expected_username=${TEST_USER_3.USERNAME} project_title=${PRJ_TITLE} @@ -122,8 +125,9 @@ Verify User Can Create And Start A Workbench With Ephimeral Storage Create Workbench workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${TRUE} - Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} - ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} + Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_TITLE} status=${WORKBENCH_STATUS_STARTING} @@ -138,7 +142,8 @@ Verify User Can Create A PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} ${workbenchs}= Create Dictionary ${WORKBENCH_TITLE}=mount-data Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} project_title=${PRJ_TITLE} + ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} + ... project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${workbenchs} project_title=${PRJ_TITLE} Storage Should Be Listed name=${pv_name} description=${PV_DESCRIPTION} @@ -153,9 +158,9 @@ Verify User Can Create And Start A Workbench With Existent PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} - Create Workbench workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} prj_title=${PRJ_TITLE} - ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${TRUE} - ... pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} + Create Workbench workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Persistent pv_existent=${TRUE} pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_2_TITLE} @@ -168,8 +173,9 @@ Verify User Can Create And Start A Workbench Adding A New PV Storage ${pv_name}= Set Variable ${PV_BASENAME}-new ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workbench workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} prj_title=${PRJ_TITLE} - ... image_name=${NB_IMAGE} deployment_size=Small storage=Persistent pv_existent=${FALSE} + Create Workbench workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Persistent pv_existent=${FALSE} ... pv_name=${pv_name} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} Workbench Should Be Listed workbench_title=${WORKBENCH_3_TITLE} Reload Page @@ -200,15 +206,18 @@ Verify User Can Launch A Workbench Open Data Science Project Details Page project_title=${PRJ_TITLE} Start Workbench workbench_title=${WORKBENCH_TITLE} Launch Workbench workbench_title=${WORKBENCH_TITLE} - Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} + Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} + ... image=${NB_IMAGE} namespace=${ns_name} Verify User Can Stop A Workbench From Projects Home Page [Tags] Sanity ODS-1823 [Documentation] Verifies users can stop a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} - Stop Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} + ... namespace=${ns_name} + Stop Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + ... workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Workbench Launch Link Should Be Disabled workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} # add checks on notebook pod is terminated but CR is present @@ -217,8 +226,10 @@ Verify User Can Start And Launch A Workbench From Projects Home Page [Documentation] Verifies users can launch/open a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} - Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} workbench_cr_name=${workbench_cr_name} namespace=${ns_name} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} + ... namespace=${ns_name} + Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + ... workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Launch Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} @@ -250,8 +261,10 @@ Verify User Can Add A S3 Data Connection [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} aws_access_key=${DC_S3_AWS_SECRET_ACCESS_KEY} - ... aws_secret_access=${DC_S3_AWS_SECRET_ACCESS_KEY} aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} + ... aws_access_key=${DC_S3_AWS_SECRET_ACCESS_KEY} + ... aws_secret_access=${DC_S3_AWS_SECRET_ACCESS_KEY} + ... aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_workbench=${NONE} Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} @@ -268,13 +281,17 @@ Verify User Can Delete A Data Connection Verify User Can Create A Workbench With Environment Variables [Tags] Sanity ODS-1864 [Documentation] Verifies users can create a workbench and inject environment variables during creation - ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB k8s_type=Secret input_type=${KEYVALUE_TYPE} - ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM k8s_type=Config Map input_type=${KEYVALUE_TYPE} + ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB + ... k8s_type=Secret input_type=${KEYVALUE_TYPE} + ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM + ... k8s_type=Config Map input_type=${KEYVALUE_TYPE} ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workbench workbench_title=${WORKBENCH_TITLE}-envs workbench_description=${WORKBENCH_DESCRIPTION} prj_title=${PRJ_TITLE} - ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} - ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${FALSE} envs=${envs_list} + Create Workbench workbench_title=${WORKBENCH_TITLE}-envs workbench_description=${WORKBENCH_DESCRIPTION} + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... storage=Ephemeral pv_existent=${NONE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} + ... press_cancel=${FALSE} envs=${envs_list} Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE}-envs Launch Workbench workbench_title=${WORKBENCH_TITLE}-envs Check Environment Variables Exist exp_env_variables=${envs_list} @@ -314,21 +331,25 @@ Set Variables For User Access Test Launch Data Science Project Main Page [Documentation] Launch DS Projects page in RHODS Dashboard using a given user - [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} + [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} + ... ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} - ... dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS} + ... dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page Create Project With Empty Title And Expect Error [Documentation] Tries to create a DS project with emtpy title and checks the Selenium error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ - Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${EMPTY} description=${EMPTY} + Run Keyword And Expect Error Element*was not enabled* + ... Create Data Science Project title=${EMPTY} description=${EMPTY} Create Project With Special Chars In Resource Name And Expect Error [Documentation] Tries to create a DS project by overwriting the resource name ... with a custom one containing special characters, and checks the Selenium error ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ - Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${PRJ_TITLE}-spec-chars description=${EMPTY} resource_name=ods-ci-@-project#name + Run Keyword And Expect Error Element*was not enabled* + ... Create Data Science Project title=${PRJ_TITLE}-spec-chars + ... description=${EMPTY} resource_name=ods-ci-@-project#name Check Corresponding Namespace Exists [Documentation] Checks if a DS Project has its own corresponding Openshift namespace @@ -340,7 +361,8 @@ Check Corresponding Namespace Exists Check Corresponding Notebook CR Exists [Documentation] Checks if a workbench has its own Notebook CustomResource [Arguments] ${workbench_title} ${namespace} - ${res} ${response}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace} + ${res} ${response}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} + ... namespace=${namespace} IF "${response}" == "${EMPTY}" Run Keyword And Continue On Failure Fail msg=Notebook CR not found for ${workbench_title} in ${namespace} NS END @@ -348,7 +370,8 @@ Check Corresponding Notebook CR Exists Check Workbench CR Is Deleted [Documentation] Checks if when a workbench is deleted its Notebook CustomResource gets deleted too [Arguments] ${workbench_title} ${namespace} ${timeout}=10s - ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists workbench_title=${workbench_title} namespace=${namespace} + ${status}= Run Keyword And Return Status Check Corresponding Notebook CR Exists + ... workbench_title=${workbench_title} namespace=${namespace} IF ${status} == ${TRUE} Fail msg=The notebook CR for ${workbench_title} is still present, while it should have been deleted. END @@ -364,7 +387,8 @@ Check Corresponding Data Connection Secret Exists Check Data Connection Secret Is Deleted [Documentation] Checks if when a S3 Data Connection is deleted its Openshift Secret gets deleted too [Arguments] ${dc_name} ${namespace} ${timeout}=10s - ${status}= Run Keyword And Return Status Check Corresponding Data Connection Secret Exists dc_name=${dc_name} namespace=${namespace} + ${status}= Run Keyword And Return Status Check Corresponding Data Connection Secret Exists + ... dc_name=${dc_name} namespace=${namespace} IF ${status} == ${TRUE} Fail msg=The secret for ${dc_name} data connection is still present, while it should have been deleted. END @@ -380,7 +404,8 @@ Check Corresponding PersistentVolumeClaim Exists Check Storage PersistentVolumeClaim Is Deleted [Documentation] Checks if when a PV cluster storage is deleted its Openshift PersistentVolumeClaim gets deleted too [Arguments] ${storage_name} ${namespace} ${timeout}=10s - ${status}= Run Keyword And Return Status Check Corresponding PersistentVolumeClaim Exists storage_name=${storage_name} namespace=${namespace} + ${status}= Run Keyword And Return Status Check Corresponding PersistentVolumeClaim Exists + ... storage_name=${storage_name} namespace=${namespace} IF ${status} == ${TRUE} Fail msg=The PVC for ${storage_name} storage is still present, while it should have been deleted. END From bf47e3ec0d70e36844b42f93c2dcc600e3ad739e Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 18 Nov 2022 10:46:34 +0100 Subject: [PATCH 65/70] remove unused template file Signed-off-by: bdattoma --- ...15__ods_dashboard_projects_templates.robot | 84 ------------------- 1 file changed, 84 deletions(-) delete mode 100644 tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot deleted file mode 100644 index a13f115d8..000000000 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_templates.robot +++ /dev/null @@ -1,84 +0,0 @@ -*** Settings *** -Library SeleniumLibrary -Library OpenShiftLibrary -Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource -Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workspaces.resource -Suite Setup Project Suite Setup -Suite Teardown Project Suite Teardown -Test Setup Launch Data Science Project Main Page -#Test Template Create Workspace In A DS Project - - -*** Variables *** -${PRJ_TITLE}= ODS-CI DS Project -${PRJ_DESCRIPTION}= ODS-CI DS Project is a test for validating DSG feature -${WRKSP_TITLE}= ODS-CI Workspace 1 -${WRKSP_DESCRIPTION}= ODS-CI Workspace 1 is a test workspace using Minimal Python image to test DS Projects feature - - -*** Test Cases *** -# title description prj_title image_name deployment_size storage pv_existent pv_name pv_description pv_size -# Create A Workspace With Ephimeral Storage ${WRKSP_TITLE} ${WRKSP_DESCRIPTION} ${PRJ_TITLE} Minimal Python Small Ephemeral ${NONE} ${NONE} ${NONE} ${NONE} - - - -Verify User Can Create A Data Science Project - [Template] Create DS Project Template - [Tags] template - ${EMPTY} ${EMPTY} ${OCP_ADMIN_USER.USERNAME} - ${PRJ_TITLE} ${PRJ_DESCRIPTION} ${OCP_ADMIN_USER.USERNAME} - # [Teardown] Delete All Data Science Projects From CLI - -Verify User Can Create A Workspace With Ephimeral Storage - [Template] Create Workspace In A DS Project - [Tags] template2 - ${WRKSP_TITLE} ${WRKSP_DESCRIPTION} ${PRJ_TITLE} Minimal Python Small - ... Ephemeral ${NONE} ${NONE} ${NONE} ${NONE} - -Verify User Can Create A Workspace With Persistent Storage - [Template] Create Workspace In A DS Project - [Tags] template3 - ${WRKSP_TITLE} ${WRKSP_DESCRIPTION} ${PRJ_TITLE} Minimal Python Small - ... Persistent ${NONE} ${NONE} ${NONE} ${NONE} - - -*** Keywords *** -Project Suite Setup - Set Library Search Order SeleniumLibrary - # RHOSi Setup - -Project Suite Teardown - Close All Browsers - #Delete All Data Science Projects From CLI - -Launch Data Science Project Main Page - [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} - Launch Dashboard ocp_user_name=${username} ocp_user_pw=${TEST_USER_3.PASSWORD} browser_options=${BROWSER.OPTIONS} - Open Data Science Projects Home Page - -Create DS Project Template - [Arguments] ${title} ${description} ${username} - Open Data Science Projects Home Page - IF "${title}" == "${EMPTY}" - ${error_rgx}= Set Variable Element[ a-zA-Z=\(\)\[\]"'\/\s]+was not enabled[ a-zA-Z=\(\)\[\]"'\/\s0-9.]+ - Run Keyword And Expect Error Element*was not enabled* Create Data Science Project title=${title} description=${title} - Click Button ${GENERIC_CREATE_BTN_XP} - Return From Keyword - ELSE - Create Data Science Project title=${title} description=${description} - END - Wait Until Project Is Open project_title=${title} - Open Data Science Projects Home Page - Project Should Be Listed project_title=${title} - Project's Owner Should Be expected_username=${username} project_title=${title} - -Create Workspace In A DS Project - [Arguments] ${title} ${description} ${prj_title} ${image_name} ${deployment_size} - ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} - Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workspace v2 wrksp_title=${title} wrksp_description=${description} prj_title=${prj_title} image_name=${image_name} deployment_size=${deployment_size} - ... storage=${storage} pv_existent=${pv_existent} pv_name=${pv_name} pv_description=${pv_description} pv_size=${pv_size} - Wait Until Project Is Open project_title=${prj_title} - # Add wait for workspace section to load rows - Workspace Should Be Listed workspace_title=${wrksp_title} - Workspace Status Should Be workspace_title=${wrksp_title} status=${WRKSP_STATUS_STOPPED} From 2f714a13cb3cc4c007522bca58c83dc919729269 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Fri, 18 Nov 2022 10:55:51 +0100 Subject: [PATCH 66/70] fix robocop alerts Signed-off-by: bdattoma --- tests/Resources/OCP.resource | 5 ++++- .../Page/ODH/ODHDashboard/ODHDashboard.robot | 6 +++--- .../DataConnections.resource | 20 ++++++++++++------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/tests/Resources/OCP.resource b/tests/Resources/OCP.resource index 8fc63ff1c..4b69f787c 100644 --- a/tests/Resources/OCP.resource +++ b/tests/Resources/OCP.resource @@ -50,11 +50,14 @@ Verify CR Status Should Be Equal ${cr_obj_dictionary.status.conditions[0].status} True Namespace Should Not Exist + [Documentation] Checks a given Project is not present in openshift [Arguments] ${namespace} - ${present}= Run Keyword And Return Status OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=${namespace} + ${present} = Run Keyword And Return Status + ... OpenshiftLibrary.Oc Get kind=Project label_selector=metadata.name=${namespace} IF ${present} == ${TRUE} Fail msg=The namespace ${namespace} exists! END + Is RHODS Self-Managed [Documentation] Returns ${FALSE} if RHODS Managed (i.e., Cloud version) is installed ... in the cluster (e.g., usually on OSD, ROSA). diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot index 434329457..4407f56bb 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot @@ -706,6 +706,6 @@ Maybe Wait For Dashboard Loading Spinner Page ... If the spinner does not appear, the keyword ignores the error. [Arguments] ${timeout}=5s Run Keyword And Ignore Error Run Keywords - ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} - ... AND - ... Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} + ... Wait Until Page Contains Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} + ... AND + ... Wait Until Page Does Not Contain Element xpath=//span[@class="pf-c-spinner__tail-ball"] timeout=${timeout} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 8e61ff493..7eb6ac883 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -19,7 +19,8 @@ ${DC_ADD_BTN_2_XP}= xpath=//footer/button[text()="Add data connection" *** Keywords *** Create S3 Data Connection [Documentation] Creates a S3 Data Connection from DS Project details page - [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${aws_s3_endpoint} ${aws_region} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} + [Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} + ... ${aws_s3_endpoint} ${aws_region} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} Click Button ${DC_ADD_BTN_1_XP} Wait Until Page Contains Element ${S3_NAME_DC_INPUT_XP} Input Text ${S3_NAME_DC_INPUT_XP} ${dc_name} @@ -29,7 +30,7 @@ Create S3 Data Connection Input Text ${S3_REGION_DC_INPUT_XP} ${aws_region} IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE + ELSE Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} Click Button ${STORAGE_ADD_BTN_2_XP} END @@ -39,21 +40,26 @@ Create S3 Data Connection Data Connection Should Be Listed [Documentation] Checks a Data Connection is listed in DS Project details page [Arguments] ${name} ${type} ${connected_workbench} - Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] - Run keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()=" ${type}"] + Run keyword And Continue On Failure Page Should Contain Element + ... ${DC_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] + Run keyword And Continue On Failure Page Should Contain Element + ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()="No connections"] + Run Keyword And Continue On Failure Page Should Contain Element + ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()="No connections"] ELSE FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench} Log ${index}: ${workbench_title} - Run Keyword And Continue On Failure Page Should Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] + Run Keyword And Continue On Failure Page Should Contain Element + ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Connected workbenches"]/ul/li[text()="${workbench_title}"] END END Data Connection Should Not Be Listed [Documentation] Checks a Data Connection is not listed in DS Project details page [Arguments] ${name} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] + Run keyword And Continue On Failure Wait Until Page Does Not Contain Element + ... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] Get Openshift Secret From Data Connection [Documentation] Retrieves name of Openshift secret corresponding to a given S3 Data Connection based on Dispayed name in DS Project details page From bb321ac2bfd7d57b6964243adb5b2bcfc3604616 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 22 Nov 2022 17:45:26 +0100 Subject: [PATCH 67/70] fix inconsistency in generic modal kw names --- tests/Resources/Common.robot | 12 ++++++------ .../ODHDataScienceProject/DataConnections.resource | 2 +- .../ODHDataScienceProject/Projects.resource | 2 +- .../ODHDataScienceProject/Storages.resource | 2 +- .../ODHDataScienceProject/Workbenches.resource | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/Resources/Common.robot b/tests/Resources/Common.robot index eaa4340fd..80d7a840d 100644 --- a/tests/Resources/Common.robot +++ b/tests/Resources/Common.robot @@ -192,7 +192,7 @@ Get OAuth Cookie Is Generic Modal Displayed [Documentation] Checks if a modal window is displayed on the page. - ... It assumes the html "id" contains "pf-modal", but it can be + ... It assumes the html "id" contains "pf-modal-", but it can be ... piloted with ${id} and ${partial_match} arguments [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s IF ${partial_match} == ${TRUE} @@ -204,9 +204,9 @@ Is Generic Modal Displayed END [Return] ${is_displayed} -Wait Until Modal Disappears +Wait Until Generic Modal Disappears [Documentation] Waits until a modal window disappears from the page. - ... It assumes the html "id" contains "pf-modal", but it can be + ... It assumes the html "id" contains "pf-modal-", but it can be ... piloted with ${id} and ${partial_match} arguments [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s ${is_modal}= Is Generic Modal Displayed @@ -220,9 +220,9 @@ Wait Until Modal Disappears Log No Modals on the screen right now.. level=WARN END -Wait Until Modal Appears +Wait Until Generic Modal Appears [Documentation] Waits until a modal window appears on the page. - ... It assumes the html "id" contains "pf-modal", but it can be + ... It assumes the html "id" contains "pf-modal-", but it can be ... piloted with ${id} and ${partial_match} arguments [Arguments] ${id}=pf-modal- ${partial_match}=${TRUE} ${timeout}=10s ${is_modal}= Is Generic Modal Displayed @@ -241,5 +241,5 @@ Close Generic Modal If Present ${is_modal}= Is Generic Modal Displayed IF ${is_modal} == ${TRUE} Click Element xpath=//button[@aria-label="Close"] - Wait Until Modal Disappears + Wait Until Generic Modal Disappears END diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 7eb6ac883..48cd2f9e0 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -34,7 +34,7 @@ Create S3 Data Connection Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} Click Button ${STORAGE_ADD_BTN_2_XP} END - Wait Until Modal Disappears + Wait Until Generic Modal Disappears Wait Until Project Is Open project_title=${project_title} Data Connection Should Be Listed diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 2f5f31119..1dbc0a88b 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -96,7 +96,7 @@ Create Data Science Project END Wait Until Element Is Enabled ${GENERIC_CREATE_BTN_XP} Click Button ${GENERIC_CREATE_BTN_XP} - Wait Until Modal Disappears + Wait Until Generic Modal Disappears Wait Until Project Is Open project_title=${title} Validate Generated Resource Name diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 4e305b497..b7bc120d1 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -61,7 +61,7 @@ Create PersistenVolume Storage Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} Click Button ${STORAGE_ADD_BTN_2_XP} END - Wait Until Modal Disappears + Wait Until Generic Modal Disappears Wait Until Project Is Open project_title=${project_title} Fill In New PV Data diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index a0a1f4b3a..db27e7ea3 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -65,7 +65,7 @@ Create Workbench Wait Until Element Is Enabled ${WORKBENCH_CREATE_BTN_2_XP} Click Button ${WORKBENCH_CREATE_BTN_2_XP} END - Wait Until Modal Disappears + Wait Until Generic Modal Disappears Wait Until Project Is Open project_title=${prj_title} Add Environment Variables In Workbench @@ -213,7 +213,7 @@ Stop Workbench ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING} IF ${is_started} == ${TRUE} Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"] - Wait Until Modal Appears + Wait Until Generic Modal Appears Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ELSE Fail msg=Cannot stop workbench ${workbench_title} because it is not running... @@ -246,7 +246,7 @@ Click Action From Actions Menu Handle Deletion Confirmation Modal [Documentation] Handles confirmation modal on item deletion [Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} ${additional_msg}=${NONE} - Wait Until Modal Appears + Wait Until Generic Modal Appears Run Keyword And Continue On Failure Page Should Contain Delete ${item_type}? Run Keyword And Continue On Failure Page Should Contain This action cannot be undone. IF "${additional_msg}" != "${NONE}" @@ -261,7 +261,7 @@ Handle Deletion Confirmation Modal ELSE Click Button xpath=//button[text()="Delete ${item_type}"] END - Wait Until Modal Disappears + Wait Until Generic Modal Disappears Delete Workbench From 9e88ac4864a71826c11834a69ff8c978bee8f7cc Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 22 Nov 2022 18:17:55 +0100 Subject: [PATCH 68/70] fix comments by reviewers (1) --- .../ODHDataScienceProject/Projects.resource | 11 +++-- .../ODHDataScienceProject/Storages.resource | 2 +- .../Workbenches.resource | 2 +- .../415__ods_dashboard_projects.robot | 44 +++++++++---------- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource index 1dbc0a88b..c7f2d0cd9 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource @@ -21,7 +21,7 @@ ${SPAWNER_LINK}= xpath=//a[text()="Launch Jupyter"] *** Keywords *** Open Data Science Projects Home Page - [Documentation] Verifies submenu Settings > Cluster settings" is visible + [Documentation] Verifies submenu Settings > "Data Science Projects" is visible Page Should Contain Data Science Projects Click Link Data Science Projects Wait Until Page Contains View your existing projects or create new projects. timeout=30 @@ -35,7 +35,7 @@ Is Data Science Projects Page Open [Return] ${page_open} Open Data Science Project Details Page - [Documentation] Verifies submenu Settings > Cluster settings" is visible + [Documentation] Verifies submenu Settings > "Data Science Projects" is visible [Arguments] ${project_title} ${is_open}= Is Data Science Projects Page Open IF ${is_open} == ${FALSE} @@ -120,7 +120,8 @@ Get Openshift Namespace From Data Science Project [Return] ${ns_name[1]} Delete Data Science Projects From CLI - [Documentation] Deletets the Openshift Projects using OpenshiftLibrary + [Documentation] Deletes the Openshift Projects using OpenshiftLibrary. + ... It expects to receive a list of project (i.e,${ocp_projects}) as argument [Arguments] ${ocp_projects} FOR ${displayed_name} IN @{ocp_projects} ${dp_with_suffix}= Set Variable ${displayed_name}\[DSP] @@ -231,8 +232,10 @@ Launch Workbench From Projects Home Page Workbench Launch Link Should Be Disabled [Documentation] Checks the workbench launch link is disabled from DS Projects home page. [Arguments] ${workbench_title} ${project_title} - ${link_status}= Get Element Attribute xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled + ${link_status}= Get Element Attribute + ... xpath=//tr[td/div/a[text()="${project_title}"]]/td//a[text()="${workbench_title}"] aria-disabled Should Be Equal As Strings ${link_status} true + ... msg=Workbench launch link should be disabled for workbench ${workbench_title} in project ${project_title} Get All Displayed Projects [Documentation] Gets all the DS projects visible in the DS Projects home page diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index b7bc120d1..07d1f66a7 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -50,7 +50,7 @@ Storage Size Should Be ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.capacity.storage}' Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi -Create PersistenVolume Storage +Create PersistentVolume Storage [Documentation] Create a PersistenVolume storage in DS Project details page [Arguments] ${project_title} ${name} ${description} ${size} ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} Click Button ${STORAGE_ADD_BTN_1_XP} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index db27e7ea3..a80f4343d 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -29,7 +29,7 @@ ${ENV_VARIABLES_SECTION_XP}= xpath=//section[@aria-label="Environment var *** Keywords *** Create Workbench [Documentation] Creates a new workbench in a Data Science project. It assumes - ... the DS Project deta. It allows to add new or existent PV storage, + ... the DS Project data. It allows to add new or existent PV storage, ... add Environment variables and select Jupyter image [Arguments] ${workbench_title} ${workbench_description} ${prj_title} ${image_name} ${deployment_size} ... ${storage} ${pv_existent} ${pv_name} ${pv_description} ${pv_size} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 23109aa9a..63ed36082 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -56,14 +56,14 @@ Verify User Cannot Create Project With Empty Fields Close Generic Modal If Present Verify User Cannot Create Project Using Special Chars In Resource Name - [Tags] Sanity ODS-1875 + [Tags] Sanity Tier1 ODS-1875 [Documentation] Verifies users is not allowed to create a project with a custom resource name ... containing special characters like "@" or "!" Create Project With Special Chars In Resource Name And Expect Error Close Generic Modal If Present Verify User Can Access Only Its Owned Projects - [Tags] Sanity ODS-1868 + [Tags] Sanity Tier1 ODS-1868 [Documentation] Verifies each user can access only thei owned projects. Except for ... cluster and dedicated admins which should be able to fetch all the DS Projects [Setup] Set Variables For User Access Test @@ -106,7 +106,7 @@ Verify User Can Access Only Its Owned Projects Project Should Be Listed project_title=${PRJ_A_USER4} Verify User Can Create A Data Science Project - [Tags] Sanity ODS-1775 + [Tags] Sanity Tier1 ODS-1775 [Documentation] Verifies users can create a DS project [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page @@ -118,7 +118,7 @@ Verify User Can Create A Data Science Project ${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE} Verify User Can Create And Start A Workbench With Ephimeral Storage - [Tags] Sanity ODS-1812 + [Tags] Sanity Tier1 ODS-1812 [Documentation] Verifies users can create workbench using Ephemeral storage ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -135,16 +135,16 @@ Verify User Can Create And Start A Workbench With Ephimeral Storage Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Create A PV Storage - [Tags] Sanity ODS-1819 - [Documentation] Verifies users can create PersistenVolume storage + [Tags] Sanity Tier1 ODS-1819 + [Documentation] Verifies users can Create PersistentVolume Storage ${pv_name}= Set Variable ${PV_BASENAME}-A ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} ${workbenchs}= Create Dictionary ${WORKBENCH_TITLE}=mount-data - Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} + Create PersistentVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} ... project_title=${PRJ_TITLE} - Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} + Create PersistentVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${workbenchs} project_title=${PRJ_TITLE} Storage Should Be Listed name=${pv_name} description=${PV_DESCRIPTION} ... type=Persistent storage connected_workbench=${workbenchs} @@ -152,11 +152,11 @@ Verify User Can Create A PV Storage Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} Verify User Can Create And Start A Workbench With Existent PV Storage - [Tags] Sanity ODS-1814 + [Tags] Sanity Tier1 ODS-1814 [Documentation] Verifies users can create a workbench and connect an existent PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-existent Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} + Create PersistentVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} Create Workbench workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small @@ -168,7 +168,7 @@ Verify User Can Create And Start A Workbench With Existent PV Storage Check Corresponding Notebook CR Exists workbench_title=${WORKBENCH_2_TITLE} namespace=${ns_name} Verify User Can Create And Start A Workbench Adding A New PV Storage - [Tags] Sanity ODS-1816 + [Tags] Sanity Tier1 ODS-1816 [Documentation] Verifies users can create a workbench and connect a new PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-new ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -191,7 +191,7 @@ Verify User Can Create And Start A Workbench Adding A New PV Storage Storage Size Should Be name=${pv_name} namespace=${ns_name} size=${PV_SIZE} Verify User Can Stop A Workbench - [Tags] Sanity ODS-1817 + [Tags] Sanity Tier1 ODS-1817 [Documentation] Verifies users can stop a running workbench from project details page Open Data Science Project Details Page project_title=${PRJ_TITLE} Stop Workbench workbench_title=${WORKBENCH_TITLE} press_cancel=${TRUE} @@ -199,7 +199,7 @@ Verify User Can Stop A Workbench # add checks on notebook pod is terminated but CR is present Verify User Can Launch A Workbench - [Tags] Sanity ODS-1815 + [Tags] Sanity Tier1 ODS-1815 [Documentation] Verifies users can launch/open a running workbench from project details page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -210,7 +210,7 @@ Verify User Can Launch A Workbench ... image=${NB_IMAGE} namespace=${ns_name} Verify User Can Stop A Workbench From Projects Home Page - [Tags] Sanity ODS-1823 + [Tags] Sanity Tier1 ODS-1823 [Documentation] Verifies users can stop a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -222,7 +222,7 @@ Verify User Can Stop A Workbench From Projects Home Page # add checks on notebook pod is terminated but CR is present Verify User Can Start And Launch A Workbench From Projects Home Page - [Tags] Sanity ODS-1818 + [Tags] Sanity Tier1 ODS-1818 [Documentation] Verifies users can launch/open a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} @@ -234,7 +234,7 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} Verify User Can Delete A Workbench - [Tags] Sanity ODS-1813 + [Tags] Sanity Tier1 ODS-1813 [Documentation] Verifies users can delete a workbench ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -244,12 +244,12 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Check Workbench CR Is Deleted workbench_title=${WORKBENCH_TITLE} namespace=${ns_name} Verify User Can Delete A Persistent Storage - [Tags] Sanity ODS-1824 + [Tags] Sanity Tier1 ODS-1824 [Documentation] Verifies users can delete a PersistenVolume ${pv_name}= Set Variable ${PV_BASENAME}-TO-DELETE ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create PersistenVolume Storage name=${pv_name} description=${PV_DESCRIPTION} + Create PersistentVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} Delete Storage name=${pv_name} press_cancel=${TRUE} Delete Storage name=${pv_name} press_cancel=${FALSE} @@ -257,7 +257,7 @@ Verify User Can Delete A Persistent Storage Check Storage PersistentVolumeClaim Is Deleted storage_name=${pv_name} namespace=${ns_name} Verify User Can Add A S3 Data Connection - [Tags] Sanity ODS-1825 + [Tags] Sanity Tier1 ODS-1825 [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -269,7 +269,7 @@ Verify User Can Add A S3 Data Connection Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Delete A Data Connection - [Tags] Sanity ODS-1826 + [Tags] Sanity Tier1 ODS-1826 [Documentation] Verifies users can delete a Data connection ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} @@ -279,7 +279,7 @@ Verify User Can Delete A Data Connection Check Data Connection Secret Is Deleted dc_name=${DC_S3_NAME} namespace=${ns_name} Verify User Can Create A Workbench With Environment Variables - [Tags] Sanity ODS-1864 + [Tags] Sanity Tier1 ODS-1864 [Documentation] Verifies users can create a workbench and inject environment variables during creation ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB ... k8s_type=Secret input_type=${KEYVALUE_TYPE} @@ -297,7 +297,7 @@ Verify User Can Create A Workbench With Environment Variables Check Environment Variables Exist exp_env_variables=${envs_list} Verify User Can Delete A Data Science Project - [Tags] Sanity ODS-1784 + [Tags] Sanity Tier1 ODS-1784 [Documentation] Verifies users can delete a Data Science project ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Delete Data Science Project project_title=${PRJ_TITLE} From a8aeccf1aa8ed2b5abad3a3efaec6d678fc5b721 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Tue, 22 Nov 2022 18:32:14 +0100 Subject: [PATCH 69/70] fix comments by reviewers (2) --- .../415__ods_dashboard_projects.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 63ed36082..30efec905 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -233,7 +233,7 @@ Verify User Can Start And Launch A Workbench From Projects Home Page Launch Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} - Verify User Can Delete A Workbench +Verify User Can Delete A Workbench [Tags] Sanity Tier1 ODS-1813 [Documentation] Verifies users can delete a workbench ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} From 89af8936f61c7adbeab93fc75429488413a9ef5e Mon Sep 17 00:00:00 2001 From: bdattoma Date: Wed, 23 Nov 2022 09:54:53 +0100 Subject: [PATCH 70/70] fix robocop alerts --- .../DataConnections.resource | 2 +- .../ODHDataScienceProject/Storages.resource | 25 +++++----- .../Workbenches.resource | 14 +++--- .../415__ods_dashboard_projects.robot | 50 ++++++++++--------- 4 files changed, 47 insertions(+), 44 deletions(-) diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource index 48cd2f9e0..2e8711510 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/DataConnections.resource @@ -71,4 +71,4 @@ Delete Data Connection [Documentation] Deletes a Data Connection from DS Project details page [Arguments] ${name} ${press_cancel}=${FALSE} Click Action From Actions Menu item_title=${name} item_type=data connection action=Delete - Handle Deletion Confirmation Modal item_title=${name} item_type=data connection press_cancel=${press_cancel} \ No newline at end of file + Handle Deletion Confirmation Modal item_title=${name} item_type=data connection press_cancel=${press_cancel} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource index 07d1f66a7..ba46480c6 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Storages.resource @@ -16,13 +16,14 @@ ${STORAGE_WORKBENCH_SELECTOR_XP}= xpath=//div[contains(@class,"modal")]/ ${STORAGE_ADD_BTN_1_XP}= xpath=//div[div/h4[@id="cluster-storages"]]/div/button[text()="Add cluster storage"] ${STORAGE_ADD_BTN_2_XP}= xpath=//footer/button[contains(text(), "Add")] + *** Keywords *** Storage Should Be Listed [Documentation] Checks storage is listed in DS Project details page [Arguments] ${name} ${description} ${type} ${connected_workbench} - Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] - Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/p[text()="${description}"] - Run keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Type"]/p[text()=" ${type}"] + Run Keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/h4/div[text()="${name}"] + Run Keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//td[@data-label="Name"]/p[text()="${description}"] + Run Keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[@data-label="Type"]/p[text()=" ${type}"] IF "${connected_workbench}" == "${NONE}" Run Keyword And Continue On Failure Page Should Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]]/td[text()="No connections"] ELSE @@ -34,7 +35,7 @@ Storage Should Be Listed Storage Should Not Be Listed [Documentation] Checks storage is not listed in DS Project details page [Arguments] ${name} - Run keyword And Continue On Failure Wait Until Page Does Not Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] + Run Keyword And Continue On Failure Wait Until Page Does Not Contain Element ${STORAGE_SECTION_XP}//tr[td[@data-label="Name"]/h4/div[text()="${name}"]] Storage Size Should Be [Documentation] Checks displayed PV size corresponds to PV size in Openshift. @@ -44,11 +45,11 @@ Storage Size Should Be Wait Until Element Is Visible ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"] Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] ${displayed_size}= Get Text ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] - Run keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi + Run Keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].spec.resources.requests.storage}' - Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi + Run Keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi ${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.capacity.storage}' - Run keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi + Run Keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi Create PersistentVolume Storage [Documentation] Create a PersistenVolume storage in DS Project details page @@ -57,7 +58,7 @@ Create PersistentVolume Storage Fill In New PV Data ${name} ${description} ${size} ${connected_workbench} IF ${press_cancel} == ${TRUE} Click Button ${GENERIC_CANCEL_BTN_XP} - ELSE + ELSE Wait Until Element Is Enabled ${STORAGE_ADD_BTN_2_XP} Click Button ${STORAGE_ADD_BTN_2_XP} END @@ -78,7 +79,7 @@ Fill In New PV Data IF ${size} > 1 FOR ${counter} IN RANGE 1 ${size} Click Element ${STORAGE_SIZE_PLUS_BTN_XP} - END + END END IF "${connected_workbench}" == "${NONE}" Log msg=you are not connecting any workbenchs to ${name} PV @@ -90,7 +91,7 @@ Fill In New PV Data Run Keyword And Continue On Failure Element Should Be Enabled ${STORAGE_ADD_BTN_2_XP} END END - + Set Connection Between PV And Workbench [Documentation] Connects a PV to an existent workbench [Arguments] ${workbench_title} ${mount_dir} @@ -108,8 +109,8 @@ Delete Storage Click Action From Actions Menu item_title=${name} item_type=storage action=Delete Handle Deletion Confirmation Modal item_title=${name} item_type=storage press_cancel=${press_cancel} -Get Openshift PVC From Storage +Get Openshift PVC From Storage [Documentation] Retrieves the PVC resource name from Openshift given the Displayed Name in DS Project details page [Arguments] ${name} ${namespace} ${rc} ${pvc_name}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].metadata.name}' - [Return] ${rc} ${pvc_name} \ No newline at end of file + [Return] ${rc} ${pvc_name} diff --git a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index a80f4343d..27c92bd1c 100644 --- a/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -91,7 +91,7 @@ Add Environment Variables In Workbench IF ${n_pairs}-${pair_idx} > 1 Click Element ${ENV_VARIABLES_SECTION_XP}/div[@class="pf-l-split"][${idx}]//button[text()="Add another variable"] END - END + END END IF ${n_objects}-${idx} > 0 Click Button Add more variables @@ -184,13 +184,13 @@ Start Workbench END Wait Until Workbench Is Started workbench_title=${workbench_title} -Access To Workbench +Access To Workbench [Documentation] Gets access to a workbench from DS Project details page after it got launched [Arguments] ${username}=${TEST_USER.USERNAME} ${password}=${TEST_USER.PASSWORD} ${auth_type}=${TEST_USER.AUTH_TYPE} Switch Window NEW Run Keyword And Warn On Failure Login To Openshift ${username} ${password} ${auth_type} - ${authorization_required} = Is Service Account Authorization Required - Run Keyword If ${authorization_required} Authorize jupyterhub service account + ${authorization_required}= Is Service Account Authorization Required + Run Keyword If ${authorization_required} Authorize Jupyterhub Service Account Wait Until Page Contains Element xpath://div[@id="jp-top-panel"] timeout=60s Maybe Close Popup @@ -214,7 +214,7 @@ Stop Workbench IF ${is_started} == ${TRUE} Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/h4[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"] Wait Until Generic Modal Appears - Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} + Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ELSE Fail msg=Cannot stop workbench ${workbench_title} because it is not running... END @@ -237,12 +237,11 @@ Handle Stop Workbench Confirmation Modal Click Action From Actions Menu [Documentation] Clicks an action from Actions menu (3-dots menu on the right) - [Arguments] ${item_title} ${item_type} ${action} + [Arguments] ${item_title} ${item_type} ${action} Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/button[@aria-label="Actions"] Wait Until Page Contains Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] Click Element xpath=//tr[td[@data-label="Name"]//*[text()="${item_title}"]]/td[@class="pf-c-table__action"]/div/ul/li/button[text()="Delete ${item_type}"] - Handle Deletion Confirmation Modal [Documentation] Handles confirmation modal on item deletion [Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} ${additional_msg}=${NONE} @@ -263,7 +262,6 @@ Handle Deletion Confirmation Modal END Wait Until Generic Modal Disappears - Delete Workbench [Documentation] Deletes a workbench [Arguments] ${workbench_title} ${press_cancel}=${FALSE} diff --git a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot index 30efec905..575594ac6 100644 --- a/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot +++ b/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects.robot @@ -37,12 +37,16 @@ ${DC_S3_TYPE}= Object storage *** Test Cases *** -Verify Data Science Project Page Is Accessible +Verify Data Science Projects Page Is Accessible + [Documentation] Verifies "Data Science Projects" page is accessible from + ... the navigation menu on the left [Tags] Smoke ODS-1876 Open Data Science Projects Home Page Page Should Contain Element ${PROJECT_CREATE_BTN_XP} Verify User Can Access Jupyter Launcher From DS Project Page + [Documentation] Verifies Data Science Projects home page contains + ... a link to Jupyter Spawner and it is working [Tags] Smoke ODS-1877 Open Data Science Projects Home Page Page Should Contain Element ${SPAWNER_LINK} @@ -57,7 +61,7 @@ Verify User Cannot Create Project With Empty Fields Verify User Cannot Create Project Using Special Chars In Resource Name [Tags] Sanity Tier1 ODS-1875 - [Documentation] Verifies users is not allowed to create a project with a custom resource name + [Documentation] Verifies users is not allowed to create a project with a custom resource name ... containing special characters like "@" or "!" Create Project With Special Chars In Resource Name And Expect Error Close Generic Modal If Present @@ -110,7 +114,7 @@ Verify User Can Create A Data Science Project [Documentation] Verifies users can create a DS project [Setup] Launch Data Science Project Main Page Open Data Science Projects Home Page - Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} + Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION} ... resource_name=${PRJ_RESOURCE_NAME} Open Data Science Projects Home Page Project Should Be Listed project_title=${PRJ_TITLE} @@ -125,8 +129,8 @@ Verify User Can Create And Start A Workbench With Ephimeral Storage Create Workbench workbench_title=${EMPTY} workbench_description=${EMPTY} prj_title=${PRJ_TITLE} ... image_name=${NB_IMAGE} deployment_size=Small storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} press_cancel=${TRUE} - Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} - ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + Create Workbench workbench_title=${WORKBENCH_TITLE} workbench_description=${WORKBENCH_DESCRIPTION} + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Ephemeral pv_existent=${NONE} ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_TITLE} @@ -142,7 +146,7 @@ Verify User Can Create A PV Storage Open Data Science Project Details Page project_title=${PRJ_TITLE} ${workbenchs}= Create Dictionary ${WORKBENCH_TITLE}=mount-data Create PersistentVolume Storage name=${pv_name} description=${PV_DESCRIPTION} - ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} + ... size=${PV_SIZE} connected_workbench=${NONE} press_cancel=${TRUE} ... project_title=${PRJ_TITLE} Create PersistentVolume Storage name=${pv_name} description=${PV_DESCRIPTION} ... size=${PV_SIZE} connected_workbench=${workbenchs} project_title=${PRJ_TITLE} @@ -160,7 +164,7 @@ Verify User Can Create And Start A Workbench With Existent PV Storage ... size=${PV_SIZE} connected_workbench=${NONE} project_title=${PRJ_TITLE} Create Workbench workbench_title=${WORKBENCH_2_TITLE} workbench_description=${WORKBENCH_2_DESCRIPTION} ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small - ... storage=Persistent pv_existent=${TRUE} pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} + ... storage=Persistent pv_existent=${TRUE} pv_name=${pv_name} pv_description=${NONE} pv_size=${NONE} Workbench Should Be Listed workbench_title=${WORKBENCH_2_TITLE} Workbench Status Should Be workbench_title=${WORKBENCH_2_TITLE} status=${WORKBENCH_STATUS_STARTING} Run Keyword And Continue On Failure Wait Until Workbench Is Started workbench_title=${WORKBENCH_2_TITLE} @@ -174,7 +178,7 @@ Verify User Can Create And Start A Workbench Adding A New PV Storage ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} Create Workbench workbench_title=${WORKBENCH_3_TITLE} workbench_description=${WORKBENCH_3_DESCRIPTION} - ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Persistent pv_existent=${FALSE} ... pv_name=${pv_name} pv_description=${PV_DESCRIPTION} pv_size=${PV_SIZE} Workbench Should Be Listed workbench_title=${WORKBENCH_3_TITLE} @@ -206,7 +210,7 @@ Verify User Can Launch A Workbench Open Data Science Project Details Page project_title=${PRJ_TITLE} Start Workbench workbench_title=${WORKBENCH_TITLE} Launch Workbench workbench_title=${WORKBENCH_TITLE} - Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} + Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} ... image=${NB_IMAGE} namespace=${ns_name} Verify User Can Stop A Workbench From Projects Home Page @@ -214,9 +218,9 @@ Verify User Can Stop A Workbench From Projects Home Page [Documentation] Verifies users can stop a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} ... namespace=${ns_name} - Stop Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + Stop Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} ... workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Workbench Launch Link Should Be Disabled workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} # add checks on notebook pod is terminated but CR is present @@ -226,9 +230,9 @@ Verify User Can Start And Launch A Workbench From Projects Home Page [Documentation] Verifies users can launch/open a running workbench from Data Science Projects home page Open Data Science Projects Home Page ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} - ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} + ${_} ${workbench_cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${WORKBENCH_TITLE} ... namespace=${ns_name} - Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} + Start Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} ... workbench_cr_name=${workbench_cr_name} namespace=${ns_name} Launch Workbench From Projects Home Page workbench_title=${WORKBENCH_TITLE} project_title=${PRJ_TITLE} Check Launched Workbench Is The Correct One workbench_title=${WORKBENCH_TITLE} image=${NB_IMAGE} namespace=${ns_name} @@ -261,9 +265,9 @@ Verify User Can Add A S3 Data Connection [Documentation] Verifies users can add a Data connection to AWS S3 ${ns_name}= Get Openshift Namespace From Data Science Project project_title=${PRJ_TITLE} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} - ... aws_access_key=${DC_S3_AWS_SECRET_ACCESS_KEY} - ... aws_secret_access=${DC_S3_AWS_SECRET_ACCESS_KEY} + Create S3 Data Connection project_title=${PRJ_TITLE} dc_name=${DC_S3_NAME} + ... aws_access_key=${DC_S3_AWS_SECRET_ACCESS_KEY} + ... aws_secret_access=${DC_S3_AWS_SECRET_ACCESS_KEY} ... aws_s3_endpoint=${DC_S3_ENDPOINT} aws_region=${DC_S3_REGION} Data Connection Should Be Listed name=${DC_S3_NAME} type=${DC_S3_TYPE} connected_workbench=${NONE} Check Corresponding Data Connection Secret Exists dc_name=${DC_S3_NAME} namespace=${ns_name} @@ -281,16 +285,16 @@ Verify User Can Delete A Data Connection Verify User Can Create A Workbench With Environment Variables [Tags] Sanity Tier1 ODS-1864 [Documentation] Verifies users can create a workbench and inject environment variables during creation - ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB + ${envs_var_secrets}= Create Dictionary secretA=TestVarA secretB=TestVarB ... k8s_type=Secret input_type=${KEYVALUE_TYPE} - ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM + ${envs_var_cm}= Create Dictionary cmA=TestVarA-CM cmB=TestVarB-CM ... k8s_type=Config Map input_type=${KEYVALUE_TYPE} ${envs_list}= Create List ${envs_var_secrets} ${envs_var_cm} Open Data Science Project Details Page project_title=${PRJ_TITLE} - Create Workbench workbench_title=${WORKBENCH_TITLE}-envs workbench_description=${WORKBENCH_DESCRIPTION} - ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small + Create Workbench workbench_title=${WORKBENCH_TITLE}-envs workbench_description=${WORKBENCH_DESCRIPTION} + ... prj_title=${PRJ_TITLE} image_name=${NB_IMAGE} deployment_size=Small ... storage=Ephemeral pv_existent=${NONE} - ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} + ... pv_name=${NONE} pv_description=${NONE} pv_size=${NONE} ... press_cancel=${FALSE} envs=${envs_list} Wait Until Workbench Is Started workbench_title=${WORKBENCH_TITLE}-envs Launch Workbench workbench_title=${WORKBENCH_TITLE}-envs @@ -331,9 +335,9 @@ Set Variables For User Access Test Launch Data Science Project Main Page [Documentation] Launch DS Projects page in RHODS Dashboard using a given user - [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} + [Arguments] ${username}=${TEST_USER_3.USERNAME} ${password}=${TEST_USER_3.PASSWORD} ... ${ocp_user_auth_type}=${TEST_USER_3.AUTH_TYPE} - Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} + Launch Dashboard ocp_user_name=${username} ocp_user_pw=${password} ocp_user_auth_type=${ocp_user_auth_type} ... dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS} Open Data Science Projects Home Page