*** Settings ***
Library SeleniumLibrary
Library SeleniumScreenshots
*** Variables ***
${token} 4d4cce697b6828501eda1d14002fa0a081e0a938ad9328c4
*** Keywords ***
Open url
[Arguments] ${url}
${status} = Run keyword and return status Switch browser singleton
Run keyword if ${status} == False
... Open browser ${url} alias=singleton ELSE Go to ${url}
*** Keywords ***
Run Selenium keyword and return status
[Arguments] ${keyword} @{arguments}
${tmp}= Register keyword to run on failure No operation
${status}= Run keyword and return status ${keyword} @{arguments}
Register keyword to run on failure ${tmp}
[Return] ${status}
Enter command
[Arguments] ${cmd}=Close All Tabs
Click element css:LI.p-TabBar-tab:nth-child(1)
Click element css:LI.p-TabBar-tab:nth-child(3)
Input text css:INPUT.p-CommandPalette-input
... ${cmd}
Press keys css:INPUT.p-CommandPalette-input
... \n
Click element css:LI.p-TabBar-tab:nth-child(1)
*** Tasks ***
Open JupyterLab
Open url http://localhost:8888/lab
Set window size 1200 900
${requires token}= Run selenium keyword and return status
... Page should contain element id:password_input
Run keyword if ${requires token}
... Input text id:password_input ${token}
Run keyword if ${requires token}
... Click button id:login_submit
Sleep 10s
Enter command Close All Tabs
The JupyterLab starts with its Launcher tab open on its tabbed editor [1].
Launcher lists shortcut icons for creating a new notebook with any of the currently available kernels [2].
Alternatively, an existing notebook could be opened from the File browser available on the left sidebar [3].
*** Tasks ***
Annotate main page
Set window size 1200 900
${n1}= Add note
... id:jp-top-panel
... text=1
... position=bottom
${n2}= Add note
... id:filebrowser
... text=3
${n3}= Add note
... css:DIV.jp-Launcher-section:nth-child(2) > DIV.jp-Launcher-cardContainer
... text=2
Capture page screenshot
Remove elements ${n1} ${n2} ${n3}
*** Tasks ***
Create new Robot notebook
Double click element
... css:[title="A quick start for Robot Framework with Jupyter"]
Wait until page contains
... Robot notebook structure
Sleep 2s
Launching a new notebook or loading an existing one opens the notebook on a new tab on its tabbed editor [1].
Each notebook tab has its own toolbar with the most important actions [2].
A simple notebook is displayed with its Markdown cells [3], code cells [4] and their results [5].
On the left side of each cell is its execution number, or empty brackets, when the cell has not been successfully executed yet.
The sidebar could be closed by clicking the currenly active tab [6].
Most of the JupyterLab features are available for browsing and executing by Commands tab [7].
*** Tasks ***
Annotate Robot notebook
Set window size 1200 900
${n0}= Add note
... css:DIV[id='jp-main-dock-panel'] > DIV > UL
... text=1
${n1}= Add note
... css:DIV.p-Widget.p-TabBar.jp-SideBar.jp-mod-left.p-BoxPanel-child > UL.p-TabBar-content > LI.p-TabBar-tab.p-mod-current
... text=6
${n2}= Add note
... css:DIV.p-Widget.p-TabBar.jp-SideBar.jp-mod-left.p-BoxPanel-child > UL.p-TabBar-content > LI.p-TabBar-tab:nth-child(3)
... text=7
${n3}= Add note
... css:DIV.p-Widget.jp-Toolbar.jp-NotebookPanel-toolbar > DIV.p-Widget.jp-ToolbarButton.jp-Toolbar-item:nth-child(1) > BUTTON.bp3-button.bp3-minimal.jp-ToolbarButtonComponent.minimal.jp-Button
... text=2
${n4}= Add note
... id:Robot-notebook-structure
... text=3
${n5}= Add note
... jquery:PRE.CodeMirror-line:contains('Test Cases')
... text=4
${n6}= Add note
... link:Report
... text=5
... position=right
Capture page screenshot
Remove elements
... ${n0} ${n1} ${n2} ${n3} ${n4} ${n5} ${n6}
For example, robotkernel uses the Contextual Help for displaying context aware documentation – particularly documentation of the currently used keyword.
Contextual Help can be opened with Ctrl + I
, from Commands-palette or from the context menu available on mouse click on a notebook. Contextual Help is opened as a separate tab, which can be dragged onto right or bottom side of the window – whichever suits best.
*** Tasks ***
Open inspector and drag it to the right
Enter command Show Contextual Help
Set window size 1200 900
Drag and drop by offset
... css:LI.p-TabBar-tab.jp-mod-current.p-mod-closable.p-mod-current > DIV.p-TabBar-tabLabel
... 0 600
${n1}= Add note
... id:jp-inspector
... text=1
Capture page screenshot
Remove elements ${n1}
*** Settings ***
Suite teardown Close all browsers