Skip to content

Commit 2701904

Browse files
committed
Add completer themes acceptance tests
1 parent ed417f5 commit 2701904

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

atest/05_Features/Completion.robot

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,60 @@ Triggers Completer On Dot
113113
Wait Until Page Contains Element ${COMPLETER_BOX} timeout=35s
114114
Completer Should Suggest append
115115

116+
Material Theme Works
117+
Configure JupyterLab Plugin {"theme": "material"} plugin id=${COMPLETION PLUGIN ID}
118+
Capture Page Screenshot 01-configured.png
119+
Enter Cell Editor 1 line=2
120+
Trigger Completer
121+
Capture Page Screenshot 02-completions-shown.png
122+
# TabError is a builtin exception which is a class in Python,
123+
# so we should get lsp:material-class-light icon:
124+
Completer Should Suggest TabError
125+
Completer Should Include Icon lsp:material-class-light
126+
127+
VSCode Theme Works
128+
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
129+
Capture Page Screenshot 01-configured.png
130+
Enter Cell Editor 1 line=2
131+
Trigger Completer
132+
Capture Page Screenshot 02-completions-shown.png
133+
Completer Should Suggest TabError
134+
Completer Should Include Icon lsp:vscode-class-light
135+
136+
VSCode Dark Theme Works
137+
${file} = Set Variable Completion.ipynb
138+
Lab Command Use JupyterLab Dark Theme
139+
Wait For Splash
140+
Capture Page Screenshot 00-theme-changed.png
141+
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
142+
Capture Page Screenshot 01-configured.png
143+
Open ${file} in ${MENU NOTEBOOK}
144+
Enter Cell Editor 1 line=2
145+
Trigger Completer
146+
Capture Page Screenshot 02-completions-shown.png
147+
Completer Should Suggest TabError
148+
Completer Should Include Icon lsp:vscode-class-dark
149+
Lab Command Use JupyterLab Light Theme
150+
Wait For Splash
151+
152+
Works Without A Theme
153+
Configure JupyterLab Plugin {"theme": null} plugin id=${COMPLETION PLUGIN ID}
154+
Capture Page Screenshot 01-configured.png
155+
Enter Cell Editor 1 line=2
156+
Trigger Completer
157+
Capture Page Screenshot 02-completions-shown.png
158+
Completer Should Suggest TabError
159+
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
160+
161+
Works With Incorrect Theme
162+
Configure JupyterLab Plugin {"theme": "a-non-existing-theme"} plugin id=${COMPLETION PLUGIN ID}
163+
Capture Page Screenshot 01-configured.png
164+
Enter Cell Editor 1 line=2
165+
Trigger Completer
166+
Capture Page Screenshot 02-completions-shown.png
167+
Completer Should Suggest TabError
168+
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
169+
116170
*** Keywords ***
117171
Setup Completion Test
118172
Setup Notebook Python Completion.ipynb
@@ -139,6 +193,10 @@ Completer Should Suggest
139193
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"]
140194
Capture Page Screenshot ${text.replace(' ', '_')}.png
141195

196+
Completer Should Include Icon
197+
[Arguments] ${icon}
198+
Wait Until Page Contains Element ${COMPLETER_BOX} svg[data-icon="${icon}"]
199+
142200
Completer Should Not Suggest
143201
[Arguments] ${text}
144202
Wait Until Page Does Not Contain Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"]

atest/Variables.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ${CM CURSOR} css:.CodeMirror-cursor
3333
${CM CURSORS} css:.CodeMirror-cursors:not([style='visibility: hidden'])
3434
# settings
3535
${LSP PLUGIN ID} @krassowski/jupyterlab-lsp:plugin
36+
${COMPLETION PLUGIN ID} @krassowski/jupyterlab-lsp:completion
3637
${LSP PLUGIN SETTINGS FILE} @krassowski${/}jupyterlab-lsp${/}plugin.jupyterlab-settings
3738
${CSS USER SETTINGS} .jp-SettingsRawEditor-user
3839
${JLAB XP CLOSE SETTINGS} ${JLAB XP DOCK TAB}\[contains(., 'Settings')]/*[contains(@class, 'm-TabBar-tabCloseIcon')]

0 commit comments

Comments
 (0)