Skip to content

Commit db469df

Browse files
committed
Add more completion tests
1 parent 5c17f27 commit db469df

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

atest/05_Features/Completion.robot

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Works With Kernel Running
2727
Should Contain ${content} TabError
2828
[Teardown] Clean Up After Working With File Completion.ipynb
2929

30-
Works With Kernel Shut Down
30+
Works When Kernel Is Shut Down
3131
Setup Notebook Python Completion.ipynb
3232
Lab Command Shut Down All Kernels…
3333
Capture Page Screenshot 01-shutting-kernels.png
@@ -42,6 +42,14 @@ Works With Kernel Shut Down
4242
Completer Should Not Suggest %%timeit
4343
[Teardown] Clean Up After Working With File Completion.ipynb
4444

45+
Autocompletes If Only One Option
46+
Setup Notebook Python Completion.ipynb
47+
Enter Cell Editor 3 line=1
48+
Press Keys None cle
49+
Press Keys None TAB
50+
Wait Until Keyword Succeeds 20x 0.5s Cell Editor Should Equal 3 list.clear
51+
[Teardown] Clean Up After Working With File Completion.ipynb
52+
4553
*** Keywords ***
4654
Enter Cell Editor
4755
[Arguments] ${cell_nr} ${line}=1
@@ -53,6 +61,11 @@ Get Cell Editor Content
5361
${content} Execute JavaScript return document.querySelector('.jp-CodeCell:nth-child(${cell_nr}) .CodeMirror').CodeMirror.getValue()
5462
[Return] ${content}
5563

64+
Cell Editor Should Equal
65+
[Arguments] ${cell} ${value}
66+
${content} = Get Cell Editor Content ${cell}
67+
Should Be Equal ${content} ${value}
68+
5669
Completer Should Suggest
5770
[Arguments] ${text}
5871
Page Should Contain Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"]
@@ -63,4 +76,4 @@ Completer Should Not Suggest
6376

6477
Trigger Completer
6578
Press Keys None TAB
66-
Wait Until Page Contains Element ${COMPLETER_BOX}
79+
Wait Until Page Contains Element ${COMPLETER_BOX} timeout=6s

atest/examples/Completion.ipynb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@
99
"test = 1 \n",
1010
"t"
1111
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": null,
16+
"metadata": {},
17+
"outputs": [],
18+
"source": [
19+
"list"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": null,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"list."
29+
]
1230
}
1331
],
1432
"metadata": {

0 commit comments

Comments
 (0)