@@ -4,64 +4,52 @@ Suite Setup Setup Suite For Screenshots config
4
4
Force Tags feature:config
5
5
Resource ./Keywords.robot
6
6
7
- *** Variables ***
8
- ${CONFIG PYLS } {"language_servers": {"pyls": {"serverSettings": {"pyls": {"plugins": {"flake8": {"enabled": true},"pyflakes": {"enabled": false}}}}}}}
9
- # pyflakes is enabled by default, but flake8 is not
10
- ${PYFLAKES DIAGNOSTIC } ${CSS DIAGNOSTIC } -Error[title="undefined name 'foo' (pyflakes)"]
11
- ${FLAKE8 DIAGNOSTIC } ${CSS DIAGNOSTIC } -Warning[title="undefined name 'foo' (flake8)"]
12
- # Sets expectation that all YAML files (wildcard *) adhere to Composer spec
13
- ${CONFIG YAML SCHEMA } {"language_servers": {"yaml-language-server": {"serverSettings": {"yaml.schemas": {"http://json.schemastore.org/composer": "*"}}}}}
14
- # Composer YAML files don't allow a "greetings" key
15
- ${SCHEMA DIAGNOSTIC } ${CSS DIAGNOSTIC } -Error[title="Property greetings is not allowed."]
16
-
17
7
*** Test Cases ***
18
8
Pyls Configuration
19
- ${file } = Set Variable style.py
20
- ${tab } = Set Variable ${JLAB XP DOCK TAB } \[contains(., '${file } ')]
21
- Prepare File for Editing PYTHON config ${file }
22
- Open in Advanced Settings ${LSP PLUGIN ID }
23
- Drag and Drop By Offset ${tab } 0 100
24
- Wait Until Fully Initialized
25
- Open Diagnostics Panel
26
- Drag and Drop By Offset ${JLAB XP DOCK TAB } \[contains(., 'Diagnostics Panel')] 600 -200
27
- Ensure Sidebar Is Closed
28
- Capture Page Screenshot 01-diagnostics-and-settings.png
29
- # Diagnostic panel should show pyflakes diagnostics, but no flake8
30
- Wait Until Page Contains Element ${PYFLAKES DIAGNOSTIC } timeout=30s
31
- Page Should Not Contain ${FLAKE8 DIAGNOSTIC }
32
- Set Editor Content ${CONFIG PYLS } ${CSS USER SETTINGS }
33
- Click Element css:button[title\='Save User Settings']
34
- Drag and Drop By Offset ${tab } 0 100
35
- Lab Command Save Python File
36
- Capture Page Screenshot 02-settings-changed.png
37
- # After updating settings, we should see flake8 but no pyflakes
38
- Wait Until Page Contains Element ${FLAKE8 DIAGNOSTIC } timeout=30s
39
- Page Should Not Contain ${PYFLAKES DIAGNOSTIC }
40
- Capture Page Screenshot 03-flake8-diagnostic-found.png
41
- [Teardown] Clean Up After Working with File and Settings ${file }
9
+ [Documentation] pyflakes is enabled by default, but flake8 is not
10
+ Settings Should Change Editor Diagnostics Python style.py pyls
11
+ ... {"pyls": {"plugins": {"flake8": {"enabled": true},"pyflakes": {"enabled": false}}}}
12
+ ... undefined name 'foo' (pyflakes)
13
+ ... undefined name 'foo' (flake8)
42
14
43
15
YAML Schema
44
- ${file } = Set Variable example.yaml
16
+ [Documentation] EXPECT FAIL Composer YAML files don't allow a "greetings" key
17
+ Settings Should Change Editor Diagnostics YAML example.yaml yaml-language-server
18
+ ... {"yaml.schemas": {"http://json.schemastore.org/composer": "*"}}
19
+ ... duplicate key
20
+ ... Property greetings is not allowed.
21
+
22
+ *** Keywords ***
23
+ Clean Up After Working with File and Settings
24
+ [Arguments] ${file }
25
+ Clean Up After Working With File ${file }
26
+ Reset Plugin Settings
27
+
28
+ Settings Should Change Editor Diagnostics
29
+ [Arguments] ${language } ${file } ${server } ${settings } ${before } ${after }
30
+ ${before diagnostic } = Set Variable ${CSS DIAGNOSTIC } \[title="${before } "]
31
+ ${after diagnostic } = Set Variable ${CSS DIAGNOSTIC } \[title="${after } "]
45
32
${tab } = Set Variable ${JLAB XP DOCK TAB } \[contains(., '${file } ')]
46
- Prepare File for Editing YAML config ${file }
33
+ ${close icon } = Set Variable *[contains(@class, 'm-TabBar-tabCloseIcon')]
34
+ Prepare File for Editing ${language } config ${file }
47
35
Open in Advanced Settings ${LSP PLUGIN ID }
48
36
Drag and Drop By Offset ${tab } 0 100
49
37
Wait Until Fully Initialized
50
38
Open Diagnostics Panel
51
39
Drag and Drop By Offset ${JLAB XP DOCK TAB } \[contains(., 'Diagnostics Panel')] 600 -200
52
- Capture Page Screenshot 01-diagnostics-and-settings.png
53
- # Diagnostic panel shouldn't show "Property ... is not allowed"
54
- Page Should Not Contain ${SCHEMA DIAGNOSTIC }
55
- Set Editor Content ${CONFIG YAML SCHEMA } ${CSS USER SETTINGS }
40
+ Click Element ${JLAB XP DOCK TAB } \[contains(., 'Launcher')]/${close icon }
41
+ Wait Until Page Contains Element ${before diagnostic } timeout=30s
42
+ Page Should Not Contain ${after diagnostic }
43
+ Capture Page Screenshot 01-default-diagnostics-and-settings.png
44
+ Set Editor Content {"language_servers": {"${server } ": {"serverSettings": ${settings } }}} ${CSS USER SETTINGS }
45
+ Wait Until Page Contains No errors found
46
+ Capture Page Screenshot 01-default-diagnostics-and-settings.png
56
47
Click Element css:button[title\='Save User Settings']
48
+ Click Element ${JLAB XP DOCK TAB } \[contains(., 'Settings')]/${close icon }
49
+ Drag and Drop By Offset ${tab } 0 100
50
+ Lab Command Save ${language } File
51
+ Ensure Sidebar Is Closed
57
52
Capture Page Screenshot 02-settings-changed.png
58
- # Now show the Composer YAML error
59
- Wait Until Page Contains Element ${SCHEMA DIAGNOSTIC } timeout=30s
60
- Capture Page Screenshot 03-schema-diagnostic-found.png
53
+ Wait Until Page Contains Element ${after diagnostic } timeout=30s
54
+ Capture Page Screenshot 03-configured-diagnostic-found.png
61
55
[Teardown] Clean Up After Working with File and Settings ${file }
62
-
63
- *** Keywords ***
64
- Clean Up After Working with File and Settings
65
- [Arguments] ${file }
66
- Clean Up After Working With File ${file }
67
- Reset Plugin Settings
0 commit comments