@@ -5,13 +5,9 @@ Resource Keywords.robot
55
66*** Variables ***
77${MENU EDITOR } xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(., "Editor")]
8- ${MENU OPEN WITH } xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(text(), "Open With")]
98${MENU JUMP } xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(text(), "Jump to definition")]
10- ${MENU RENAME } xpath://div[contains(@class, 'p-Menu-itemLabel')][contains(text(), "Rename")]
119${CM CURSOR } css:.CodeMirror-cursor
1210${CM CURSORS } css:.CodeMirror-cursors:not([style='visibility: hidden'])
13- ${DIALOG WINDOW } css:.jp-Dialog
14- ${DIALOG INPUT } css:.jp-Input-Dialog input
1511
1612*** Test Cases ***
1713Bash
@@ -72,7 +68,7 @@ Editor Shows Features for Language
7268 Set Screenshot Directory ${OUTPUT DIR }${/ } screenshots${/ } editor${/ }${Language.lower() }
7369 Copy File examples${/ }${file } ${OUTPUT DIR }${/ } home${/ }${file }
7470 Lab Command Close All Tabs
75- Open ${file } in Editor
71+ Open ${file } in ${ MENU EDITOR }
7672 Capture Page Screenshot 00-opened.png
7773 FOR ${f } IN @{features }
7874 Run Keyword If "${f } " == "Diagnostics" Editor Should Show Diagnostics ${features["${f }"] }
@@ -82,30 +78,16 @@ Editor Shows Features for Language
8278 Capture Page Screenshot 99-done.png
8379 [Teardown] Clean Up After Working With File ${file }
8480
85- Clean Up After Working With File
86- [Arguments] ${file }
87- Remove File ${OUTPUT DIR }${/ } home${/ }${file }
88- Reset Application State
89-
90- Open ${file} in Editor
91- Ensure File Browser is Open
92- Click Element css:button[title="Refresh File List"]
93- Open Context Menu css:.jp-DirListing-item[title="${file } "]
94- Mouse Over ${MENU OPEN WITH }
95- Wait Until Page Contains Element ${MENU EDITOR }
96- Mouse Over ${MENU EDITOR }
97- Click Element ${MENU EDITOR }
98-
99- Ensure File Browser is Open
100- ${sel } = Set Variable css:.p-TabBar-tab[data-id="filebrowser"]:not(.p-mod-current)
101- ${els } = Get WebElements ${sel }
102- Run Keyword If ${els.__len__() } Click Element ${sel }
103-
10481Editor Should Show Diagnostics
10582 [Arguments] ${diagnostic }
10683 Set Tags feature:diagnostics
10784 Wait Until Page Contains Element css:.cm-lsp-diagnostic[title*="${diagnostic } "] timeout=20s
10885 Capture Page Screenshot 01-diagnostics.png
86+ Open Diagnostics Panel
87+ Capture Page Screenshot 02-diagnostics.png
88+ ${count } = Count Diagnostics In Panel
89+ Should Be True ${count } >= 1
90+ Close Diagnostics Panel
10991
11092Editor Should Jump To Definition
11193 [Arguments] ${symbol }
@@ -130,20 +112,19 @@ Measure Cursor Position
130112 ${position } = Wait Until Keyword Succeeds 20 x 0.05s Get Vertical Position ${CM CURSOR }
131113 [Return] ${position }
132114
133- Wait For Dialog
134- Wait Until Page Contains Element ${DIALOG WINDOW } timeout=180s
135-
136115Open Context Menu Over
137116 [Arguments] ${sel }
138- Mouse Over ${sel }
139- Sleep 10s
140- Mouse Over ${sel }
117+ Wait Until Keyword Succeeds 10 x 0.1 s Mouse Over ${sel }
141118 Wait Until Keyword Succeeds 10 x 0.1 s Click Element ${sel }
142119 Wait Until Keyword Succeeds 10 x 0.1 s Open Context Menu ${sel }
143120
121+ Get Editor Content
122+ ${content } Execute JavaScript return document.querySelector('.CodeMirror').CodeMirror.getValue()
123+ [Return] ${content }
124+
144125Editor Content Changed
145126 [Arguments] ${old_content }
146- ${new_content } Execute JavaScript return document.querySelector('.CodeMirror').CodeMirror.getValue()
127+ ${new_content } Get Editor Content
147128 Should Not Be Equal ${old_content } ${new_content }
148129 [Return] ${new_content }
149130
@@ -152,18 +133,14 @@ Editor Should Rename
152133 Set Tags feature:rename
153134 ${sel } = Set Variable If "${symbol } ".startswith(("xpath", "css")) ${symbol } xpath:(//span[@role="presentation"][contains(., "${symbol } ")])[last()]
154135 Open Context Menu Over ${sel }
155- ${old_content } Execute JavaScript return document.querySelector('.CodeMirror').CodeMirror.getValue()
136+ ${old_content } Get Editor Content
156137 Capture Page Screenshot 03-rename-0.png
157138 Mouse Over ${MENU RENAME }
158139 Capture Page Screenshot 03-rename-1.png
159140 Click Element ${MENU RENAME }
160- Wait For Dialog
161- Click Element ${DIALOG INPUT }
162- Capture Page Screenshot 03-rename-3.png
163- Input Text ${DIALOG INPUT } new_name
164- Capture Page Screenshot 03-rename-4.png
165- Click Element css:button.jp-Dialog-button.jp-mod-accept
141+ Capture Page Screenshot 03-rename-2.png
142+ Input Into Dialog new_name
166143 Sleep 2s
167- Capture Page Screenshot 03-rename-5 .png
144+ Capture Page Screenshot 03-rename-3 .png
168145 ${new_content } Wait Until Keyword Succeeds 10 x 0.1 s Editor Content Changed ${old_content }
169146 Should Be True "new_name" in """${new_content } """
0 commit comments