latest: Remove redundant header
[ninja.git] / features / filters.feature
blob8ba086165e47f3c0abadc9923d615c76ac1580cb
1 @filters @listview
2 Feature: Filters & list views
3         @configuration @asmonitor
4         @bug-7012
5         Scenario: Host service single multi-delete
6                 Given I have these hosts:
7                         | host_name     |
8                         | linux-server1 |
9                 And I have these services:
10                         | service_description | host_name     | check_command   | notifications_enabled | active_checks_enabled |
11                         | System Load         | linux-server1 | check_nrpe!load | 1                     | 1                     |
12                         | PING                | linux-server1   | check_ping      | 1                     | 0                     |
13                 And I have activated the configuration
14                 And I'm on the list view for query "[services] active_checks_enabled = 1"
15                 Then I should see "System Load"
16                 And I shouldn't see "PING"
17                 When I check "select_all"
18                 And I click "Send multi action"
19                 And I click "Delete services"
20                 Then I should be on the Configure page
21                 Then I should see "There are 1 changes to 1 service objects" within frame "iframe"
22                 When I click "More info" within frame "iframe"
23                 Then I should see "Deleted service object linux-server1;System Load" within frame "iframe"
24                 And I shouldn't see "linux-server1;PING" within frame "iframe"
25                 And I should see button "Save" within frame "iframe"
26                 When I click button "Save" within frame "iframe"
27                 Then I should see "Preflight configuration check turned out ok." within frame "iframe"
29         @configuration @asmonitor
30         @bug-7012
31         Scenario: Host service multi multi-delete
32                 Given I have these hosts:
33                         | host_name     |
34                         | linux-server1 |
35                 And I have these services:
36                         | service_description | host_name     | check_command   | notifications_enabled | active_checks_enabled |
37                         | System Load         | linux-server1 | check_nrpe!load | 1                     | 1                     |
38                         | PING1               | linux-server1 | check_ping      | 1                     | 1                     |
39                         | PING2               | linux-server1 | check_ping      | 1                     | 0                     |
40                 And I have activated the configuration
41                 And I'm on the list view for query "[services] active_checks_enabled = 1"
42                 Then I should see "System Load"
43                 And I should see "PING1"
44                 And I shouldn't see "PING2"
45                 When I check "select_all"
46                 And I click "Send multi action"
47                 And I click "Delete services"
48                 Then I should be on the Configure page
49                 Then I should see "There are 2 changes to 2 service objects" within frame "iframe"
50                 When I click "More info" within frame "iframe"
51                 Then I should see "Deleted service object linux-server1;System Load" within frame "iframe"
52                 And I should see "linux-server1;PING1" within frame "iframe"
53                 And I shouldn't see "linux-server1;PING2" within frame "iframe"
54                 And I should see button "Save" within frame "iframe"
55                 When I click button "Save" within frame "iframe"
56                 Then I should see "Preflight configuration check turned out ok." within frame "iframe"
58         @configuration @asmonitor
59         @bug-7012
60         Scenario: Hostgroup service single multi-delete
61                 Given I have these hosts:
62                         | host_name     | hostgroups |
63                         | linux-server1 | a_group    |
64                 And I have these hostgroups:
65                         | hostgroup_name |
66                         | a_group        |
67                 And I have these services:
68                         | service_description | hostgroup_name | check_command   | notifications_enabled | active_checks_enabled |
69                         | System Load         | a_group        | check_nrpe!load | 1                     | 1                     |
70                         | PING                | a_group        | check_ping      | 1                     | 0                     |
71                 And I have activated the configuration
72                 And I'm on the list view for query "[services] active_checks_enabled = 1"
73                 Then I should see "System Load"
74                 And I shouldn't see "PING"
75                 When I check "select_all"
76                 And I click "Send multi action"
77                 And I click "Delete services"
78                 Then I should see "You've selected a service that is saved on a hostgroup"
79                 And I should see "System Load"
80                 And I shouldn't see "PING"
81                 When I click "Submit"
82                 Then I should be on the Configure page
83                 Then I should see "There are 1 changes to 1 service objects" within frame "iframe"
84                 When I click "More info" within frame "iframe"
85                 Then I should see "Deleted service object a_group;System Load" within frame "iframe"
86                 And I shouldn't see "a_group;PING" within frame "iframe"
87                 And I should see button "Save" within frame "iframe"
88                 When I click button "Save" within frame "iframe"
89                 Then I should see "Preflight configuration check turned out ok." within frame "iframe"
91         @configuration @asmonitor
92         @bug-7012
93         Scenario: Hostgroup service multi multi-delete
94                 Given I have these hosts:
95                         | host_name     | hostgroups |
96                         | linux-server1 | a_group    |
97                 And I have these hostgroups:
98                         | hostgroup_name |
99                         | a_group        |
100                 And I have these services:
101                         | service_description | hostgroup_name | check_command   | notifications_enabled | active_checks_enabled |
102                         | System Load         | a_group        | check_nrpe!load | 1                     | 1                     |
103                         | PING1               | a_group        | check_ping      | 1                     | 1                     |
104                         | PING2               | a_group        | check_ping      | 1                     | 0                     |
105                 And I have activated the configuration
106                 And I'm on the list view for query "[services] active_checks_enabled = 1"
107                 Then I should see "System Load"
108                 And I should see "PING1"
109                 And I shouldn't see "PING2"
110                 When I check "select_all"
111                 And I click "Send multi action"
112                 And I click "Delete services"
113                 Then I should see "You've selected services that are saved on hostgroups"
114                 And I should see "System Load"
115                 And I should see "PING1"
116                 And I shouldn't see "PING2"
117                 When I click "Submit"
118                 Then I should be on the Configure page
119                 Then I should see "There are 2 changes to 2 service objects" within frame "iframe"
120                 When I click "More info" within frame "iframe"
121                 Then I should see "Deleted service object a_group;System Load" within frame "iframe"
122                 And I should see "a_group;PING1" within frame "iframe"
123                 And I shouldn't see "linux-server1" within frame "iframe"
124                 And I shouldn't see "PING2" within frame "iframe"
125                 And I should see button "Save" within frame "iframe"
126                 When I click button "Save" within frame "iframe"
127                 Then I should see "Preflight configuration check turned out ok." within frame "iframe"
129         @configuration @asmonitor
130         @bug-7012
131         Scenario: Host single multi-delete
132                 Given I have these hosts:
133                         | host_name     | active_checks_enabled |
134                         | linux-server1 | 0                     |
135                         | linux-server2 | 1                     |
136                 And I have these services:
137                         | service_description | host_name     | check_command   | notifications_enabled | active_checks_enabled |
138                         | System Load         | linux-server1 | check_nrpe!load | 1                     | 1                     |
139                         | PING                | linux-server1 | check_ping      | 1                     | 0                     |
140                 And I have activated the configuration
141                 And I'm on the list view for query "[hosts] state != 200 and active_checks_enabled = 1"
142                 Then I should see "linux-server2"
143                 And I shouldn't see "linux-server1"
144                 When I check "select_all"
145                 And I click "Send multi action"
146                 And I click "Delete hosts"
147                 Then I should be on the Configure page
148                 Then I should see "There are 1 changes to 1 host objects" within frame "iframe"
149                 When I click "More info" within frame "iframe"
150                 Then I should see "Deleted host object linux-server2" within frame "iframe"
151                 And I shouldn't see "linux-server1" within frame "iframe"
152                 And I should see button "Save" within frame "iframe"
153                 When I click button "Save" within frame "iframe"
154                 Then I should see "Preflight configuration check turned out ok." within frame "iframe"
156         @configuration @asmonitor
157         @bug-7012
158         Scenario: Host multi multi-delete
159                 Given I have these hosts:
160                         | host_name     | active_checks_enabled |
161                         | linux-server1 | 0                     |
162                         | linux-server2 | 1                     |
163                         | linux-server3 | 1                     |
164                 And I have these services:
165                         | service_description | host_name     | check_command   | notifications_enabled | active_checks_enabled |
166                         | System Load         | linux-server1 | check_nrpe!load | 1                     | 1                     |
167                         | PING                | linux-server1   | check_ping      | 1                     | 0                     |
168                 And I have activated the configuration
169                 And I'm on the list view for query "[hosts] state != 200 and active_checks_enabled = 1"
170                 Then I should see "linux-server2"
171                 And I should see "linux-server3"
172                 And I shouldn't see "linux-server1"
173                 When I check "select_all"
174                 And I click "Send multi action"
175                 And I click "Delete hosts"
176                 Then I should be on the Configure page
177                 Then I should see "There are 2 changes to 2 host objects" within frame "iframe"
178                 When I click "More info" within frame "iframe"
179                 Then I should see "Deleted host object linux-server2" within frame "iframe"
180                 And I shouldn't see "linux-server1" within frame "iframe"
181                 And I should see button "Save" within frame "iframe"
182                 When I click button "Save" within frame "iframe"
183                 Then I should see "Preflight configuration check turned out ok." within frame "iframe"
185         @configuration @asmonitor
186         Scenario: List hosts
187                 Given I have these hosts:
188                         | host_name |
189                         | linux-server1 |
190                         | linux-server2 |
191                         | linux-server3 |
192                         | linux-server4 |
193                         | linux-server5 |
194                 And I have these services:
195                         | service_description | host_name               | check_command |
196                         | PING                | linux-server1   | check_ping    |
197                         | PING                | linux-server2   | check_ping    |
198                         | PING                | linux-server3   | check_ping    |
199                         | PING                | linux-server4   | check_ping    |
200                         | PING                | linux-server5   | check_ping    |
201                 And I have activated the configuration
202                 And I'm on the list view for query "[hosts] all"
203                 Then I should see the configured hosts
205         @configuration @asmonitor
206         Scenario: List hosts
207                 Given I have these hosts:
208                         | host_name |
209                         | linux-server1 |
210                         | linux-server2 |
211                         | linux-server3 |
212                         | linux-server4 |
213                         | linux-server5 |
214                 And I have these services:
215                         | service_description | host_name               | check_command |
216                         | PING                | linux-server1   | check_ping    |
217                         | PING                | linux-server2   | check_ping    |
218                         | PING                | linux-server3   | check_ping    |
219                         | PING                | linux-server4   | check_ping    |
220                         | PING                | linux-server5   | check_ping    |
221                 And I have activated the configuration
222                 And I'm on the list view for query "[services] all"
223                 Then I should see the configured services
224                 And I should see the configured hosts
227         @configuration @asmonitor
228         Scenario: List hosts
229                 Given I have these hosts:
230                         | host_name |
231                         | linux-server1 |
232                         | linux-server2 |
233                 And I have these services:
234                         | service_description | host_name               | check_command |
235                         | PING                | linux-server1   | check_ping    |
236                         | PING                | linux-server2   | check_ping    |
237                 And I have activated the configuration
238                 And I'm on the list view for query "[services] all"
239                 Then I should see the configured services
240                 And I should see "linux-server1"
241                 And I should see "linux-server2"
244         @configuration @asmonitor
245         Scenario: List services with granular filter
246                 Ensure that filters work even when we specify more limiting
247                 filters.
249                 Given I have these hosts:
250                         | host_name |
251                         | linux-server1 |
252                         | linux-server2 |
253                 And I have these services:
254                         | service_description | host_name     | check_command   | notifications_enabled | active_checks_enabled |
255                         | PING                | linux-server1   | check_ping      | 1                     | 0                     |
256                         | PING                | linux-server2   | check_ping      | 0                     | 1                     |
257                 And I have activated the configuration
258                 And I'm on the list view for query "[services] active_checks_enabled = 0 and notifications_enabled = 1"
259                 And I should see "PING"
260                 And I should see "linux-server1"
261                 And I shouldn't see "linux-server2"
263         @configuration @asmonitor @case-653
264         Scenario: Service detail listing column sorting
265                 Ensure that it is possible to sort by the columns in the listing.
266                 Sort by description.
268                 Given I have these hosts:
269                         | host_name |
270                         | linux-server1 |
271                 And I have these services:
272                         | service_description   | host_name             | check_command |
273                         | A-service                             | linux-server1 | check_ping    |
274                         | B-service                             | linux-server1 | check_ping    |
275                         | C-service                             | linux-server1 | check_ping    |
276                         | D-service                             | linux-server1 | check_ping    |
277                 And I have activated the configuration
278                 Given I am on the Service details page
279                 When I sort the filter result table by "description"
280                 Then The first row of the filter result table should contain "A-service"
281                 And The last row of the filter result table should contain "D-service"
282                 When I sort the filter result table by "description"
283                 Then The first row of the filter result table should contain "D-service"
284                 And The last row of the filter result table should contain "A-service"
287         @configuration @asmonitor @case-653
288         Scenario: Service detail listing column sorting
289                 Ensure that it is possible to sort by the columns in the listing.
290                 Sort by last checked.
292                 Given I have these hosts:
293                         | host_name |
294                         | linux-server1 |
295                 And I have these services:
296                         | service_description   | host_name             | check_command |
297                         | A-service                             | linux-server1 | check_ping    |
298                         | B-service                             | linux-server1 | check_ping    |
299                         | C-service                             | linux-server1 | check_ping    |
300                         | D-service                             | linux-server1 | check_ping    |
301                 And I have activated the configuration
302                 Given I have submitted a passive service check result "linux-server1;C-service;0;some output"
303                 And I am on the Service details page
304                 When I sort the filter result table by "last_check"
305                 Then The last row of the filter result table should contain "C-service"
306                 When I sort the filter result table by "last_check"
307                 Then The first row of the filter result table should contain "C-service"
309         @configuration @asmonitor @case-653
310         Scenario: Service detail listing column sorting
311                 Ensure that it is possible to sort by the columns in the listing.
312                 Sort by duration.
314                 Given I have these hosts:
315                         | host_name |
316                         | linux-server1 |
317                 And I have these services:
318                         | service_description   | host_name             | check_command |
319                         | A-service                             | linux-server1 | check_ping    |
320                         | B-service                             | linux-server1 | check_ping    |
321                         | C-service                             | linux-server1 | check_ping    |
322                         | D-service                             | linux-server1 | check_ping    |
323                 And I have activated the configuration
324                 Given I have submitted a passive service check result "linux-server1;B-service;0;some output"
325                 And I am on the Service details page
326                 When I sort the filter result table by "duration"
327                 Then The first row of the filter result table should contain "B-service"
328                 When I sort the filter result table by "duration"
329                 Then The last row of the filter result table should contain "B-service"
331         @configuration @asmonitor @case-653
332         Scenario: Service detail listing column sorting
333                 Ensure that it is possible to sort by the columns in the listing.
334                 Sort by status information.
336                 Given I have these hosts:
337                         | host_name |
338                         | linux-server1 |
339                 And I have these services:
340                         | service_description   | host_name             | check_command |
341                         | A-service                             | linux-server1 | check_ping    |
342                         | B-service                             | linux-server1 | check_ping    |
343                         | C-service                             | linux-server1 | check_ping    |
344                         | D-service                             | linux-server1 | check_ping    |
345                 And I have activated the configuration
346                 Given I have submitted a passive service check result "linux-server1;B-service;0;Apocryphal status information message"
347                 And I have submitted a passive service check result "linux-server1;A-service;1;Bereaved status information"
348                 And I have submitted a passive service check result "linux-server1;D-service;0;Curmudgeonly status information"
349                 And I have submitted a passive service check result "linux-server1;C-service;0;Dandy status information"
350                 And I am on the Service details page
351                 When I sort the filter result table by "status_information"
352                 Then The first row of the filter result table should contain "B-service"
353                 And The last row of the filter result table should contain "C-service"
354                 When I sort the filter result table by "status_information"
355                 Then The last row of the filter result table should contain "B-service"
356                 And The first row of the filter result table should contain "C-service"
359         @configuration @asmonitor @case-653
360         Scenario: Service detail listing column sorting
361                 Ensure that it is possible to sort by the columns in the listing.
362                 Sort by state.
364                 Given I have these hosts:
365                         | host_name |
366                         | linux-server1 |
367                 And I have these services:
368                         | service_description   | host_name             | check_command |
369                         | A-service                             | linux-server1 | check_ping    |
370                         | B-service                             | linux-server1 | check_ping    |
371                         | C-service                             | linux-server1 | check_ping    |
372                 And I have activated the configuration
373                 Given I have submitted a passive service check result "linux-server1;A-service;1;Bereaved status information"
374                 And I have submitted a passive service check result "linux-server1;B-service;0;Apocryphal status information message"
375                 And I have submitted a passive service check result "linux-server1;C-service;2;Dandy status information"
376                 And I am on the Service details page
377                 When I sort the filter result table by "state"
378                 Then The first row of the filter result table should contain "C-service"
379                 And The last row of the filter result table should contain "B-service"
380                 When I sort the filter result table by "state"
381                 Then The last row of the filter result table should contain "C-service"
382                 And The first row of the filter result table should contain "B-service"
384         @configuration @asmonitor
385         Scenario: Save filter
386                 Given I am on the Host details page
387                 And I click "Show/Edit Text Filter"
388                 And I enter "Ernie" into "lsfilter_save_filter_name"
389                 And I click "Save Filter"
390                 And I hover over the "Saved-filters" button
391                 Then I should see these menu items:
392                         | Ernie |