Skip to content

Commit 5178667

Browse files
committed
new jl selector refactoring
Signed-off-by: bdattoma <[email protected]>
1 parent 367331c commit 5178667

File tree

4 files changed

+14
-47
lines changed

4 files changed

+14
-47
lines changed

src/JupyterLibrary/clients/jupyterlab/Notebook.resource

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ Run Current JupyterLab Code Cell
5555

5656
Get Selected Tab ID
5757
[Documentation] Return the tab ID of the selected notebook tab
58-
${active-nb-tab} = Get WebElement xpath:${JL_TABBAR_SELECTED_XPATH}
58+
${active-nb-tab} = Get WebElement xpath:${JLAB XP DOCK TAB SELECTED}
5959
${tab-id} = Get Element Attribute ${active-nb-tab} id
6060
[Return] ${tab-id}
6161

6262
Select Tab By Name
6363
[Documentation] Select a notebook tab by filename
6464
[Arguments] ${filename}
65-
Click Element xpath:${JL_TABBAR_CONTENT_XPATH}/li/div[.="${filename}"]
65+
Click Element xpath:${JLAB XP DOCK TABBAR CONTENT}/li/div[.="${filename}"]

src/JupyterLibrary/clients/jupyterlab/Output.resource

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Wait Until a Given JupyterLab Code Cell Is Not Active In a Given Tab
4646
[Documentation] Waits until the given cell in a specific JL tab no longer has an active prompt "[*]:".
4747
... The cell index starts from 1 and you must count empty and markdown cells too.
4848
[Arguments] ${tab_id_to_wait} ${cell_n} ${timeout}=120seconds
49-
Wait Until Element Is Not Visible xpath=//div[@aria-labelledby="${tab_id_to_wait}"]/${NB TAB XP CONTENT}/div[${cell_n}]/${CELL XP INPUT STATUS ICON} ${timeout}
49+
Wait Until Element Is Not Visible xpath=//div[@aria-labelledby="${tab_id_to_wait}"]/${JLAB XP NOTEBOOK CONTENT}/div[${cell_n}]/${JLAB XP CELL INPUT STATUS ICON} ${timeout}
5050

5151
Get A JupyterLab Code Cell Output In a Given Tab
5252
[Documentation] It returns the output of a given cell in a specific JL tab.
5353
... The cell index starts from 1 and you must count empty and markdown cells too.
5454
[Arguments] ${tab_id_to_read} ${cell_n}
55-
${outputtext}= Get Text xpath=//div[@aria-labelledby="${tab_id_to_read}"]/${NB TAB XP CONTENT}/div[${cell_n}]/${CELL XP OUTPUT TEXT}
55+
${outputtext}= Get Text xpath=//div[@aria-labelledby="${tab_id_to_read}"]/${JLAB XP NOTEBOOK CONTENT}/div[${cell_n}]/${JLAB XP CELL OUTPUT TEXT}}
5656
[Return] ${outputtext}

src/JupyterLibrary/clients/jupyterlab/Selectors.resource

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,14 @@ ${JLAB XP NB TOOLBAR} //div${JLAB XP NB TOOLBAR FRAG}
4040
${JLAB XP BUSY KERNEL} //*[local-name() = 'div' and contains(@class, 'jp-FilledCircleIcon' or (local-name() = 'svg' and contains(@data-icon, 'ui-components:circle-filled')))]
4141
# dock panel
4242
${JLAB XP DOCK PANEL} //*[@id = 'jp-main-dock-panel']
43-
${JLAB XP DOCK TAB} ${JLAB XP DOCK PANEL}//ul[contains(@class, 'p-TabBar-content')]/li[contains(@class, 'p-TabBar-tab')]
43+
${JLAB XP DOCK TABBAR CONTENT} ${JLAB XP DOCK PANEL}//ul[contains(@class, 'p-TabBar-content')]
44+
${JLAB XP DOCK TAB} ${JLAB XP DOCK TABBAR CONTENT}/li[contains(@class, 'p-TabBar-tab')]
4445
${JLAB XP DOCK TAB LABEL} ${JLAB XP DOCK TAB}/div[contains(@class, 'p-TabBar-tabLabel')]
46+
${JLAB XP DOCK TAB SELECTED} ${JLAB XP DOCK TABBAR CONTENT}/li[contains(@class,"lm-mod-current p-mod-current")]
47+
# notebook
48+
${JLAB XP CELL INPUT AREA} div[contains(@class, p-Cell-inputWrapper)]/div[contains(@class,"jp-Cell-inputArea")]
49+
${JLAB XP CELL INPUT STATUS ICON} ${JLAB XP CELL INPUT AREA}/div[contains(@class,"jp-InputArea-prompt") and (.="[*]:")]
50+
${JLAB XP CELL OUTPUT AREA} div[contains(@class, jp-Cell-outputWrapper)]/div[contains(@class,"jp-Cell-outputArea")]
51+
${JLAB XP CELL OUTPUT TEXT} ${JLAB XP CELL OUTPUT AREA}//div[contains(@class,"jp-RenderedText")]
52+
${JLAB XP NOTEBOOK CONTENT} div[@aria-label="notebook content"]
53+

src/JupyterLibrary/clients/jupyterlab/Selectors.robot

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)