report_options: Syntax fix
[ninja.git] / features / schedule.feature
blob0581bc7661eaba47ac8e2c662ef9e9477d2c9829
1 Feature: Scheduled reports
2         Test that reports can be scheduled, that scheduled can be deleted, that
3         deleting schedules deletes reports...
5         Background:
6                 Given I have these hostgroups configured:
7                         | hostgroup_name |
8                         | LinuxServers   |
9                         | WindowsServers |
10                         | MixedGroup     |
11                         | EmptyGroup     |
12                 And I have these hosts:
13                         | host_name      | host_groups               |
14                         | linux-server1  | LinuxServers,MixedGroup   |
15                         | linux-server2  | LinuxServers              |
16                         | win-server1    | WindowsServers            |
17                         | win-server2    | WindowsServers,MixedGroup |
18                 And I have these servicegroups:
19                         | servicegroup_name | alias                           |
20                         | pings             | ping services plus one non-ping |
21                         | empty             | nothing in here                 |
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                         | Swap Usage          | win-server1   | check_swap      | 1                     | 0                     | pings          |
29                         | PING                | win-server2   | check_ping      | 0                     | 1                     | pings          |
30                 And I have these report data entries:
31                         | timestamp           | event_type | flags | attrib | host_name     | service_description | state | hard | retry | downtime_depth | output |
32                         | 2013-01-01 12:00:00 |        100 |  NULL |   NULL |               |                     |     0 |    0 |     0 |           NULL | NULL                |
33                         | 2013-01-01 12:00:01 |        801 |  NULL |   NULL | win-server1   |                     |     0 |    1 |     1 |           NULL | OK - laa-laa        |
34                         | 2013-01-01 12:00:02 |        801 |  NULL |   NULL | linux-server1 |                     |     0 |    1 |     1 |           NULL | OK - Sven Melander  |
35                         | 2013-01-01 12:00:03 |        701 |  NULL |   NULL | win-server1   | PING                |     0 |    1 |     1 |           NULL | OK - po             |
36                         | 2013-01-01 12:00:04 |        701 |  NULL |   NULL | win-server1   | PING                |     1 |    0 |     1 |           NULL | ERROR - tinky-winky |
37                         | 2013-01-01 12:00:05 |        701 |  NULL |   NULL | win-server1   | Swap Usage          |     1 |    0 |     1 |           NULL | ERROR - out of teletubbies |
38                         | 2013-01-01 12:00:02 |        801 |  NULL |   NULL | linux-server2 |                     |     0 |    1 |     1 |           NULL | PRETTY OK - Jon Skolmen |
40                 And I have activated the configuration
42         @configuration @asmonitor @reports
43         Scenario: Save avail report
44                 Given I am on the Host details page
45                 And I hover over the "Reporting" button
46                 When I click "Availability"
47                 When I select "LinuxServers" from "Available hostgroups"
48                 And I doubleclick "LinuxServers"
49                 Then "Selected hostgroups" should have option "LinuxServers"
50                 When I click "Show report"
51                 Then I should see "Hostgroup breakdown"
52                 And I should see "LinuxServers"
53                 And I should see "linux-server1"
54                 When I click "Save report"
55                 And I enter "saved test report" into "report_name"
56                 And I click "Save report" inside "#save_report_form"
57                 Then I should see "Report was successfully saved"
59         @configuration @asmonitor @reports
60         Scenario: Schedule avail report
61                 Given I am on the Host details page
62                 And I hover over the "Reporting" button
63                 When I click "Schedule Reports"
64                 Then I should see "New Schedule"
65                 And "Availability report" should be selected from "Select report type"
66                 When I select "Weekly" from "Report interval"
67                 And I select "saved test report" from "Select report"
68                 And I enter "dev@op5.com" into "Recipients"
69                 And I enter "This report comes from a cuke test. If the test worked, it would have been deleted, so if you're reading this, you've got work to do to fix tests. Chop, chop!" into "Description"
70                 And I select "Yes" from "Attach description"
71                 And I click "Save"
72                 Then I shouldn't see "There are no scheduled availability reports"
73                 And I should see "saved_test_report_Weekly.pdf"
74                 And I should see "dev@op5.com"
76         @configuration @asmonitor @reports
77         Scenario: View scheduled avail report
78                 Given I am on the Host details page
79                 And I hover over the "Reporting" button
80                 When I click "Schedule Reports"
81                 Then I should see "New Schedule"
82                 And "Availability report" should be selected from "Select report type"
83                 And "Select report" should have option "saved test report"
84                 And I should see "saved_test_report"
85                 When I click "View report" on the row where "Report" is "saved test report"
86                 Then I should see "Hostgroup breakdown"
87                 And I should see "LinuxServers"
88                 And I should see "linux-server1"
90         @configuration @asmonitor @reports
91         Scenario: Add second avail schedule
92                 Given I am on the Host details page
93                 And I hover over the "Reporting" button
94                 When I click "Schedule Reports"
95                 Then I should see "New Schedule"
96                 And "Availability report" should be selected from "Select report type"
97                 And "Weekly" should be selected from "Report interval"
98                 When I select "saved test report" from "Select report"
99                 Then "Filename" should contain "saved_test_report_Weekly.pdf"
100                 When I select "Monthly" from "Report interval"
101                 Then "Filename" should contain "saved_test_report_Monthly.pdf"
102                 When I enter "dev@op5.com" into "Recipients"
103                 And I click "Save"
104                 Then I should see "saved_test_report_Monthly.pdf"
105                 And I shouldn't see " "
106                 # Description comes before persistent path, so that's where we'll click
107                 When I doubleclick "Double click to edit" on the row where "Filename" is "saved_test_report_Monthly.pdf"
108                 And I enter "A description" into "newvalue" on the row where "Filename" is "saved_test_report_Monthly.pdf"
109                 And I click "OK" on the row where "Filename" is "saved_test_report_Monthly.pdf"
110                 Then the "Description" column should be "A description" on the row where "Filename" is "saved_test_report_Monthly.pdf"
112         @configuration @asmonitor @reports
113         Scenario: Delete previously created avail report
114                 Given I am on the Host details page
115                 And I hover over the "Reporting" button
116                 When I click "Availability"
117                 Then I should see "Saved reports"
118                 And "Saved reports" should have option "saved test report"
119                 When I select "saved test report"
120                 Then "Selected hostgroups" should have option "LinuxServers"
121                 When I click "Delete"
122                 # Test available first, to force capybara to wait for page reload
123                 Then "Available hostgroups" should have option "LinuxServers"
124                 And "Saved reports" shouldn't have option "saved test report"
125                 And "Selected hostgroups" shouldn't have option "LinuxServers"
127         @configuration @asmonitor @reports
128         Scenario: Ensure previously added avail schedule is gone
129                 Given I am on the Host details page
130                 And I hover over the "Reporting" button
131                 When I click "Schedule Reports"
132                 Then I should see "New Schedule"
133                 And I shouldn't see "saved_test_report"
134                 And I shouldn't see "saved test report"
135                 And "Select report" shouldn't have option "saved test report"
137         @configuration @asmonitor @reports
138         Scenario: Save SLA report
139                 Given I am on the Host details page
140                 And I hover over the "Reporting" button
141                 When I click "SLA"
142                 When I select "LinuxServers" from "Available hostgroups"
143                 And I doubleclick "LinuxServers"
144                 Then "Selected hostgroups" should have option "LinuxServers"
145                 When I enter "9" into "Jan"
146                 And I click "Show report"
147                 Then I should see "SLA breakdown for: LinuxServers"
148                 And I should see "Group members"
149                 And I should see "linux-server1"
150                 And I should see "linux-server2"
151                 When I click "Save report"
152                 And I enter "saved test report" into "report_name"
153                 And I click "Save report" inside "#save_report_form"
154                 Then I should see "Report was successfully saved"
156         @configuration @asmonitor @reports
157         Scenario: Schedule SLA report
158                 Given I am on the Host details page
159                 And I hover over the "Reporting" button
160                 When I click "Schedule Reports"
161                 Then I should see "New Schedule"
162                 When I select "SLA report" from "Select report type"
163                 Then "Select report" should have option "saved test report" waiting patiently
164                 When I select "saved test report" from "Select report"
165                 And I select "Weekly" from "Report interval"
166                 And I enter "dev@op5.com" into "Recipients"
167                 And I enter "This report comes from a cuke test. If the test worked, it would have been deleted, so if you're reading this, you've got work to do to fix tests. Chop, chop!" into "Description"
168                 And I select "Yes" from "Attach description"
169                 And I click "Save"
170                 Then I shouldn't see "There are no scheduled SLA reports"
171                 And I should see "saved_test_report_Weekly.pdf"
172                 And I should see "dev@op5.com"
174         @configuration @asmonitor @reports
175         Scenario: View scheduled SLA report
176                 Given I am on the Host details page
177                 And I hover over the "Reporting" button
178                 When I click "Schedule Reports"
179                 Then I should see "New Schedule"
180                 When I select "SLA report" from "Select report type"
181                 Then "Select report" should have option "saved test report"
182                 And I should see "saved_test_report"
183                 When I click "View report" on the row where "Report" is "saved test report"
184                 Then I should see "SLA breakdown for: LinuxServers"
185                 And I should see "Group members"
186                 And I should see "linux-server1"
188         @configuration @asmonitor @reports
189         Scenario: Delete SLA schedule
190                 Given I am on the Host details page
191                 And I hover over the "Reporting" button
192                 When I click "Schedule Reports"
193                 Then I should see "New Schedule"
194                 When I select "SLA report" from "Select report type"
195                 Then "Select report" should have option "saved test report"
196                 And I should see "saved_test_report"
197                 When I click "Delete scheduled report" on the row where "Report" is "saved test report"
198                 Then I should see "Schedule deleted"
199                 And I should see "There are no scheduled SLA reports"
200                 When I hover over the "Reporting" button
201                 And I click "Schedule Reports"
202                 And I select "SLA report" from "Select report type"
203                 Then I shouldn't see "saved test report" within "#scheduled_sla_reports"
204                 When I select "SLA report" from "Select report type"
205                 Then "Select report" should have option "saved test report"
207         @configuration @asmonitor @reports
208         Scenario: Delete previously created SLA report
209                 Given I am on the Host details page
210                 And I hover over the "Reporting" button
211                 When I click "SLA"
212                 Then I should see "Saved reports"
213                 And "Saved reports" should have option "saved test report"
214                 When I select "saved test report"
215                 Then "Selected hostgroups" should have option "LinuxServers"
216                 When I click "Delete"
217                 # Test available first, to force capybara to wait for page reload
218                 Then "Available hostgroups" should have option "LinuxServers"
219                 And "Saved reports" shouldn't have option "saved test report"
220                 And "Selected hostgroups" shouldn't have option "LinuxServers"
222         @configuration @asmonitor @reports
223         Scenario: Ensure previously added sla schedule is gone
224                 Given I am on the Host details page
225                 And I hover over the "Reporting" button
226                 When I click "Schedule Reports"
227                 And I select "SLA report" from "Select report type"
228                 Then I should see "New Schedule"
229                 And I shouldn't see "saved_test_report"
230                 And I shouldn't see "saved test report"
231                 And "Select report" shouldn't have option "saved test report"
233         @configuration @asmonitor @reports
234         Scenario: Save summary report
235                 Given I am on the Host details page
236                 And I hover over the "Reporting" button
237                 When I click "Alert Summary"
238                 And I choose "Custom"
239                 And I select "LinuxServers" from "Available hostgroups"
240                 And I doubleclick "LinuxServers"
241                 Then "Selected hostgroups" should have option "LinuxServers"
242                 When I click "Show report"
243                 Then I should see "Top alert producers"
244                 When I click "Save report"
245                 And I enter "saved test report" into "report_name"
246                 And I click "Save report" inside "#save_report_form"
247                 Then I should see "Report was successfully saved"
249         @configuration @asmonitor @reports
250         Scenario: Schedule summary report
251                 Given I am on the Host details page
252                 And I hover over the "Reporting" button
253                 When I click "Schedule Reports"
254                 Then I should see "New Schedule"
255                 When I select "Alert summary report" from "Select report type"
256                 Then "Select report" should have option "saved test report" waiting patiently
257                 When I select "saved test report" from "Select report"
258                 And I select "Weekly" from "Report interval"
259                 And I enter "dev@op5.com" into "Recipients"
260                 And I enter "This report comes from a cuke test. If the test worked, it would have been deleted, so if you're reading this, you've got work to do to fix tests. Chop, chop!" into "Description"
261                 And I select "Yes" from "Attach description"
262                 And I click "Save"
263                 Then I shouldn't see "There are no scheduled alert summary reports"
264                 And I should see "saved_test_report_Weekly.pdf"
265                 And I should see "dev@op5.com"
267         @configuration @asmonitor @reports
268         Scenario: View scheduled summary report
269                 Given I am on the Host details page
270                 And I hover over the "Reporting" button
271                 When I click "Schedule Reports"
272                 Then I should see "New Schedule"
273                 When I select "Alert summary report" from "Select report type"
274                 Then "Select report" should have option "saved test report"
275                 And I should see "saved_test_report"
276                 When I click "View report" on the row where "Report" is "saved test report"
277                 Then I should see "Top alert producers"
279         @configuration @asmonitor @reports
280         Scenario: Delete previously created summary report
281                 Given I am on the Host details page
282                 And I hover over the "Reporting" button
283                 When I click "Alert Summary"
284                 Then I should see "Saved reports"
285                 And "Saved reports" should have option "saved test report"
286                 When I select "saved test report"
287                 Then "Custom" should be checked
288                 And "Selected hostgroups" should have option "LinuxServers"
289                 When I click "Delete"
290                 Then "Saved reports" shouldn't have option "saved test report"
291                 And "Selected hostgroups" shouldn't have option "LinuxServers"
293         @configuration @asmonitor @reports
294         Scenario: Ensure previously added summary schedule is gone
295                 Given I am on the Host details page
296                 And I hover over the "Reporting" button
297                 When I click "Schedule Reports"
298                 Then I should see "New Schedule"
299                 When I select "Alert summary report" from "Select report type"
300                 And I shouldn't see "saved_test_report"
301                 And I shouldn't see "saved test report"
302                 And "Select report" shouldn't have option "saved test report"