Revize 73a0fa0b
Přidáno uživatelem Pavel Fidranský před téměř 6 roky(ů)
sources/src/main/webapp/tests/filter.robot | ||
---|---|---|
1 |
*** Settings *** |
|
2 |
Documentation A test suite with tests of node filtering. |
|
3 |
|
|
4 |
Library String |
|
5 |
|
|
6 |
Suite Setup Open Browser To Demo Diagram |
|
7 |
Suite Teardown Close Browser |
|
8 |
Test Teardown Reload Diagram Screen |
|
9 |
|
|
10 |
Resource common.robot |
|
11 |
|
|
12 |
|
|
13 |
*** Variables *** |
|
14 |
${filterButton} //button[@id="filterButton"] |
|
15 |
${filterModalWindow} //div[contains(@class, "filter-modal")] |
|
16 |
${filterModalWindowCloseButton} ${filterModalWindow}//button[contains(@class, "close-button")] |
|
17 |
|
|
18 |
${baseFilterDropdown} ${filterModalWindow}//select[@name="filter"] |
|
19 |
${additionalFilterDropdown} ${filterModalWindow}//select[@name="additionalFilter"] |
|
20 |
${operationDropdown} ${filterModalWindow}//select[@name="operation"] |
|
21 |
|
|
22 |
${stringValueInput} ${filterModalWindow}//input[@name="value"] |
|
23 |
${enumValueDropdown} ${filterModalWindow}//select[@name="value"] |
|
24 |
${numberValueInput} ${filterModalWindow}//input[@name="value"] |
|
25 |
${numberFromValueInput} ${filterModalWindow}//input[@name="value-from"] |
|
26 |
${numberToValueInput} ${filterModalWindow}//input[@name="value-to"] |
|
27 |
${dateValueInput} ${filterModalWindow}//input[@name="value"] |
|
28 |
${dateFromValueInput} ${filterModalWindow}//input[@name="value-from"] |
|
29 |
${dateToValueInput} ${filterModalWindow}//input[@name="value-to"] |
|
30 |
|
|
31 |
${applyButton} ${filterModalWindow}//button[@type="submit"] |
|
32 |
${resetButton} ${filterModalWindow}//button[@type="reset"] |
|
33 |
|
|
34 |
${foundNodes} //*[name()="svg"][contains(@class, "node--found")] |
|
35 |
|
|
36 |
|
|
37 |
*** Test Cases *** |
|
38 |
Open filter modal |
|
39 |
Click Button ${filterButton} |
|
40 |
Element Should Not Have Attribute ${filterModalWindow} hidden |
|
41 |
|
|
42 |
|
|
43 |
Close filter modal by button click |
|
44 |
Click Button ${filterButton} |
|
45 |
Click Button ${filterModalWindowCloseButton} |
|
46 |
Element Should Have Attribute ${filterModalWindow} hidden |
|
47 |
|
|
48 |
|
|
49 |
Close filter modal by backdrop click |
|
50 |
Click Button ${filterButton} |
|
51 |
Click Element At Coordinates ${filterModalWindow} 221 0 |
|
52 |
Element Should Have Attribute ${filterModalWindow} hidden |
|
53 |
|
|
54 |
|
|
55 |
Focus form fields |
|
56 |
Click Button ${filterButton} |
|
57 |
Click Element ${filterModalWindow}//label[@for="filter"] |
|
58 |
Element Should Be Focused ${baseFilterDropdown} |
|
59 |
Click Element ${filterModalWindow}//label[@for="operation"] |
|
60 |
Element Should Be Focused ${operationDropdown} |
|
61 |
|
|
62 |
|
|
63 |
Reset form |
|
64 |
Click Button ${filterButton} |
|
65 |
Select From List By Label ${enumValueDropdown} Vertex |
|
66 |
Click Button ${applyButton} |
|
67 |
Click Button ${resetButton} |
|
68 |
${values}= Get Selected List Labels ${enumValueDropdown} |
|
69 |
Should Be Empty ${values} |
|
70 |
${count}= Get Element Count ${foundNodes} |
|
71 |
Should Be Equal As Integers ${count} 0 |
|
72 |
|
|
73 |
|
|
74 |
Check defaults |
|
75 |
Click Button ${filterButton} |
|
76 |
${baseFilterValue}= Get Selected List Label ${baseFilterDropdown} |
|
77 |
Should Be Equal As Strings ${baseFilterValue} Node type |
|
78 |
Element Should Have Attribute ${additionalFilterDropdown} hidden |
|
79 |
${operationValue}= Get Selected List Label ${operationDropdown} |
|
80 |
Should Be Equal As Strings ${operationValue} equals |
|
81 |
${values}= Get Selected List Labels ${enumValueDropdown} |
|
82 |
Should Be Empty ${values} |
|
83 |
|
|
84 |
|
|
85 |
Filter by node type equals |
|
86 |
[Tags] filter-by-node-type |
|
87 |
Click Button ${filterButton} |
|
88 |
Select From List By Label ${operationDropdown} equals |
|
89 |
Select From List By Label ${enumValueDropdown} Vertex |
|
90 |
Click Button ${applyButton} |
|
91 |
${count}= Get Element Count ${foundNodes} |
|
92 |
Should Be Equal As Integers ${count} 36 |
|
93 |
|
|
94 |
|
|
95 |
Filter by node type not equals |
|
96 |
[Tags] filter-by-node-type |
|
97 |
Click Button ${filterButton} |
|
98 |
Select From List By Label ${operationDropdown} not equals |
|
99 |
Select From List By Label ${enumValueDropdown} Vertex |
|
100 |
Click Button ${applyButton} |
|
101 |
${count}= Get Element Count ${foundNodes} |
|
102 |
Should Be Equal As Integers ${count} 1 |
|
103 |
|
|
104 |
|
|
105 |
Filter by vertex archetype equals |
|
106 |
[Tags] filter-by-vertex-archetype |
|
107 |
Click Button ${filterButton} |
|
108 |
Select From List By Label ${baseFilterDropdown} Vertex archetype |
|
109 |
Select From List By Label ${operationDropdown} equals |
|
110 |
Select From List By Label ${enumValueDropdown} Person |
|
111 |
Click Button ${applyButton} |
|
112 |
Found Count Should Be Equal 4 |
|
113 |
|
|
114 |
|
|
115 |
Filter by vertex archetype not equals |
|
116 |
[Tags] filter-by-vertex-archetype |
|
117 |
Click Button ${filterButton} |
|
118 |
Select From List By Label ${baseFilterDropdown} Vertex archetype |
|
119 |
Select From List By Label ${operationDropdown} not equals |
|
120 |
Select From List By Label ${enumValueDropdown} Person |
|
121 |
Click Button ${applyButton} |
|
122 |
Found Count Should Be Equal 32 |
|
123 |
|
|
124 |
|
|
125 |
Filter by string vertex attribute equals |
|
126 |
[Tags] filter-by-vertex-attribute filter-by-vertex-string-attribute |
|
127 |
Click Button ${filterButton} |
|
128 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
129 |
Select From List By Label ${additionalFilterDropdown} Name (string) |
|
130 |
Select From List By Label ${operationDropdown} equals |
|
131 |
Input Text ${stringValueInput} Stakeholders |
|
132 |
Click Button ${applyButton} |
|
133 |
Found Count Should Be Equal 1 |
|
134 |
|
|
135 |
|
|
136 |
Filter by string vertex attribute contains |
|
137 |
[Tags] filter-by-vertex-attribute filter-by-vertex-string-attribute |
|
138 |
Click Button ${filterButton} |
|
139 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
140 |
Select From List By Label ${additionalFilterDropdown} Name (string) |
|
141 |
Select From List By Label ${operationDropdown} contains |
|
142 |
Input Text ${stringValueInput} mentor |
|
143 |
Click Button ${applyButton} |
|
144 |
Found Count Should Be Equal 2 |
|
145 |
|
|
146 |
|
|
147 |
Filter by string vertex attribute starts with |
|
148 |
[Tags] filter-by-vertex-attribute filter-by-vertex-string-attribute |
|
149 |
Click Button ${filterButton} |
|
150 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
151 |
Select From List By Label ${additionalFilterDropdown} Name (string) |
|
152 |
Select From List By Label ${operationDropdown} starts with |
|
153 |
Input Text ${stringValueInput} Product |
|
154 |
Click Button ${applyButton} |
|
155 |
Found Count Should Be Equal 2 |
|
156 |
|
|
157 |
|
|
158 |
Filter by string vertex attribute ends with |
|
159 |
[Tags] filter-by-vertex-attribute filter-by-vertex-string-attribute |
|
160 |
Click Button ${filterButton} |
|
161 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
162 |
Select From List By Label ${additionalFilterDropdown} Name (string) |
|
163 |
Select From List By Label ${operationDropdown} ends with |
|
164 |
Input Text ${stringValueInput} projektu |
|
165 |
Click Button ${applyButton} |
|
166 |
Found Count Should Be Equal 2 |
|
167 |
|
|
168 |
|
|
169 |
Filter by string vertex attribute matches |
|
170 |
[Tags] filter-by-vertex-attribute filter-by-vertex-string-attribute |
|
171 |
Click Button ${filterButton} |
|
172 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
173 |
Select From List By Label ${additionalFilterDropdown} Name (string) |
|
174 |
Select From List By Label ${operationDropdown} regular expression |
|
175 |
Input Text ${stringValueInput} \\d+ |
|
176 |
Click Button ${applyButton} |
|
177 |
Found Count Should Be Equal 4 |
|
178 |
|
|
179 |
|
|
180 |
Filter by enum vertex attribute equals |
|
181 |
[Tags] filter-by-vertex-attribute filter-by-vertex-enum-attribute |
|
182 |
Click Button ${filterButton} |
|
183 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
184 |
Select From List By Label ${additionalFilterDropdown} Roles (enum) |
|
185 |
Select From List By Label ${operationDropdown} equals |
|
186 |
Select From List By Label ${enumValueDropdown} Developer |
|
187 |
Click Button ${applyButton} |
|
188 |
Found Count Should Be Equal 3 |
|
189 |
|
|
190 |
|
|
191 |
Filter by enum vertex attribute not equals |
|
192 |
[Tags] filter-by-vertex-attribute filter-by-vertex-enum-attribute |
|
193 |
Click Button ${filterButton} |
|
194 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
195 |
Select From List By Label ${additionalFilterDropdown} Roles (enum) |
|
196 |
Select From List By Label ${operationDropdown} not equals |
|
197 |
Select From List By Label ${enumValueDropdown} Team leader |
|
198 |
Click Button ${applyButton} |
|
199 |
Found Count Should Be Equal 3 |
|
200 |
|
|
201 |
|
|
202 |
Filter by date vertex attribute equals |
|
203 |
[Tags] filter-by-vertex-attribute filter-by-vertex-date-attribute |
|
204 |
Click Button ${filterButton} |
|
205 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
206 |
Select From List By Label ${additionalFilterDropdown} Created (date) |
|
207 |
Select From List By Label ${operationDropdown} equals |
|
208 |
Input Date ${dateValueInput} 2017-03-27 |
|
209 |
Click Button ${applyButton} |
|
210 |
Found Count Should Be Equal 5 |
|
211 |
|
|
212 |
|
|
213 |
Filter by date vertex attribute not equals |
|
214 |
[Tags] filter-by-vertex-attribute filter-by-vertex-date-attribute |
|
215 |
Click Button ${filterButton} |
|
216 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
217 |
Select From List By Label ${additionalFilterDropdown} Created (date) |
|
218 |
Select From List By Label ${operationDropdown} not equals |
|
219 |
Input Date ${dateValueInput} 2017-03-27 |
|
220 |
Click Button ${applyButton} |
|
221 |
Found Count Should Be Equal 27 |
|
222 |
|
|
223 |
|
|
224 |
Filter by date vertex attribute from unix epoch to date |
|
225 |
[Tags] filter-by-vertex-attribute filter-by-vertex-date-attribute |
|
226 |
Click Button ${filterButton} |
|
227 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
228 |
Select From List By Label ${additionalFilterDropdown} Created (date) |
|
229 |
Select From List By Label ${operationDropdown} is in range |
|
230 |
Input Date ${dateToValueInput} 2017-04-01 |
|
231 |
Click Button ${applyButton} |
|
232 |
Found Count Should Be Equal 6 |
|
233 |
|
|
234 |
|
|
235 |
Filter by date vertex attribute is in range |
|
236 |
[Tags] filter-by-vertex-attribute filter-by-vertex-date-attribute |
|
237 |
Click Button ${filterButton} |
|
238 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
239 |
Select From List By Label ${additionalFilterDropdown} Created (date) |
|
240 |
Select From List By Label ${operationDropdown} is in range |
|
241 |
Input Date ${dateFromValueInput} 2017-04-01 |
|
242 |
Input Date ${dateToValueInput} 2017-05-01 |
|
243 |
Click Button ${applyButton} |
|
244 |
Found Count Should Be Equal 22 |
|
245 |
|
|
246 |
|
|
247 |
Filter by date vertex attribute is from date to now |
|
248 |
[Tags] filter-by-vertex-attribute filter-by-vertex-date-attribute |
|
249 |
Click Button ${filterButton} |
|
250 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
251 |
Select From List By Label ${additionalFilterDropdown} Created (date) |
|
252 |
Select From List By Label ${operationDropdown} is in range |
|
253 |
Input Date ${dateFromValueInput} 2017-05-01 |
|
254 |
Click Button ${applyButton} |
|
255 |
Found Count Should Be Equal 4 |
|
256 |
|
|
257 |
|
|
258 |
Filter by number vertex attribute equals |
|
259 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
260 |
Click Button ${filterButton} |
|
261 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
262 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
263 |
Select From List By Label ${operationDropdown} equals |
|
264 |
Input Text ${numberValueInput} 40 |
|
265 |
Click Button ${applyButton} |
|
266 |
Found Count Should Be Equal 1 |
|
267 |
|
|
268 |
|
|
269 |
Filter by number vertex attribute not equals |
|
270 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
271 |
Click Button ${filterButton} |
|
272 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
273 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
274 |
Select From List By Label ${operationDropdown} not equals |
|
275 |
Input Text ${numberValueInput} 40 |
|
276 |
Click Button ${applyButton} |
|
277 |
Found Count Should Be Equal 0 |
|
278 |
|
|
279 |
|
|
280 |
Filter by number vertex attribute lower than |
|
281 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
282 |
Click Button ${filterButton} |
|
283 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
284 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
285 |
Select From List By Label ${operationDropdown} lower than |
|
286 |
Input Text ${numberValueInput} 40 |
|
287 |
Click Button ${applyButton} |
|
288 |
Found Count Should Be Equal 0 |
|
289 |
|
|
290 |
|
|
291 |
Filter by number vertex attribute lower than or equals |
|
292 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
293 |
Click Button ${filterButton} |
|
294 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
295 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
296 |
Select From List By Label ${operationDropdown} lower than or equals |
|
297 |
Input Text ${numberValueInput} 40 |
|
298 |
Click Button ${applyButton} |
|
299 |
Found Count Should Be Equal 1 |
|
300 |
|
|
301 |
|
|
302 |
Filter by number vertex attribute greater than |
|
303 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
304 |
Click Button ${filterButton} |
|
305 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
306 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
307 |
Select From List By Label ${operationDropdown} greater than |
|
308 |
Input Text ${numberValueInput} 40 |
|
309 |
Click Button ${applyButton} |
|
310 |
Found Count Should Be Equal 0 |
|
311 |
|
|
312 |
|
|
313 |
Filter by number vertex attribute greater than or equals |
|
314 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
315 |
Click Button ${filterButton} |
|
316 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
317 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
318 |
Select From List By Label ${operationDropdown} greater than or equals |
|
319 |
Input Text ${numberValueInput} 40 |
|
320 |
Click Button ${applyButton} |
|
321 |
Found Count Should Be Equal 1 |
|
322 |
|
|
323 |
|
|
324 |
Filter by number vertex attribute is from min to number |
|
325 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
326 |
Click Button ${filterButton} |
|
327 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
328 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
329 |
Select From List By Label ${operationDropdown} is in range |
|
330 |
Input Text ${numberToValueInput} 30 |
|
331 |
Click Button ${applyButton} |
|
332 |
Found Count Should Be Equal 0 |
|
333 |
|
|
334 |
|
|
335 |
Filter by number vertex attribute is in range |
|
336 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
337 |
Click Button ${filterButton} |
|
338 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
339 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
340 |
Select From List By Label ${operationDropdown} is in range |
|
341 |
Input Text ${numberFromValueInput} 30 |
|
342 |
Input Text ${numberToValueInput} 50 |
|
343 |
Click Button ${applyButton} |
|
344 |
Found Count Should Be Equal 1 |
|
345 |
|
|
346 |
|
|
347 |
Filter by number vertex attribute is from number to max |
|
348 |
[Tags] filter-by-vertex-attribute filter-by-vertex-number-attribute |
|
349 |
Click Button ${filterButton} |
|
350 |
Select From List By Label ${baseFilterDropdown} Vertex attribute |
|
351 |
Select From List By Label ${additionalFilterDropdown} Progress (number) |
|
352 |
Select From List By Label ${operationDropdown} is in range |
|
353 |
Input Text ${numberFromValueInput} 50 |
|
354 |
Click Button ${applyButton} |
|
355 |
Found Count Should Be Equal 0 |
|
356 |
|
|
357 |
|
|
358 |
*** Keywords *** |
|
359 |
Found Count Should Be Equal |
|
360 |
[Arguments] ${expectedCount} |
|
361 |
${count}= Get Element Count ${foundNodes} |
|
362 |
Should Be Equal As Integers ${count} ${expectedCount} |
|
363 |
|
|
364 |
|
|
365 |
Input Date |
|
366 |
[Arguments] ${locator} ${date} |
|
367 |
# split date to parts (day, month, year) |
|
368 |
@{parts}= Split String ${date} - |
|
369 |
# enter individual parts into the input |
|
370 |
Set Focus To Element ${locator} |
|
371 |
Press Key ${locator} @{parts}[2] |
|
372 |
Press Key ${locator} @{parts}[1] |
|
373 |
Press Key ${locator} @{parts}[0] |
Také k dispozici: Unified diff
Node filters robot tests