Skip to content

Commit aac1cd4

Browse files
committed
rebase
1 parent 6d78fad commit aac1cd4

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

src/JupyterLibrary/clients/jupyterlab/Notebook.resource

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ Run Current JupyterLab Code Cell
5252
... ${nb.find_element_by_xpath('''div${JLAB XP NB TOOLBAR FRAG}//${run icon}''')}
5353
Click Element ${run btn}
5454
Sleep 0.5s
55+
56+
Get Selected Tab ID
57+
[Documentation] Return the tab ID of the selected notebook tab
58+
${active-nb-tab} = Get WebElement xpath:${JL_TABBAR_SELECTED_XPATH}
59+
${tab-id} = Get Element Attribute ${active-nb-tab} id
60+
[Return] ${tab-id}
61+
62+
Select Tab By Name
63+
[Documentation] Select a notebook tab by filename
64+
[Arguments] ${filename}
65+
Click Element xpath:${JL_TABBAR_CONTENT_XPATH}/li/div[.="${filename}"]

src/JupyterLibrary/clients/jupyterlab/Output.resource

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ Screenshot Each Output Of Active JupyterLab Document
4141
Screenshot Each Output Of Active JupyterLab Cell ${prefix}_cell_${i}
4242
Screenshot Markdown Of Active JupyterLab Cell ${prefix}_cell_${i}
4343
END
44+
45+
Wait Until a Given JupyterLab Code Cell Is Not Active In a Given Tab
46+
[Documentation] Waits until the given cell in a specific JL tab no longer has an active prompt "[*]:".
47+
[Arguments] ${tab_id_to_wait} ${cell_n} ${timeout}=120seconds
48+
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+
50+
Get A JupyterLab Code Cell Output In a Given Tab
51+
[Documentation] It returns the output of a given cell in a specific JL tab
52+
[Arguments] ${tab_id_to_read} ${cell_n}
53+
${outputtext}= Get Text xpath=//div[@aria-labelledby="${tab_id_to_read}"]/${NB TAB XP CONTENT}/div[${cell_n}]/${CELL XP OUTPUT TEXT}
54+
[Return] ${outputtext}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
*** Variables ***
2+
# css selectors
3+
${JLAB CSS ACCEPT} .jp-mod-accept
4+
${JLAB CSS ACTIVE DOC} .jp-Document:not(.jp-mod-hidden)
5+
${JLAB CSS ACTIVE DOC CELLS} ${JLAB CSS ACTIVE DOC} .jp-Cell
6+
${JLAB CSS ACTIVE CELL} ${JLAB CSS ACTIVE DOC} .jp-Cell.jp-mod-active
7+
${JLAB CSS ACTIVE INPUT} ${JLAB CSS ACTIVE CELL} .CodeMirror
8+
${JLAB CSS ACTIVE OUTPUT CHILDREN} ${JLAB CSS ACTIVE CELL} .jp-OutputArea-child
9+
${JLAB CSS OUTPUT} .jp-OutputArea-output
10+
${JLAB CSS ACTIVE CELL MARKDOWN} ${JLAB CSS ACTIVE CELL} .jp-MarkdownOutput:not(.jp-mod-hidden)
11+
${JLAB CSS ACTIVE SIDEBAR} .jp-SideBar .p-TabBar-tab.p-mod-current
12+
${JLAB CSS BUSY KERNEL} .jp-Toolbar-kernelStatus.jp-FilledCircleIcon
13+
${JLAB CSS CMD INPUT} .p-CommandPalette-input
14+
${JLAB CSS CMD ITEM} .p-CommandPalette-item
15+
${JLAB CSS NB TOOLBAR} .jp-NotebookPanel-toolbar
16+
${JLAB CSS SIDEBAR TAB} .jp-SideBar .p-TabBar-tab
17+
${JLAB CSS SPINNER} .jp-Spinner
18+
# magic ids
19+
${JLAB ID SPLASH} jupyterlab-splash
20+
# magic strings
21+
${JLAB TEXT BUSY PROMPT} In [*]:
22+
# xpath selectors
23+
${JLAB XP LAUNCHER} //div[contains(@class, 'jp-Launcher-body')]
24+
${JLAB XP CARD} //div[contains(@class, 'jp-LauncherCard')]
25+
${JLAB XP DOCK} //div[@id='jp-main-dock-panel']
26+
${JLAB XP MENU ITEM LABEL} //div[contains(@class, 'p-Menu-itemLabel')]
27+
${JLAB XP MENU LABEL} //div[contains(@class, 'p-MenuBar-itemLabel')]
28+
${JLAB XP TOP} //div[@id='jp-top-panel']
29+
${JLAB XP MAIN AREA FRAG} [contains(@class, 'jp-MainAreaWidget')]
30+
${JLAB XP NB FRAG} ${JLAB XP MAIN AREA FRAG}\[contains(@class, 'jp-NotebookPanel')]
31+
${JLAB XP NB TOOLBAR FRAG} [contains(@class, 'jp-NotebookPanel-toolbar')]
32+
${JLAB XP NB TOOLBAR} //div${JLAB XP NB TOOLBAR FRAG}
33+
${JLAB XP BUSY KERNEL} //*[local-name() = 'div' and conttains(@class, 'jp-FilledCircleIcon' or (local-name() = 'svg' and contains(@data-icon, 'ui-components:circle-filled')))]
34+
${CELL XP INPUT} div[contains(@class, p-Cell-inputWrapper)]/div[contains(@class,"jp-Cell-inputArea")]
35+
${CELL XP INPUT STATUS ICON} ${CELL XP INPUT}/div[contains(@class,"jp-InputArea-prompt") and (.="[*]:")]
36+
${CELL XP OUTPUT} div[contains(@class, jp-Cell-outputWrapper)]/div[contains(@class,"jp-Cell-outputArea")]
37+
${CELL XP OUTPUT TEXT} ${CELL XP OUTPUT}//div[contains(@class,"jp-RenderedText")]
38+
${NB TAB XP CONTENT} div[@aria-label="notebook content"]
39+
## dock panel
40+
${JLAB XP DOCK PANEL} //*[@id = 'jp-main-dock-panel']
41+
${JLAB XP DOCK TAB} ${JLAB XP DOCK PANEL}//ul[contains(@class, 'p-TabBar-content')]/li[contains(@class, 'p-TabBar-tab')]
42+
${JLAB XP DOCK TAB LABEL} ${JLAB XP DOCK TAB}/div[contains(@class, 'p-TabBar-tabLabel')]

0 commit comments

Comments
 (0)