Skip to content

Commit 1906178

Browse files
committed
Add tests for #393
1 parent ececa35 commit 1906178

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

atest/03_Notebook.robot

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,39 @@ Python
1111
Capture Page Screenshot 01-python.png
1212
[Teardown] Clean Up After Working With File Python.ipynb
1313

14+
Conversion Of Cell Types
15+
[Setup] Setup Notebook Python Python.ipynb
16+
${lsp_entry} = Set Variable Show diagnostics panel
17+
# initial (code) cell
18+
Open Context Menu Over Cell Editor 1
19+
Capture Page Screenshot 01-initial-code-cell.png
20+
Context Menu Should Contain ${lsp_entry}
21+
Close Context Menu
22+
# raw cell
23+
Lab Command Change to Raw Cell Type
24+
Open Context Menu Over Cell Editor 1
25+
Capture Page Screenshot 02-as-raw-cell.png
26+
Context Menu Should Not Contain ${lsp_entry}
27+
Close Context Menu
28+
# code cell again
29+
Lab Command Change to Code Cell Type
30+
Open Context Menu Over Cell Editor 1
31+
Capture Page Screenshot 03-as-code-cell-again.png
32+
Context Menu Should Contain ${lsp_entry}
33+
Close Context Menu
34+
[Teardown] Clean Up After Working With File Python.ipynb
35+
36+
Moving Cells Around
37+
[Setup] Setup Notebook Python Python.ipynb
38+
${diagnostic} = Set Variable undefined name 'test' (pyflakes)
39+
Enter Cell Editor 1
40+
Lab Command Move Cells Down
41+
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title="${diagnostic}"] timeout=35s
42+
Enter Cell Editor 1
43+
Lab Command Move Cells Down
44+
Wait Until Page Does Not Contain Element css:.cm-lsp-diagnostic[title="${diagnostic}"] timeout=35s
45+
[Teardown] Clean Up After Working With File Python.ipynb
46+
1447
Foreign Extractors
1548
${file} = Set Variable Foreign extractors.ipynb
1649
Configure JupyterLab Plugin

atest/Keywords.robot

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ Enter Cell Editor
279279
Click Element css:.jp-Cell:nth-child(${cell_nr}) .CodeMirror-line:nth-child(${line})
280280
Wait Until Page Contains Element css:.jp-Cell:nth-child(${cell_nr}) .CodeMirror-focused
281281

282+
Open Context Menu Over Cell Editor
283+
[Arguments] ${cell_nr} ${line}=1
284+
Enter Cell Editor ${cell_nr} line=${line}
285+
Open Context Menu Over css:.jp-Cell:nth-child(${cell_nr}) .CodeMirror-line:nth-child(${line})
286+
282287
Place Cursor In Cell Editor At
283288
[Arguments] ${cell_nr} ${line} ${character}
284289
Enter Cell Editor ${cell_nr} ${line}
@@ -301,6 +306,19 @@ Open Context Menu Over
301306
Wait Until Keyword Succeeds 10 x 0.1 s Mouse Over ${sel}
302307
Wait Until Keyword Succeeds 10 x 0.1 s Open Context Menu ${sel}
303308

309+
Context Menu Should Contain
310+
[Arguments] ${label} ${timeout}=10s
311+
${entry} Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), '${label}')]
312+
Wait Until Page Contains Element ${entry} timeout=${timeout}
313+
314+
Context Menu Should Not Contain
315+
[Arguments] ${label} ${timeout}=10s
316+
${entry} Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), '${label}')]
317+
Wait Until Page Does Not Contain Element ${entry} timeout=${timeout}
318+
319+
Close Context Menu
320+
Press Keys None ESCAPE
321+
304322
Prepare File for Editing
305323
[Arguments] ${Language} ${Screenshots} ${file}
306324
Set Tags language:${Language.lower()}

0 commit comments

Comments
 (0)