Skip to content

Commit affb602

Browse files
committed
start reworking plugin settings file cleaning, etc.
1 parent e7fa8e4 commit affb602

File tree

10 files changed

+33
-28
lines changed

10 files changed

+33
-28
lines changed

atest/01_Editor.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Editor Shows Features for Language
7777
... ELSE IF "${f}" == "Rename" Editor Should Rename ${features["${f}"]}
7878
END
7979
Capture Page Screenshot 99-done.png
80-
[Teardown] Clean Up After Working With File ${file}
80+
[Teardown] Clean Up After Working With Files ${file}
8181

8282
Editor Should Show Diagnostics
8383
[Arguments] ${diagnostic}

atest/03_Notebook.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Python
99
${diagnostic} = Set Variable W291 trailing whitespace (pycodestyle)
1010
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title="${diagnostic}"] timeout=35s
1111
Capture Page Screenshot 01-python.png
12-
[Teardown] Clean Up After Working With File Python.ipynb
12+
[Teardown] Clean Up After Working With Files Python.ipynb
1313

1414
Foreign Extractors
1515
${file} = Set Variable Foreign extractors.ipynb

atest/04_Interface/DiagnosticsPanel.robot

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
*** Settings ***
22
Suite Setup Setup Suite For Screenshots diagnostics_panel
33
Resource ../Keywords.robot
4-
Test Setup Set Up
5-
Test Teardown Clean Up
4+
Test Setup Set Up Diagnostic Panel Test
5+
Test Teardown Clean Up Diagnostic Panel Test
66

77
*** Variables ***
88
${EXPECTED_COUNT} 1
@@ -25,7 +25,7 @@ Diagnostics Panel Works After Rename
2525
Open Diagnostics Panel
2626
Capture Page Screenshot 01-panel-rename.png
2727
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_COUNT}
28-
Clean Up After Working With File PanelRenamed.ipynb
28+
Clean Up After Working With Files PanelRenamed.ipynb
2929

3030
Diagnostics Panel Can Be Restored
3131
Close Diagnostics Panel
@@ -103,11 +103,11 @@ Should Have Expected Rows Count
103103
${count} = Count Diagnostics In Panel
104104
Should Be True ${count} == ${expected_count}
105105

106-
Set Up
106+
Set Up Diagnostic Panel Test
107107
Gently Reset Workspace
108108
Open Notebook And Panel Panel.ipynb
109109

110-
Clean Up
111-
Clean Up After Working With File Panel.ipynb
112-
Reset Plugin Settings plugin=diagnostics
110+
Clean Up Diagnostic Panel Test
111+
Clean Up After Working With Files Panel.ipynb
112+
Reset Plugin Settings
113113
Reset Application State

atest/04_Interface/Statusbar.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Statusbar Popup Opens
1717
Capture Page Screenshot 01-statusbar.png
1818
Element Should Contain ${POPOVER} python
1919
Element Should Contain ${POPOVER} initialized
20-
[Teardown] Clean Up After Working With File Python.ipynb
20+
[Teardown] Clean Up After Working With Files Python.ipynb
2121

2222
Status Changes Correctly Between Editors
2323
Prepare File for Editing Python status example.py
@@ -29,7 +29,7 @@ Status Changes Correctly Between Editors
2929
Wait Until Fully Initialized
3030
Switch To Tab example.plain
3131
Wait Until Element Contains ${STATUSBAR} Initialized (additional servers needed) timeout=60s
32-
[Teardown] Clean Up After Working With File example.plain
32+
[Teardown] Clean Up After Working With Files example.plain
3333

3434
*** Keywords ***
3535
Switch To Tab

atest/05_Features/Completion.robot

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*** Settings ***
22
Suite Setup Setup Suite For Screenshots completion
33
Test Setup Setup Completion Test
4-
Test Teardown Clean Up After Working With File Completion.ipynb
4+
Test Teardown Clean Up Completion Test
55
Force Tags feature:completion
66
Resource ../Keywords.robot
77

@@ -45,7 +45,6 @@ Works In File Editor
4545
Capture Page Screenshot 01-editor-ready.png
4646
Trigger Completer
4747
Completer Should Suggest add
48-
[Teardown] Clean Up After Working With File completion.py
4948

5049
Autocompletes If Only One Option
5150
Enter Cell Editor 3 line=1
@@ -131,7 +130,6 @@ Material Theme Works
131130
# so we should get lsp:material-themed-class icon:
132131
Completer Should Suggest TabError
133132
Completer Should Include Icon lsp:material-themed-class
134-
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}
135133

136134
VSCode Unthemed Works
137135
Configure JupyterLab Plugin {"theme": "vscode", "colorScheme": "unthemed"} plugin id=${COMPLETION PLUGIN ID}
@@ -141,7 +139,6 @@ VSCode Unthemed Works
141139
Capture Page Screenshot 02-completions-shown.png
142140
Completer Should Suggest TabError
143141
Completer Should Include Icon lsp:vscode-unthemed-class
144-
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}
145142

146143
VSCode Muted Works
147144
${file} = Set Variable Completion.ipynb
@@ -159,7 +156,6 @@ VSCode Muted Works
159156
Completer Should Include Icon lsp:vscode-muted-class
160157
Lab Command Use JupyterLab Light Theme
161158
Wait For Splash
162-
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}
163159

