Skip to content

Commit

Permalink
start reworking plugin settings file cleaning, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Sep 8, 2020
1 parent e7fa8e4 commit affb602
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion atest/01_Editor.robot
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Editor Shows Features for Language
... ELSE IF "${f}" == "Rename" Editor Should Rename ${features["${f}"]}
END
Capture Page Screenshot 99-done.png
[Teardown] Clean Up After Working With File ${file}
[Teardown] Clean Up After Working With Files ${file}

Editor Should Show Diagnostics
[Arguments] ${diagnostic}
Expand Down
2 changes: 1 addition & 1 deletion atest/03_Notebook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Python
${diagnostic} = Set Variable W291 trailing whitespace (pycodestyle)
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title="${diagnostic}"] timeout=35s
Capture Page Screenshot 01-python.png
[Teardown] Clean Up After Working With File Python.ipynb
[Teardown] Clean Up After Working With Files Python.ipynb

Foreign Extractors
${file} = Set Variable Foreign extractors.ipynb
Expand Down
14 changes: 7 additions & 7 deletions atest/04_Interface/DiagnosticsPanel.robot
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots diagnostics_panel
Resource ../Keywords.robot
Test Setup Set Up
Test Teardown Clean Up
Test Setup Set Up Diagnostic Panel Test
Test Teardown Clean Up Diagnostic Panel Test

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

Diagnostics Panel Can Be Restored
Close Diagnostics Panel
Expand Down Expand Up @@ -103,11 +103,11 @@ Should Have Expected Rows Count
${count} = Count Diagnostics In Panel
Should Be True ${count} == ${expected_count}

Set Up
Set Up Diagnostic Panel Test
Gently Reset Workspace
Open Notebook And Panel Panel.ipynb

Clean Up
Clean Up After Working With File Panel.ipynb
Reset Plugin Settings plugin=diagnostics
Clean Up Diagnostic Panel Test
Clean Up After Working With Files Panel.ipynb
Reset Plugin Settings
Reset Application State
4 changes: 2 additions & 2 deletions atest/04_Interface/Statusbar.robot
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Statusbar Popup Opens
Capture Page Screenshot 01-statusbar.png
Element Should Contain ${POPOVER} python
Element Should Contain ${POPOVER} initialized
[Teardown] Clean Up After Working With File Python.ipynb
[Teardown] Clean Up After Working With Files Python.ipynb

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

*** Keywords ***
Switch To Tab
Expand Down
12 changes: 5 additions & 7 deletions atest/05_Features/Completion.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots completion
Test Setup Setup Completion Test
Test Teardown Clean Up After Working With File Completion.ipynb
Test Teardown Clean Up Completion Test
Force Tags feature:completion
Resource ../Keywords.robot

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

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

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

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

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

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

*** Keywords ***
Setup Completion Test
Setup Notebook Python Completion.ipynb

Clean Up Completion Test
Reset Plugin Settings
Clean Up After Working With Files Completion.ipynb completion.py

Get Cell Editor Content
[Arguments] ${cell_nr}
${content} Execute JavaScript return document.querySelector('.jp-Cell:nth-child(${cell_nr}) .CodeMirror').CodeMirror.getValue()
Expand Down
2 changes: 1 addition & 1 deletion atest/05_Features/Signature.robot
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Triggers Signature Help After A Keystroke
Capture Page Screenshot 02-signature-shown.png
Wait Until Keyword Succeeds 20x 0.5s Page Should Contain Element ${SIGNATURE_BOX}
Element Should Contain ${SIGNATURE_BOX} Important docstring of abc()
[Teardown] Clean Up After Working With File Signature.ipynb
[Teardown] Clean Up After Working With Files Signature.ipynb
2 changes: 1 addition & 1 deletion atest/05_Features/Syntax_highlighting.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots syntax_highlighting
Test Setup Setup Highlighting Test
Test Teardown Clean Up After Working With File Syntax highlighting.ipynb
Test Teardown Clean Up After Working With Files Syntax highlighting.ipynb
Force Tags feature:syntax_highlighting
Resource ../Keywords.robot

Expand Down
2 changes: 1 addition & 1 deletion atest/06_Style.robot
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Screenshot Editor Themes with Lab Theme
FOR ${editor theme} IN @{THEME NAMES}
Capture Theme Screenshot ${editor theme}
END
[Teardown] Clean Up After Working With File ${file}
[Teardown] Clean Up After Working With Files ${file}

Capture Theme Screenshot
[Arguments] ${editor theme}
Expand Down
19 changes: 12 additions & 7 deletions atest/Keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ Initialize User Settings
Create File ${SETTINGS DIR}${/}@jupyterlab${/}codemirror-extension${/}commands.jupyterlab-settings {"styleActiveLine": true}

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

Tear Down Everything
Close All Browsers
Expand Down Expand Up @@ -219,9 +222,11 @@ Open ${file} in ${editor}
Mouse Over ${editor}
Click Element ${editor}

Clean Up After Working With File
[Arguments] ${file}
Remove File ${OUTPUT DIR}${/}home${/}${file}
Clean Up After Working With Files
[Arguments] @{files}
FOR ${file} IN @{files}
Remove File ${OUTPUT DIR}${/}home${/}${file}
END
Reset Application State
Lab Log Should Not Contain Known Error Messages

Expand Down Expand Up @@ -321,5 +326,5 @@ Configure JupyterLab Plugin

Clean Up After Working with File and Settings
[Arguments] ${file}
Clean Up After Working With File ${file}
Clean Up After Working With Files ${file}
Reset Plugin Settings
2 changes: 2 additions & 0 deletions atest/Variables.robot
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ ${CM CURSORS} css:.CodeMirror-cursors:not([style='visibility: hidden'])
${LSP PLUGIN ID} @krassowski/jupyterlab-lsp:plugin
${COMPLETION PLUGIN ID} @krassowski/jupyterlab-lsp:completion
${DIAGNOSTICS PLUGIN ID} @krassowski/jupyterlab-lsp:diagnostics
@{ALL LSP PLUGIN IDS} ${LSP PLUGIN ID} ${COMPLETION PLUGIN ID} ${DIAGNOSTICS PLUGIN ID}
# more settings css
${CSS USER SETTINGS} .jp-SettingsRawEditor-user
${JLAB XP CLOSE SETTINGS} ${JLAB XP DOCK TAB}\[contains(., 'Settings')]/*[contains(@class, 'm-TabBar-tabCloseIcon')]
# diagnostics
Expand Down

0 comments on commit affb602

Please sign in to comment.