Skip to content

Commit 72980ee

Browse files
committed
test a notebook, basically
1 parent f401fda commit 72980ee

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*** Settings ***
2+
Suite Setup Wait for New Jupyter Server to be Ready
3+
Test Teardown Close All Browsers
4+
Library JupyterLibrary
5+
Library Process
6+
7+
*** Test Cases ***
8+
IPython Notebook
9+
Open JupyterLab
10+
Launch a new JupyterLab Document
11+
Add and Run Cell print("hello world")
12+
Wait Until Kernel Is Idle
13+
Capture Page Screenshot ipython.png
14+
15+
*** Keywords ***
16+
Clean Up Everything
17+
Close All Browsers
18+
Terminate All Processes

src/JupyterLibrary/resources/jupyterlab/Launcher.robot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Documentation Interact with the JupyterLab Launcher
33
Resource JupyterLibrary/resources/jupyterlab/Selectors.robot
44

55
*** Keywords ***
6-
Launch a new Document
7-
[Arguments] ${kernel}=Python3 ${category}=Notebook
6+
Launch a new JupyterLab Document
7+
[Arguments] ${kernel}=Python 3 ${category}=Notebook
88
[Documentation] Use the JupyterLab launcher to launch Notebook or Console
9-
Click Element ${JLAB XP CARD}[@title='${kernel}'][@data-category='${category}']
9+
Click Element xpath:${JLAB XP CARD}[@title='${kernel}'][@data-category='${category}']
1010
Wait Until Page Does Not Contain Element css:${JLAB CSS SPINNER}
1111
Wait Until Page Contains Element css:${JLAB CSS CELL}
1212
Sleep 0.1s
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*** Settings ***
2+
Resource JupyterLibrary/resources/jupyterlab/Selectors.robot
3+
4+
*** Keywords ***
5+
Add and Run Cell
6+
[Arguments] ${code}
7+
[Documentation] Add a code cell to the currently active notebook and run it
8+
Click Element css:${JLAB CSS NB TOOLBAR} ${JLAB CSS ICON ADD}
9+
Sleep 0.1s
10+
Click Element css:${JLAB CSS CELL}
11+
Execute JavaScript document.querySelector("${JLAB CSS CELL}").CodeMirror.setValue(`${code}`)
12+
Click Element css:${JLAB CSS ICON RUN}
13+
14+
Wait Until Kernel Is Idle
15+
[Documentation] Wait for the kernel to be busy, and then stop being busy
16+
Wait Until Page Does Not Contain Element ${JLAB CSS BUSY KERNEL}
17+
Wait Until Page Does Not Contain ${JLAB TEXT BUSY PROMPT}

src/JupyterLibrary/resources/jupyterlab/Selectors.robot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ ${JLAB CSS CMD ITEM} .p-CommandPalette-item
99
${JLAB CSS ACCEPT} .jp-mod-accept
1010
${JLAB CSS ACTIVE SIDEBAR} .jp-SideBar .p-TabBar-tab.p-mod-current
1111
${JLAB CSS SIDEBAR TAB} .jp-SideBar .p-TabBar-tab
12+
${JLAB CSS BUSY KERNEL} .jp-Toolbar-kernelStatus.jp-FilledCircleIcon
13+
14+
${JLAB CSS NB TOOLBAR} .jp-NotebookPanel-toolbar
15+
16+
${JLAB CSS ICON RUN} .jp-RunIcon
17+
${JLAB CSS ICON ADD} .jp-AddIcon
1218

1319
${JLAB XP TOP} //div[@id='jp-top-panel']
1420
${JLAB XP MENU LABEL} //div[@class='p-MenuBar-itemLabel']
1521
${JLAB XP MENU ITEM LABEL} //div[@class='p-Menu-itemLabel']
1622
${JLAB XP CARD} //div[@class='jp-LauncherCard']
1723
${JLAB XP DOCK} //div[@id='jp-main-dock-panel']
24+
25+
${JLAB TEXT BUSY PROMPT} In [*]:

0 commit comments

Comments
 (0)