diff --git a/src/JupyterLibrary/clients/jupyterlab/Selectors.resource b/src/JupyterLibrary/clients/jupyterlab/Selectors.resource index 006458ce..fcaf7f66 100644 --- a/src/JupyterLibrary/clients/jupyterlab/Selectors.resource +++ b/src/JupyterLibrary/clients/jupyterlab/Selectors.resource @@ -38,6 +38,9 @@ ${JLAB XP NB FRAG} ${JLAB XP MAIN AREA FRAG}\[contains(@cla ${JLAB XP NB TOOLBAR FRAG} [contains(@class, 'jp-NotebookPanel-toolbar')] ${JLAB XP NB TOOLBAR} //div${JLAB XP NB TOOLBAR FRAG} ${JLAB XP BUSY KERNEL} //*[local-name() = 'div' and contains(@class, 'jp-FilledCircleIcon' or (local-name() = 'svg' and contains(@data-icon, 'ui-components:circle-filled')))] +${JLAB XP CONTENT XPATH} //div[contains(@class,"p-DockPanel-tabBar")]/ul[@class="p-TabBar-content"] +${JLAB XP NOT SELECTED XPATH} ${JLAB XP CONTENT XPATH}/li[not(contains(@class,"p-mod-current"))] +${JLAB POPUP} //div[contains(concat(' ',normalize-space(@class),' '),' jp-Dialog-footer ')] # dock panel ${JLAB XP DOCK PANEL} //*[@id = 'jp-main-dock-panel'] ${JLAB XP DOCK TAB} ${JLAB XP DOCK PANEL}//ul[contains(@class, 'p-TabBar-content')]/li[contains(@class, 'p-TabBar-tab')] diff --git a/src/JupyterLibrary/clients/jupyterlab/Shell.resource b/src/JupyterLibrary/clients/jupyterlab/Shell.resource index 8b9488f5..53b9d105 100644 --- a/src/JupyterLibrary/clients/jupyterlab/Shell.resource +++ b/src/JupyterLibrary/clients/jupyterlab/Shell.resource @@ -61,9 +61,22 @@ Open With JupyterLab Menu END Maybe Accept A JupyterLab Prompt - [Documentation] Click the accept button in a JupyterLab dialog (if one is open). - ${accept} = Get WebElements css:${JLAB CSS ACCEPT} - Run Keyword If ${accept} Click Element ${accept[0]} + [Documentation] Click the last button in a JupyterLab dialog (if one is open). + ${accept} = Get WebElements xpath:${JLAB POPUP} + ${len} = Get Length ${accept} + # Click the right most button of the popup + Run Keyword If ${accept} Click Element xpath:${JLAB POPUP}/button[last()] + [Return] ${len} + +Maybe Accept All JupyterLab Prompts + [Documentation] Try accepting all JL popups. + ${total} = Set Variable ${0} + FOR ${i} IN RANGE 9999999 + ${closed} = Maybe Accept A JupyterLab Prompt + ${total} = ${total}+${closed} + Exit For Loop If ${closed}==0 + END + [Return] ${total} Get JupyterLab Dock Panel Tab [Documentation] Get the ``n`` -th JupyterLab Dock Panel Tab with ``label`` as a ``WebElement``.