Skip to content

Commit 5ba0ad6

Browse files
committed
Add passing pyls configuration test
1 parent 564ba9c commit 5ba0ad6

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

atest/05_Features/Configuration.robot

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,50 @@ Force Tags feature:config
55
Resource ../Keywords.robot
66

77
*** Variables ***
8+
${CONFIG PYLS} {"language_servers": {"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}-Error[title="undefined name 'foo' (flake8)"]
12+
813
${CONFIG YAML SCHEMA} {"language_servers": {"yaml-language-server": {"config": {"yaml.schemas": {"http://json.schemastore.org/composer": "*"}}}}}
914
${YAML DIAGNOSTIC} ${CSS DIAGNOSTIC}-Error[title="duplicate key"]
1015
# TODO: fix this for the actual schema error to expect
1116
${SCHEMA DIAGNOSTIC} ${CSS DIAGNOSTIC}-Error[title="TODO: schema error here"]
1217

1318
*** Test Cases ***
14-
YAML Schema
15-
${file} = Set Variable composer-schema.yaml
16-
Prepare File for Editing YAML config ${file}
19+
Pyls Configuration
20+
${file} = Set Variable style.py
21+
Prepare File for Editing PYTHON config ${file}
1722
Open in Advanced Settings ${LSP PLUGIN ID}
1823
Drag and Drop By Offset ${JLAB XP DOCK TAB}\[contains(., '${file}')] 0 100
1924
Capture Page Screenshot 01-file-and-settings.png
20-
Wait Until Page Contains Element ${YAML DIAGNOSTIC} timeout=20s
21-
Page Should Not Contain ${SCHEMA DIAGNOSTIC}
22-
Set Editor Content ${CONFIG YAML SCHEMA} ${CSS USER SETTINGS}
25+
Wait Until Page Contains Element ${PYFLAKES DIAGNOSTIC} timeout=20s
26+
Page Should Not Contain ${FLAKE8 DIAGNOSTIC}
27+
Set Editor Content ${CONFIG PYLS} ${CSS USER SETTINGS}
2328
Click Element css:button[title\='Save User Settings']
2429
Capture Page Screenshot 02-settings-changed.png
25-
# TODO: ideally, the configuration should take effect immediately, but might have
26-
# to close the document and re-open it
27-
# Prepare File for Editing YAML config ${file}
28-
Wait Until Page Contains Element ${SCHEMA DIAGNOSTIC} timeout=20s
30+
Wait Until Page Contains Element ${FLAKE8 DIAGNOSTIC} timeout=20s
2931
Capture Page Screenshot 03-schema-diagnostic-found.png
3032
[Teardown] Clean Up After Working with File and Settings ${file}
3133

34+
# YAML Schema
35+
# ${file} = Set Variable composer-schema.yaml
36+
# Prepare File for Editing YAML config ${file}
37+
# Open in Advanced Settings ${LSP PLUGIN ID}
38+
# Drag and Drop By Offset ${JLAB XP DOCK TAB}\[contains(., '${file}')] 0 100
39+
# Capture Page Screenshot 01-file-and-settings.png
40+
# Wait Until Page Contains Element ${YAML DIAGNOSTIC} timeout=20s
41+
# Page Should Not Contain ${SCHEMA DIAGNOSTIC}
42+
# Set Editor Content ${CONFIG YAML SCHEMA} ${CSS USER SETTINGS}
43+
# Click Element css:button[title\='Save User Settings']
44+
# Capture Page Screenshot 02-settings-changed.png
45+
# # TODO: ideally, the configuration should take effect immediately, but might have
46+
# # to close the document and re-open it
47+
# # Prepare File for Editing YAML config ${file}
48+
# Wait Until Page Contains Element ${SCHEMA DIAGNOSTIC} timeout=20s
49+
# Capture Page Screenshot 03-schema-diagnostic-found.png
50+
# [Teardown] Clean Up After Working with File and Settings ${file}
51+
3252
*** Keywords ***
3353
Clean Up After Working with File and Settings
3454
[Arguments] ${file}

0 commit comments

Comments
 (0)