Skip to content

Commit 7818640

Browse files
committed
fix conflicts
2 parents 5178667 + a98e2e5 commit 7818640

File tree

3 files changed

+67
-28
lines changed

3 files changed

+67
-28
lines changed

src/JupyterLibrary/clients/jupyterlab/Notebook.resource

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
*** Settings ***
2-
Documentation Notebook keywords for JupyterLab
3-
4-
Resource JupyterLibrary/clients/jupyterlab/Selectors.resource
5-
Resource JupyterLibrary/common/CodeMirror.resource
2+
Resource JupyterLibrary/clients/jupyterlab/Selectors.robot
3+
Resource JupyterLibrary/common/CodeMirror.robot
64

75
*** Variables ***
8-
@{HELLO WORLD} print("hello world")
6+
@{HELLO WORLD} print("hello world")
97

108
*** Keywords ***
11-
Add And Run JupyterLab Code Cell
9+
Add and Run JupyterLab Code Cell
10+
[Arguments] @{code} ${n}=1
1211
[Documentation] Add a ``code`` cell to the ``n`` th notebook on the page and run it.
1312
... ``code`` is a list of strings to set as lines in the code editor.
1413
... ``n`` is the 1-based index of the notebook, usually in order of opening.
15-
[Arguments] @{code} ${n}=1
14+
${nl} = Set Variable \n
1615
${add icon} = Get JupyterLab Icon XPath add
1716
${nb} = Get WebElement xpath://div${JLAB XP NB FRAG}\[${n}]
1817
# rely on main area widgets all having ids
@@ -27,9 +26,9 @@ Add And Run JupyterLab Code Cell
2726
Click Element ${cell}
2827

2928
Wait Until JupyterLab Kernel Is Idle
29+
[Arguments] ${n}=1
3030
[Documentation] Wait for a kernel to be busy, and then stop being busy, in the ``n`` th notebook.
3131
... ``n`` is the 1-based index of the notebook, usually in order of opening.
32-
[Arguments] ${n}=1
3332
${busy icon} = Get JupyterLab Icon XPath filled circle
3433
${sel} = Set Variable
3534
... xpath://div${JLAB XP NB FRAG}\[${n}]//div${JLAB XP NB TOOLBAR FRAG}//${busy icon}
@@ -43,9 +42,9 @@ Save JupyterLab Notebook
4342
Execute JupyterLab Command Save Notebook
4443

4544
Run Current JupyterLab Code Cell
45+
[Arguments] ${n}=1
4646
[Documentation] Run the currently-selected cell(s) in the ``n`` th notebook.
4747
... ``n`` is the 1-based index of the notebook, usually in order of opening.
48-
[Arguments] ${n}=1
4948
${run icon} = Get JupyterLab Icon XPath run
5049
${nb} = Get WebElement xpath://div${JLAB XP NB FRAG}\[${n}]
5150
${run btn} = Set Variable
@@ -55,11 +54,11 @@ Run Current JupyterLab Code Cell
5554

5655
Get Selected Tab ID
5756
[Documentation] Return the tab ID of the selected notebook tab
58-
${active-nb-tab} = Get WebElement xpath:${JLAB XP DOCK TAB SELECTED}
57+
${active-nb-tab} = Get WebElement xpath:${JL_TABBAR_SELECTED_XPATH}
5958
${tab-id} = Get Element Attribute ${active-nb-tab} id
6059
[Return] ${tab-id}
6160

6261
Select Tab By Name
6362
[Documentation] Select a notebook tab by filename
6463
[Arguments] ${filename}
65-
Click Element xpath:${JLAB XP DOCK TABBAR CONTENT}/li/div[.="${filename}"]
64+
Click Element xpath:${JL_TABBAR_CONTENT_XPATH}/li/div[.="${filename}"]
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,54 @@
11
*** Settings ***
2-
Documentation Output keywords for JupyterLab
3-
4-
Resource JupyterLibrary/clients/jupyterlab/Selectors.resource
2+
Resource JupyterLibrary/clients/jupyterlab/Selectors.robot
53

