@@ -11,14 +11,17 @@ Library ./config.py
1111
1212*** Keywords ***
1313Setup Server and Browser
14+ [Arguments] ${server_extension_enabled } =${True }
1415 Initialize Global Variables
15- Create Notebok Server Config
16+ Create Notebok Server Config ${ server_extension_enabled }
1617 Initialize User Settings
18+ ${disable_global_config } = Set Variable If ${server_extension_enabled } != ${True } '1 ' ${EMPTY }
1719 ${server } = Start Process jupyter-lab
1820 ... cwd=${NOTEBOOK DIR }
1921 ... stdout=${LAB LOG }
2022 ... stderr=STDOUT
2123 ... env:HOME=${HOME }
24+ ... env:JUPYTER_NO_CONFIG=${disable_global_config }
2225 Set Global Variable ${SERVER } ${server }
2326 Open JupyterLab
2427 Read Page Config
@@ -34,6 +37,7 @@ Initialize Global Variables
3437 Set Screenshot Directory ${SCREENSHOTS DIR }
3538
3639Create Notebok Server Config
40+ [Arguments] ${server_extension_enabled } =${True }
3741 [Documentation] Copies in notebook server config file and updates accordingly
3842 ${conf } = Set Variable ${NOTEBOOK DIR }${/ }${NBSERVER CONF }
3943 ${extra_node_roots } = Create List ${ROOT }
@@ -47,9 +51,20 @@ Create Notebok Server Config
4751 ... token=${TOKEN }
4852 ... user_settings_dir=${SETTINGS DIR }
4953 ... workspaces_dir=${WORKSPACES DIR }
54+ # should be automatically enabled, so do not enable manually:
55+ Run Keyword Unless
56+ ... ${server_extension_enabled }
57+ ... Set Server Extension State ${conf } enabled=${server_extension_enabled }
5058 Update Jupyter Config ${conf } LanguageServerManager
5159 ... extra_node_roots=@{extra_node_roots }
5260
61+ Set Server Extension State
62+ [Arguments] ${conf } ${enabled } =${True }
63+ ${extension_state } = Create Dictionary enabled=${enabled }
64+ ${extensions } = Create Dictionary jupyter_lsp=${extension_state }
65+ Update Jupyter Config ${conf } LabApp
66+ ... jpserver_extensions=${extensions }
67+
5368Read Page Config
5469 ${script } = Get Element Attribute id:jupyter-config-data innerHTML
5570 ${config } = Evaluate __import__("json").loads(r"""${script } """)
@@ -249,14 +264,16 @@ Clean Up After Working With File
249264 Lab Log Should Not Contain Known Error Messages
250265
251266Setup Notebook
252- [Arguments] ${Language } ${file } ${isolated } =${True }
267+ [Arguments] ${Language } ${file } ${isolated } =${True } ${ wait } = ${ True }
253268 Set Tags language:${Language.lower() }
254269 Run Keyword If ${isolated } Set Screenshot Directory ${SCREENSHOTS DIR }${/ } notebook${/ }${TEST NAME.replace(' ', '_') }
255270 Copy File examples${/ }${file } ${NOTEBOOK DIR }${/ }${file }
256271 Run Keyword If ${isolated } Try to Close All Tabs
257272 Open ${file } in ${MENU NOTEBOOK }
258273 Capture Page Screenshot 00-notebook-opened.png
259- Wait Until Fully Initialized
274+ Run Keyword If
275+ ... ${wait }
276+ ... Wait Until Fully Initialized
260277 Capture Page Screenshot 01-notebook-initialized.png
261278
262279Open Diagnostics Panel
@@ -392,3 +409,7 @@ Measure Cursor Position
392409 Wait Until Page Contains Element ${CM CURSORS }
393410 ${position } = Wait Until Keyword Succeeds 20 x 0.05s Get Vertical Position ${CM CURSOR }
394411 [Return] ${position }
412+
413+ Switch To Tab
414+ [Arguments] ${file }
415+ Click Element ${JLAB XP DOCK TAB } \[contains(., '${file } ')]
0 commit comments