164160
Works Without A Theme
165161
Configure JupyterLab Plugin {"theme": null} plugin id=${COMPLETION PLUGIN ID}
@@ -169,7 +165,6 @@ Works Without A Theme
169165
Capture Page Screenshot 02-completions-shown.png
170166
Completer Should Suggest TabError
171167
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
172-
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}
173168

174169
Works With Incorrect Theme
175170
Configure JupyterLab Plugin {"theme": "a-non-existing-theme"} plugin id=${COMPLETION PLUGIN ID}
@@ -179,12 +174,15 @@ Works With Incorrect Theme
179174
Capture Page Screenshot 02-completions-shown.png
180175
Completer Should Suggest TabError
181176
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
182-
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}
183177

184178
*** Keywords ***
185179
Setup Completion Test
186180
Setup Notebook Python Completion.ipynb
187181

182+
Clean Up Completion Test
183+
Reset Plugin Settings
184+
Clean Up After Working With Files Completion.ipynb completion.py
185+
188186
Get Cell Editor Content
189187
[Arguments] ${cell_nr}
190188
${content} Execute JavaScript return document.querySelector('.jp-Cell:nth-child(${cell_nr}) .CodeMirror').CodeMirror.getValue()

atest/05_Features/Signature.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Triggers Signature Help After A Keystroke
1515
Capture Page Screenshot 02-signature-shown.png
1616
Wait Until Keyword Succeeds 20x 0.5s Page Should Contain Element ${SIGNATURE_BOX}
1717
Element Should Contain ${SIGNATURE_BOX} Important docstring of abc()
18-
[Teardown] Clean Up After Working With File Signature.ipynb
18+
[Teardown] Clean Up After Working With Files Signature.ipynb

atest/05_Features/Syntax_highlighting.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*** Settings ***
22
Suite Setup Setup Suite For Screenshots syntax_highlighting
33
Test Setup Setup Highlighting Test
4-
Test Teardown Clean Up After Working With File Syntax highlighting.ipynb
4+
Test Teardown Clean Up After Working With Files Syntax highlighting.ipynb
55
Force Tags feature:syntax_highlighting
66
Resource ../Keywords.robot
77

atest/06_Style.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Screenshot Editor Themes with Lab Theme
3535
FOR ${editor theme} IN @{THEME NAMES}
3636
Capture Theme Screenshot ${editor theme}
3737
END
38-
[Teardown] Clean Up After Working With File ${file}
38+
[Teardown] Clean Up After Working With Files ${file}
3939

4040
Capture Theme Screenshot
4141
[Arguments] ${editor theme}

atest/Keywords.robot

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ Initialize User Settings
5959
Create File ${SETTINGS DIR}${/}@jupyterlab${/}codemirror-extension${/}commands.jupyterlab-settings {"styleActiveLine": true}
6060

6161
Reset Plugin Settings
62-
[Arguments] ${package}=jupyterlab-lsp ${plugin}=plugin
63-
${LSP PLUGIN SETTINGS FILE} = Set Variable @krassowski${/}${package}${/}${plugin}.jupyterlab-settings
64-
Create File ${SETTINGS DIR}${/}${LSP PLUGIN SETTINGS FILE} {}
62+
[Documentation] Restore some plugins' settings to `{}` (by default, all first-party plugins)
63+
[Arguments] @{plugins}=@{ALL LSP PLUGIN IDS}
64+
FOR ${plugin} IN @{plugins}
65+
${file} = Normalize Path ${plugin.replace(':', '/')}.jupyterlab-settings
66+
Create File ${SETTINGS DIR}${/}${file} {}
67+
END
6568

6669
Tear Down Everything
6770
Close All Browsers
@@ -219,9 +222,11 @@ Open ${file} in ${editor}
219222
Mouse Over ${editor}
220223
Click Element ${editor}
221224

222-
Clean Up After Working With File
223-
[Arguments] ${file}
224-
Remove File ${OUTPUT DIR}${/}home${/}${file}
225+
Clean Up After Working With Files
226+
[Arguments] @{files}
227+
FOR ${file} IN @{files}
228+
Remove File ${OUTPUT DIR}${/}home${/}${file}
229+
END
225230
Reset Application State
226231
Lab Log Should Not Contain Known Error Messages
227232

@@ -321,5 +326,5 @@ Configure JupyterLab Plugin
321326

322327
Clean Up After Working with File and Settings
323328
[Arguments] ${file}
324-
Clean Up After Working With File ${file}
329+
Clean Up After Working With Files ${file}
325330
Reset Plugin Settings

atest/Variables.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ ${CM CURSORS} css:.CodeMirror-cursors:not([style='visibility: hidden'])
3535
${LSP PLUGIN ID} @krassowski/jupyterlab-lsp:plugin
3636
${COMPLETION PLUGIN ID} @krassowski/jupyterlab-lsp:completion
3737
${DIAGNOSTICS PLUGIN ID} @krassowski/jupyterlab-lsp:diagnostics
38+
@{ALL LSP PLUGIN IDS} ${LSP PLUGIN ID} ${COMPLETION PLUGIN ID} ${DIAGNOSTICS PLUGIN ID}
39+
# more settings css
3840
${CSS USER SETTINGS} .jp-SettingsRawEditor-user
3941
${JLAB XP CLOSE SETTINGS} ${JLAB XP DOCK TAB}\[contains(., 'Settings')]/*[contains(@class, 'm-TabBar-tabCloseIcon')]
4042
# diagnostics

0 commit comments

Comments
 (0)