-
Notifications
You must be signed in to change notification settings - Fork 14
/
Lab.robot
48 lines (37 loc) · 1.48 KB
/
Lab.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
*** Settings **
Library Process
Library SeleniumLibrary
*** Variables ***
${CELL_CSS} .jp-Notebook .jp-Cell:last-of-type .jp-InputArea-editor .CodeMirror
${TOKEN} hopelesslyinsecure
${LAB_CMD} jupyter-lab --no-browser --NotebookApp.token=${TOKEN} --port 18888
${LAB_URL} http://localhost:18888/lab?token=${TOKEN}
${SPLASH_ID} jupyterlab-splash
${CMD_PAL_XPATH} //div[contains(@class, "jp-mod-left")]//li//div[contains(text(), "Commands")]
${CMD_PAL_INPUT} css:.p-CommandPalette-input
${CMD_PAL_ITEM} css:.p-CommandPalette-item
*** Keywords ***
Wait for Splash Screen
Wait Until Page Contains Element ${SPLASH_ID}
Wait Until Page Does Not Contain Element ${SPLASH_ID}
Launch a new
[Arguments] ${kernel} ${category}
Click Element //div[@class='jp-LauncherCard' and @title='${kernel}' and @data-category='${category}']
Wait Until Page Contains Element css:${CELL_CSS}
Start JupyterLab
Start Process ${LAB_CMD} shell=true
Open JupyterLab with
[Arguments] ${browser}
Open Browser ${LAB_URL} ${browser}
Execute JupyterLab Command
[Arguments] ${command}
Click Element ${CMD_PAL_XPATH}
Input Text ${CMD_PAL_INPUT} ${command}
Wait Until Page Contains Element ${CMD_PAL_ITEM}
Click Element ${CMD_PAL_ITEM}
Reset Application State and Close
Execute JupyterLab Command Reset Application State
Close Browser
Kill'em all
Close All Browsers
Terminate All Processes kill=True