From 89480f8e2bf31633df98b5a97766460d2db9d3cb Mon Sep 17 00:00:00 2001 From: Fede Alonso Date: Tue, 8 Oct 2024 16:55:03 +0200 Subject: [PATCH] Fix; 11846 user can start stop launch delete workbench (#1901) * fix: ODS-2206, wrong pipelines xpath * fix: Verify Users Can Start, Stop, Launch And Delete A Workbench --- .../Page/ODH/JupyterHub/JupyterLabLauncher.robot | 4 +--- .../ODHDataScienceProject/Workbenches.resource | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterLabLauncher.robot b/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterLabLauncher.robot index bf1481930..2ce7db705 100644 --- a/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterLabLauncher.robot +++ b/ods_ci/tests/Resources/Page/ODH/JupyterHub/JupyterLabLauncher.robot @@ -357,15 +357,13 @@ Add And Run JupyterLab Code Cell 5 In Active Notebook [Arguments] @{code} ${n}=1 # This keyword was copied and amended from JupyterLibrary resources - Notebook.Add And Run JupyterLab Code Cell. - ${add icon} = Get JupyterLab Icon XPath Custom add - ${nb} = Get WebElement xpath://div${JLAB XP NB FRAG}\[${n}] ${nbid} = Get Element Attribute ${nb} id ${active-nb-tab} = Get WebElement xpath:${JL_TABBAR_SELECTED_XPATH} ${tab-id} = Get Element Attribute ${active-nb-tab} id - Click Element xpath://div[@aria-labelledby="${tab-id}"]/div[1]//${add icon} + Click Element xpath://div[@aria-labelledby="${tab-id}"]//div[@data-jp-item-name="insert"] Sleep 0.1s Click Element xpath://div[@aria-labelledby="${tab-id}"]//div[contains(concat(' ',normalize-space(@class),' '),' jp-mod-selected ')] Set CodeMirror Value \#${nbid}${JLAB CSS ACTIVE INPUT} @{code} diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource index 55cb744cc..aab346d7c 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Workbenches.resource @@ -333,7 +333,9 @@ Start Workbench ${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}//div[text()="${workbench_title}"]/ancestor::tr/td[@data-label="Status"]//label[@data-ouia-component-type="PF5/Switch"] + Click Button xpath=//div[@data-testid="table-row-title"]//span[text()="${workbench_title}"]/ancestor::tr//button[@aria-label="Kebab toggle"] + Wait Until Element Is Visible xpath=//div[@data-testid="table-row-title"]//span[text()="${workbench_title}"]/ancestor::tr//button[@aria-label="Kebab toggle"]/following::div//span[text()="Start"] timeout=10 + Click Element xpath=//div[@data-testid="table-row-title"]//span[text()="${workbench_title}"]/ancestor::tr//button[@aria-label="Kebab toggle"]/following::div//span[text()="Start"] ELSE Log msg=Cannot start ${workbench_title} workbench because it is not stopped. END @@ -405,7 +407,9 @@ Stop Workbench ${is_starting}= Run Keyword And Return Status Workbench Status Should Be ... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STARTING} IF ${is_started} == ${TRUE} or ${is_starting} == ${TRUE} - Click Element ${WORKBENCH_SECTION_XP}//div[text()="${workbench_title}"]/ancestor::tr/td[@data-label="Status"]//label[@data-ouia-component-type="PF5/Switch"] + Click Button xpath=//div[@data-testid="table-row-title"]//span[text()="${workbench_title}"]/ancestor::tr//button[@aria-label="Kebab toggle"] + Wait Until Element Is Visible xpath=//div[@data-testid="table-row-title"]//span[text()="${workbench_title}"]/ancestor::tr//button[@aria-label="Kebab toggle"]/following::div//span[text()="Stop"] timeout=10 + Click Element xpath=//div[@data-testid="table-row-title"]//span[text()="${workbench_title}"]/ancestor::tr//button[@aria-label="Kebab toggle"]/following::div//span[text()="Stop"] Wait Until Generic Modal Appears Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel} ... from_running=${from_running}