Updated testing for filter selects in reports
[ninja.git] / features / availability.feature
blob8e96919e4aee260ff17ee4cec394994ab05f1cb7
1 @availability
2 Feature: Availability reports
3         Warning: Assumes the time format is ISO-8601 (the default)
5         Background:
6                 Given I have these hostgroups configured:
7                         | hostgroup_name | alias      |
8                         | LinuxServers   | HGALIAS-ls |
9                         | WindowsServers | HGALIAS-ws |
10                         | MixedGroup     | HGALIAS-mg |
11                         | EmptyGroup     | HGALIAS-eg |
12                 And I have these hosts:
13                         | host_name      | host_groups               | alias      |
14                         | linux-server1  | LinuxServers,MixedGroup   | HALIAS-ls1 |
15                         | linux-server2  | LinuxServers              | HALIAS-ls2 |
16                         | win-server1    | WindowsServers            | HALIAS-ws1 |
17                         | win-server2    | WindowsServers,MixedGroup | HALIAS-ws2 |
18                 And I have these servicegroups:
19                         | servicegroup_name | alias     |
20                         | pings             | SGALIAS-p |
21                         | empty             | SGALIAS-e |
22                 And I have these services:
23                         | service_description | host_name     | check_command   | notifications_enabled | active_checks_enabled | service_groups |
24                         | System Load         | linux-server1 | check_nrpe!load | 1                     | 1                     |                |
25                         | PING                | linux-server1   | check_ping    | 1                     | 0                     | pings          |
26                         | System Load         | linux-server2 | check_nrpe!load | 1                     | 1                     |                |
27                         | PING                | win-server1   | check_ping      | 1                     | 0                     | pings          |
28                         | PING                | win-server2   | check_ping      | 0                     | 1                     | pings          |
29                 And I have these report data entries:
30                         | timestamp           | event_type | flags | attrib | host_name     | service_description | state | hard | retry | downtime_depth | output |
31                         | 2013-01-01 12:00:00 |        100 |  NULL |   NULL |               |                     |     0 |    0 |     0 |           NULL | NULL                |
32                         | 2013-01-01 12:00:01 |        801 |  NULL |   NULL | win-server1   |                     |     0 |    1 |     1 |           NULL | OK - laa-laa        |
33                         | 2013-01-01 12:00:02 |        801 |  NULL |   NULL | linux-server1 |                     |     0 |    1 |     1 |           NULL | OK - Sven Melander  |
34                         | 2013-01-01 12:00:03 |        701 |  NULL |   NULL | win-server1   | PING                |     0 |    1 |     1 |           NULL | OK - po             |
35                         | 2013-01-01 12:00:03 |        701 |  NULL |   NULL | win-server1   | PING                |     1 |    0 |     1 |           NULL | ERROR - tinky-winky |
37                 And I have activated the configuration
39         @configuration @asmonitor @reports
40         Scenario: Generate report without objects
41                 Given I am on the Host details page
42                 And I hover over the "Reporting" button
43                 When I click "Availability"
44                 And I click "Show report"
45                 Then I should see "Please select what objects to base the report on"
46                 And I should see "Report Settings"
48         @configuration @asmonitor @reports
49         Scenario: Generate report on empty hostgroup
50                 Given I am on the Host details page
51                 And I hover over the "Reporting" button
52                 When I click "Availability"
53                 And I select "EmptyGroup" from the multiselect "objects"
54                 Then "objects[]" should have option "EmptyGroup"
55                 When I click "Show report"
56                 Then I should see "The groups you selected (EmptyGroup) had no members, so cannot create a report from them"
57                 And I should see "Report Settings"
59         @configuration @asmonitor @reports
60         Scenario: Generate report on empty servicegroup
61                 Given I am on the Host details page
62                 And I hover over the "Reporting" button
63                 When I click "Availability"
64                 And I select "Servicegroups" from "Report type"
65                 And I select "empty" from "objects"
66                 Then "objects[]" should have option "empty"
67                 When I click "Show report"
68                 Then I should see "The groups you selected (empty) had no members, so cannot create a report from them"
69                 And I should see "Report Settings"
71         @configuration @asmonitor @reports
72         Scenario: Generate single host report
73                 Given I am on the Host details page
74                 And I hover over the "Reporting" button
75                 When I click "Availability"
76                 And I select "Hosts" from "Report type"
77                 And I select "linux-server1" from "objects"
78                 Then "objects[]" should have option "linux-server1"
79                 When I check "Include pie charts"
80                 And I check "Include trends graph"
81                 And I click "Show report"
82                 Then I should see "Host details for linux-server1"
83                 And I should see "objects[]"
84                 And I shouldn't see "objects[]"
85                 And I should see "PING"
86                 And I shouldn't see "linux-server2"
87                 And I shouldn't see "win-server1"
88                 And I should see "Group availability (Worst state)"
89                 And I shouldn't see "Total Alerts"
90                 When I click "Alert histogram"
91                 Then I should see "Alert histogram"
92                 And I should see "linux-server1"
94         @configuration @asmonitor @reports
95         Scenario: Generate multi host report
96                 Given I am on the Host details page
97                 And I hover over the "Reporting" button
98                 When I click "Availability"
99                 And I select "Hosts" from "Report type"
100                 And I select "linux-server1" from "objects"
101                 And I select "win-server1" from "objects"
102                 Then "objects[]" should have option "linux-server1"
103                 And "objects[]" should have option "win-server1"
104                 When I check "Include pie charts"
105                 And I check "Include trends graph"
106                 And I click "Show report"
107                 Then I should see "Host state breakdown"
108                 And I should see "objects[]"
109                 And I shouldn't see "objects[]"
110                 And I should see "linux-server1"
111                 And I should see "win-server1"
112                 And I shouldn't see "linux-server2"
113                 And I shouldn't see "win-server2"
114                 And I should see "Group availability (Worst state)"
115                 And I should see "Summary of selected"
116                 And I shouldn't see "Total summary"
117                 When I click "linux-server1"
118                 Then I should see "Host details for linux-server1"
120         @configuration @asmonitor @reports
121         Scenario: Generate single service report
122                 Given I am on the Host details page
123                 And I hover over the "Reporting" button
124                 When I click "Availability"
125                 And I select "Services" from "Report type"
126                 And I select "linux-server1;PING" from "objects"
127                 Then "objects[]" should have option "linux-server1;PING"
128                 When I check "Include pie charts"
129                 And I check "Include trends graph"
130                 And I click "Show report"
131                 Then I should see "Service details for PING on host linux-server1"
132                 And I shouldn't see "System Load"
133                 And I shouldn't see "win-server"
134                 And I shouldn't see "Group availability (Worst state)"
135                 And I shouldn't see "Summary"
137         @configuration @asmonitor @reports
138         Scenario: Generate multi service on same host report
139                 Given I am on the Host details page
140                 And I hover over the "Reporting" button
141                 When I click "Availability"
142                 And I select "Services" from "Report type"
143                 And I select "linux-server1;PING" from "objects"
144                 And I select "linux-server1;System Load" from "objects"
145                 Then "objects[]" should have option "linux-server1;PING"
146                 And "objects[]" should have option "linux-server1;System Load"
147                 When I check "Use alias"
148                 And I click "Show report"
149                 Then I should see "Service state breakdown"
150                 And I should see "Services on host: HALIAS-ls1 (linux-server1)"
151                 And I should see "PING"
152                 And I should see "System Load"
153                 And I shouldn't see "linux-server2"
154                 And I shouldn't see "win-server1"
155                 And I should see "Group availability (Worst state)"
156                 And I should see "Summary of selected"
157                 And I shouldn't see "Total summary"
158                 When I click "PING"
159                 Then I should see "Service details for PING on host linux-server1"
161         @configuration @asmonitor @reports
162         Scenario: Generate multi service on different host report
163                 Given I am on the Host details page
164                 And I hover over the "Reporting" button
165                 When I click "Availability"
166                 And I select "Services" from "Report type"
167                 And I select "linux-server1;PING" from "objects"
168                 And I select "linux-server2;System Load" from "objects"
169                 Then "objects[]" should have option "linux-server1;PING"
170                 And "objects[]" should have option "linux-server2;System Load"
171                 When I check "Include pie charts"
172                 And I check "Include trends graph"
173                 And I click "Show report"
174                 Then I should see "Service state breakdown"
175                 And I should see "Services on host: linux-server1"
176                 And I should see "PING"
177                 And I should see "Services on host: linux-server2"
178                 And I should see "System Load"
179                 And I shouldn't see "win-server"
180                 And I should see "Group availability (Worst state)"
181                 And I should see "Summary of selected"
182                 And I shouldn't see "Total summary"
183                 When I click "linux-server1"
184                 Then I should see "Host details for linux-server1"
186         @configuration @asmonitor @reports
187         Scenario: Generate single hostgroup report
188                 Given I am on the Host details page
189                 And I hover over the "Reporting" button
190                 When I click "Availability"
191                 And I select "LinuxServers" from "objects"
192                 Then "objects[]" should have option "LinuxServers"
193                 When I check "Use alias"
194                 And I click "Show report"
195                 Then I should see "Hostgroup breakdown"
196                 And I should see "HGALIAS-ls (LinuxServers)"
197                 And I should see "HALIAS-ls1 (linux-server1)"
198                 And I should see "HALIAS-ls2 (linux-server2)"
199                 And I shouldn't see "win-server1"
200                 And I shouldn't see "win-server2"
201                 And I shouldn't see "Summary of selected"
202                 And I shouldn't see "Total summary"
203                 And I should see "Group availability (Worst state)"
205         @configuration @asmonitor @reports
206         Scenario: Generate multi hostgroup report
207                 Given I am on the Host details page
208                 And I hover over the "Reporting" button
209                 When I click "Availability"
210                 And I select "LinuxServers" from "objects"
211                 And I select "WindowsServers" from "objects"
212                 Then "objects[]" should have option "LinuxServers"
213                 And "objects[]" should have option "WindowsServers"
214                 When I check "Include pie charts"
215                 And I check "Include trends graph"
216                 And I click "Show report"
217                 Then I should see "Hostgroup breakdown"
218                 And I should see "Summary of LinuxServers"
219                 And I should see "Summary of WindowsServers"
220                 And I should see "Total summary"
221                 And I should see "linux-server1"
222                 And I should see "linux-server2"
223                 And I should see "win-server1"
224                 And I should see "win-server2"
225                 And I should see "Group availability (Worst state)"
227         @configuration @asmonitor @reports
228         Scenario: Generate hostgroup report with overlapping members
229                 Given I am on the Host details page
230                 And I hover over the "Reporting" button
231                 When I click "Availability"
232                 And I select "LinuxServers" from "objects"
233                 And I select "MixedGroup" from "objects"
234                 Then "objects[]" should have option "LinuxServers"
235                 And "objects[]" should have option "MixedGroup"
236                 When I check "Include pie charts"
237                 And I check "Include trends graph"
238                 And I click "Show report"
239                 Then I should see "Hostgroup breakdown"
240                 And I should see "Summary of LinuxServers"
241                 And I should see "Summary of MixedGroup"
242                 And I should see "Total summary"
243                 And I should see "linux-server1"
244                 And I should see "linux-server2"
245                 And I shouldn't see "win-server1"
246                 And I should see "win-server2"
247                 And I should see "Group availability (Worst state)"
249         @configuration @asmonitor @reports
250         Scenario: Generate single servicegroup report
251                 Given I am on the Host details page
252                 And I hover over the "Reporting" button
253                 When I click "Availability"
254                 And I select "Servicegroups" from "Report type"
255                 And I select "pings" from "objects"
256                 Then "objects[]" should have option "pings"
257                 When I check "Use alias"
258                 And I click "Show report"
259                 Then I should see "Servicegroup breakdown"
260                 And I should see "SGALIAS-p (pings)"
261                 And I should see "Services on host: HALIAS-ls1 (linux-server1)"
262                 And I should see "Services on host: HALIAS-ws1 (win-server1)"
263                 And I should see "Services on host: HALIAS-ws2 (win-server2)"
264                 And I should see "PING"
265                 And I shouldn't see "linux-server2"
266                 And I shouldn't see "System Load"
267                 And I should see "Group availability (Worst state)"
268                 And I shouldn't see "Summary of selected"
269                 And I shouldn't see "Summary of all"
270                 And I shouldn't see "Including soft states"
272         @configuration @asmonitor @reports
273         Scenario: Generate multi servicegroup report
274                 Given I am on the Host details page
275                 And I hover over the "Reporting" button
276                 When I click "Availability"
277                 And I select "Servicegroups" from "Report type"
278                 And I select "pings" from "objects"
279                 And I select "empty" from "objects"
280                 Then "objects[]" should have option "pings"
281                 And "objects[]" should have option "empty"
282                 When I check "Include pie charts"
283                 And I check "Include trends graph"
284                 And I click "Show report"
285                 Then I should see "Servicegroup breakdown"
286                 And I should see "Summary of pings"
287                 And I should see "Summary of empty"
288                 And I should see "Total summary"
289                 And I should see "Services on host: linux-server1"
290                 And I should see "Services on host: win-server1"
291                 And I should see "Services on host: win-server2"
292                 And I should see "PING"
293                 And I shouldn't see "linux-server2"
294                 And I shouldn't see "System Load"
295                 And I should see "Group availability (Worst state)"
297         @configuration @asmonitor @reports
298         Scenario: Generate report on custom report date
299                 Given I am on the Host details page
300                 And I hover over the "Reporting" button
301                 When I click "Availability"
302                 And I select "LinuxServers" from "objects"
303                 Then "objects[]" should have option "LinuxServers"
304                 When I select "Custom" from "Reporting period"
305                 And I enter "2013-01-02" into "Start date"
306                 And I enter "23:31" into "time_start"
307                 And I enter "2013-04-03" into "End date"
308                 And I enter "22:32" into "time_end"
309                 And I select "workhours" from "Report time period"
310                 When I click "Show report"
311                 Then I should see "Hostgroup breakdown"
312                 And I should see "Reporting period: 2013-01-02 23:31:00 to 2013-04-03 22:32:00 - workhours"
314         @configuration @asmonitor @reports
315         Scenario: Generate report on custom report date without time specified
316                 Given I am on the Host details page
317                 And I hover over the "Reporting" button
318                 When I click "Availability"
319                 And I select "LinuxServers" from "objects"
320                 Then "objects[]" should have option "LinuxServers"
321                 When I select "Custom" from "Reporting period"
322                 And I enter "2013-01-02" into "Start date"
323                 And I enter "" into "time_start"
324                 And I enter "2013-04-03" into "End date"
325                 And I enter "" into "time_end"
326                 And I select "workhours" from "Report time period"
327                 When I click "Show report"
328                 Then I should see "Hostgroup breakdown"
329                 And I should see "Reporting period: 2013-01-02 00:00:00 to 2013-04-03 23:59:00 - workhours"
331         @configuration @asmonitor @reports
332         Scenario: Save report with misc options
333                 Given I am on the Host details page
334                 And I hover over the "Reporting" button
335                 When I click "Availability"
336                 Then I shouldn't see "Saved reports"
337                 #And "Saved reports" shouldn't have option "saved test report"
338                 When I select "LinuxServers" from "objects"
339                 Then "objects[]" should have option "LinuxServers"
340                 # Toggle *everything*!
341                 When I select "Last month" from "Reporting period"
342                 And I select "workhours" from "Report time period"
343                 And I check "Down"
344                 And I select "Average" from "SLA calculation method"
345                 And I select "Uptime, with difference" from "Count scheduled downtime as"
346                 And I select "Undetermined" from "Count program downtime as"
347                 And I check "Include soft states"
348                 And I check "Use alias"
349                 And I check "Include trends graph"
350                 And I check "Include pie charts"
351                 And I select "pink_n_fluffy" from "Skin"
352                 And I enter "This is a saved test report" into "Description"
353                 And I click "Show report"
354                 # I don't care where, but I want everything to be visible somehow
355                 Then I should see "Last month"
356                 And I should see "workhours"
357                 And I should see "Showing hosts in state: up, unreachable, pending"
358                 And I should see "Average"
359                 And I shouldn't see "SLA"
360                 And I shouldn't see "Worst"
361                 And I should see "Uptime, with difference"
362                 And I shouldn't see "Counting program downtime"
363                 And I should see "Including soft states"
364                 And I should see "HALIAS-ls1"
365                 And I should see "HALIAS-ls2"
366                 And I should see "HGALIAS-ls"
367                 And I should see "This is a saved test report"
368                 When I click "Save report"
369                 And I enter "saved test report" into "report_name"
370                 And I click "Save report" inside "#save_report_form"
371                 Then I should see "Report was successfully saved"
373         @configuration @asmonitor @reports
374         Scenario: View saved report
375                 Given I am on the Host details page
376                 When I hover over the "Reporting" button
377                 And I click "Availability"
378                 Then I should see "Saved reports"
379                 And "Saved reports" should have option "saved test report"
380                 When I select "saved test report" from "Saved reports"
381                 Then "objects[]" should have option "LinuxServers"
382                 And "Last month" should be selected from "Reporting period"
383                 And "workhours" should be selected from "Report time period"
384                 And "Down" should be checked
385                 And "Average" should be selected from "SLA calculation method"
386                 And "Uptime, with difference" should be selected from "Count scheduled downtime as"
387                 And "Undetermined" should be selected from "Count program downtime as"
388                 And "Include soft states" should be checked
389                 And "Use alias" should be checked
390                 And "Include trends graph" should be checked
391                 And "Include pie charts" should be checked
392                 And "pink_n_fluffy" should be selected from "Skin"
393                 And "Description" should contain "This is a saved test report"
394                 When I click "Show report"
395                 Then I should see "Last month"
396                 And I should see "workhours"
397                 And I should see "Showing hosts in state: up, unreachable, pending"
398                 And I should see "Average"
399                 And I shouldn't see "SLA"
400                 And I shouldn't see "Best"
401                 And I should see "Uptime, with difference"
402                 And I shouldn't see "Counting program downtime"
403                 And I should see "Including soft states"
404                 And I should see "HALIAS-ls1"
405                 And I should see "HALIAS-ls2"
406                 And I should see "HGALIAS-ls"
407                 And I should see "This is a saved test report"
409         @configuration @asmonitor @reports @bug-7646
410         Scenario: Uncheck saved checkbox
411                 Given I am on the Host details page
412                 When I hover over the "Reporting" button
413                 And I click "Availability"
414                 Then I should see "Saved reports"
415                 And "Saved reports" should have option "saved test report"
416                 When I select "saved test report" from "Saved reports"
417                 Then "objects[]" should have option "LinuxServers"
418                 And "Include soft states" should be checked
419                 And "Use alias" should be checked
420                 When I uncheck "Include soft states"
421                 And I click "Show report"
422                 Then I shouldn't see button "Show report"
423                 When I click "Edit settings"
424                 Then "Include soft states" should be unchecked
425                 And "Use alias" should be checked
426                 When I uncheck "Use alias"
427                 And I wait for 1 second
428                 And I click "Show report"
429                 Then I shouldn't see button "Show report"
430                 And I click "Edit settings"
431                 Then "Include soft states" should be unchecked
432                 And "Use alias" should be unchecked
433                 And I wait for 1 second
434                 When I click "Show report"
435                 Then I shouldn't see button "Show report"
436                 And I click "Save report"
437                 And I click "Save report" inside "#save_report_form"
438                 Then I should see "Report was successfully saved"
439                 When I hover over the "Reporting" button
440                 And I click "Availability"
441                 Then I should see "Saved reports"
442                 And "Saved reports" should have option "saved test report"
443                 When I select "saved test report" from "Saved reports"
444                 Then "objects[]" should have option "LinuxServers"
445                 And "Include soft states" should be unchecked
446                 And "Use alias" should be unchecked
448         @configuration @asmonitor @reports
449         Scenario: Delete previously created report
450                 Given I am on the Host details page
451                 And I hover over the "Reporting" button
452                 When I click "Availability"
453                 Then I should see "Saved reports"
454                 And "Saved reports" should have option "saved test report"
455                 When I select "saved test report"
456                 Then "objects[]" should have option "LinuxServers"
457                 When I click "Delete"
458                 # Test available first, to force capybara to wait for page reload
459                 Then "objects" should have option "LinuxServers"
460                 And "Saved reports" shouldn't have option "saved test report"
461                 And "objects[]" shouldn't have option "LinuxServers"