64
*** Keywords ***
75
Current JupyterLab Cell Output Should Contain
8-
[Documentation] Check the current active Notebook cell for the ``expected`` text.
96
[Arguments] ${expected}
7+
[Documentation] Check the current active Notebook cell for the ``expected`` text.
108
Wait Until Page Contains Element css:${JLAB CSS ACTIVE OUTPUT CHILDREN}
119
Element Should Contain css:${JLAB CSS ACTIVE OUTPUT CHILDREN} ${expected}
1210

13-
Screenshot Each Output Of Active JupyterLab Cell
11+
Screenshot Each Output of Active JupyterLab Cell
12+
[Arguments] ${prefix}
1413
[Documentation] Capture all of the outputs of the current _Cell_ as screenshots
1514
... with a ``prefix`` (may include folders).
16-
[Arguments] ${prefix}
1715
${outputs} = Get WebElements css:${JLAB CSS ACTIVE OUTPUT CHILDREN} ${JLAB CSS OUTPUT} > *
1816
FOR ${i} IN RANGE ${outputs.__len__()}
1917
Capture Element Screenshot ${outputs[${i}]} ${prefix}_output_${i}.png
2018
END
2119

22-
Screenshot Markdown Of Active JupyterLab Cell
20+
Screenshot Markdown of Active JupyterLab Cell
21+
[Arguments] ${prefix}
2322
[Documentation] Capture all of the rendered Markdown of the current _Document_ as screenshots
2423
... with a ``prefix`` (may include folders).
25-
[Arguments] ${prefix}
2624
${inputs} = Get WebElements css:${JLAB CSS ACTIVE CELL MARKDOWN}
2725
FOR ${i} IN RANGE ${inputs.__len__()}
2826
Capture Element Screenshot ${inputs[${i}]} ${prefix}_markdown_${i}.png
2927
END
3028

31-
Screenshot Each Output Of Active JupyterLab Document
29+
Screenshot Each Output of Active JupyterLab Document
30+
[Arguments] ${prefix}
3231
[Documentation] Capture all of the outputs of the current _Document_ as
3332
... screenshots with a ``prefix`` (may include folders).
34-
[Arguments] ${prefix}
3533
${cells} = Get WebElements css:${JLAB CSS ACTIVE DOC CELLS}
3634
FOR ${i} IN RANGE ${cells.__len__()}
37-
Click Element ${cells[${i}]}
38-
Run Keyword And Ignore Error Click Element ${cells[${i + 1}]}
39-
Click Element ${cells[${i}]}
35+
Click element ${cells[${i}]}
36+
Run Keyword And Ignore Error Click element ${cells[${i + 1}]}
37+
Click element ${cells[${i}]}
4038
Sleep 0.1s
41-
Screenshot Each Output Of Active JupyterLab Cell ${prefix}_cell_${i}
42-
Screenshot Markdown Of Active JupyterLab Cell ${prefix}_cell_${i}
39+
Screenshot Each Output of Active JupyterLab Cell ${prefix}_cell_${i}
40+
Screenshot Markdown of Active JupyterLab Cell ${prefix}_cell_${i}
4341
END
4442

4543
Wait Until a Given JupyterLab Code Cell Is Not Active In a Given Tab
4644
[Documentation] Waits until the given cell in a specific JL tab no longer has an active prompt "[*]:".
4745
... The cell index starts from 1 and you must count empty and markdown cells too.
4846
[Arguments] ${tab_id_to_wait} ${cell_n} ${timeout}=120seconds
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}
47+
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}
5048

5149
Get A JupyterLab Code Cell Output In a Given Tab
5250
[Documentation] It returns the output of a given cell in a specific JL tab.
5351
... The cell index starts from 1 and you must count empty and markdown cells too.
5452
[Arguments] ${tab_id_to_read} ${cell_n}
55-
${outputtext}= Get Text xpath=//div[@aria-labelledby="${tab_id_to_read}"]/${JLAB XP NOTEBOOK CONTENT}/div[${cell_n}]/${JLAB XP CELL OUTPUT TEXT}}
53+
${outputtext}= Get Text xpath=//div[@aria-labelledby="${tab_id_to_read}"]/${NB TAB XP CONTENT}/div[${cell_n}]/${CELL XP OUTPUT TEXT}
5654
[Return] ${outputtext}
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)