1 Feature: Scheduled reports
2 Test that reports can be scheduled, that scheduled can be deleted, that
3 deleting schedules deletes reports...
6 Given I have these hostgroups configured:
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"
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"
104 Then I should see "saved_test_report_Monthly.pdf"
105 And I shouldn't see " "
106 And I shouldn't see "*Scheduled*" on the row where "Filename" is "saved_test_report_Monthly.pdf"
107 # Description comes before persistent path, so that's where we'll click
108 When I doubleclick "Double click to edit" on the row where "Filename" is "saved_test_report_Monthly.pdf"
109 And I enter "A description" into "newvalue" on the row where "Filename" is "saved_test_report_Monthly.pdf"
110 And I click "OK" on the row where "Filename" is "saved_test_report_Monthly.pdf"
111 Then the "Description" column should be "A description" on the row where "Filename" is "saved_test_report_Monthly.pdf"
113 @configuration @asmonitor @reports
114 Scenario: Delete previously created avail report
115 Given I am on the Host details page
116 And I hover over the "Reporting" button
117 When I click "Availability"
118 Then I should see "Saved reports"
119 And "Saved reports" should have option "saved test report ( *Scheduled* )"
120 When I select "saved test report"
121 Then "Selected hostgroups" should have option "LinuxServers"
122 When I click "Delete"
123 # Test available first, to force capybara to wait for page reload
124 Then "Available hostgroups" should have option "LinuxServers"
125 And "Saved reports" shouldn't have option "saved test report"
126 And "Selected hostgroups" shouldn't have option "LinuxServers"
128 @configuration @asmonitor @reports
129 Scenario: Ensure previously added avail schedule is gone
130 Given I am on the Host details page
131 And I hover over the "Reporting" button
132 When I click "Schedule Reports"
133 Then I should see "New Schedule"
134 And I shouldn't see "saved_test_report"
135 And I shouldn't see "saved test report"
136 And "Select report" shouldn't have option "saved test report"
138 @configuration @asmonitor @reports
139 Scenario: Save SLA report
140 Given I am on the Host details page
141 And I hover over the "Reporting" button
143 When I select "LinuxServers" from "Available hostgroups"
144 And I doubleclick "LinuxServers"
145 Then "Selected hostgroups" should have option "LinuxServers"
146 When I enter "9" into "Jan"
147 And I click "Show report"
148 Then I should see "SLA breakdown for: LinuxServers"
149 And I should see "Group members"
150 And I should see "linux-server1"
151 And I should see "linux-server2"
152 When I click "Save report"
153 And I enter "saved test report" into "report_name"
154 And I click "Save report" inside "#save_report_form"
155 Then I should see "Report was successfully saved"
157 @configuration @asmonitor @reports
158 Scenario: Schedule SLA report
159 Given I am on the Host details page
160 And I hover over the "Reporting" button
161 When I click "Schedule Reports"
162 Then I should see "New Schedule"
163 When I select "SLA report" from "Select report type"
164 Then "Select report" should have option "saved test report" waiting patiently
165 When I select "saved test report" from "Select report"
166 And I select "Weekly" from "Report interval"
167 And I enter "dev@op5.com" into "Recipients"
168 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"
169 And I select "Yes" from "Attach description"
171 Then I shouldn't see "There are no scheduled SLA reports"
172 And I should see "saved_test_report_Weekly.pdf"
173 And I should see "dev@op5.com"
175 @configuration @asmonitor @reports
176 Scenario: View scheduled SLA report
177 Given I am on the Host details page
178 And I hover over the "Reporting" button
179 When I click "Schedule Reports"
180 Then I should see "New Schedule"
181 When I select "SLA report" from "Select report type"
182 Then "Select report" should have option "saved test report"
183 And I should see "saved_test_report"
184 When I click "View report" on the row where "Report" is "saved test report"
185 Then I should see "SLA breakdown for: LinuxServers"
186 And I should see "Group members"
187 And I should see "linux-server1"
189 @configuration @asmonitor @reports
190 Scenario: Delete SLA schedule
191 Given I am on the Host details page
192 And I hover over the "Reporting" button
193 When I click "Schedule Reports"
194 Then I should see "New Schedule"
195 When I select "SLA report" from "Select report type"
196 Then "Select report" should have option "saved test report"
197 And I should see "saved_test_report"
198 When I click "Delete scheduled report" on the row where "Report" is "saved test report"
199 Then I should see "Schedule deleted"
200 And I should see "There are no scheduled SLA reports"
201 When I hover over the "Reporting" button
202 And I click "Schedule Reports"
203 And I select "SLA report" from "Select report type"
204 Then I shouldn't see "saved test report" within "#scheduled_sla_reports"
205 When I select "SLA report" from "Select report type"
206 Then "Select report" should have option "saved test report"
208 @configuration @asmonitor @reports
209 Scenario: Delete previously created SLA report
210 Given I am on the Host details page
211 And I hover over the "Reporting" button
213 Then I should see "Saved reports"
214 And "Saved reports" should have option "saved test report"
215 When I select "saved test report"
216 Then "Selected hostgroups" should have option "LinuxServers"
217 When I click "Delete"
218 # Test available first, to force capybara to wait for page reload
219 Then "Available hostgroups" should have option "LinuxServers"
220 And "Saved reports" shouldn't have option "saved test report"
221 And "Selected hostgroups" shouldn't have option "LinuxServers"
223 @configuration @asmonitor @reports
224 Scenario: Ensure previously added sla schedule is gone
225 Given I am on the Host details page
226 And I hover over the "Reporting" button
227 When I click "Schedule Reports"
228 And I select "SLA report" from "Select report type"
229 Then I should see "New Schedule"
230 And I shouldn't see "saved_test_report"
231 And I shouldn't see "saved test report"
232 And "Select report" shouldn't have option "saved test report"
234 @configuration @asmonitor @reports
235 Scenario: Save summary report
236 Given I am on the Host details page
237 And I hover over the "Reporting" button
238 When I click "Alert Summary"
239 And I choose "Custom"
240 And I select "LinuxServers" from "Available hostgroups"
241 And I doubleclick "LinuxServers"
242 Then "Selected hostgroups" should have option "LinuxServers"
243 When I click "Show report"
244 Then I should see "Top alert producers"
245 When I click "Save report"
246 And I enter "saved test report" into "report_name"
247 And I click "Save report" inside "#save_report_form"
248 Then I should see "Report was successfully saved"
250 @configuration @asmonitor @reports
251 Scenario: Schedule summary report
252 Given I am on the Host details page
253 And I hover over the "Reporting" button
254 When I click "Schedule Reports"
255 Then I should see "New Schedule"
256 When I select "Alert summary report" from "Select report type"
257 Then "Select report" should have option "saved test report" waiting patiently
258 When I select "saved test report" from "Select report"
259 And I select "Weekly" from "Report interval"
260 And I enter "dev@op5.com" into "Recipients"
261 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"
262 And I select "Yes" from "Attach description"
264 Then I shouldn't see "There are no scheduled alert summary reports"
265 And I should see "saved_test_report_Weekly.pdf"
266 And I should see "dev@op5.com"
268 @configuration @asmonitor @reports
269 Scenario: View scheduled summary report
270 Given I am on the Host details page
271 And I hover over the "Reporting" button
272 When I click "Schedule Reports"
273 Then I should see "New Schedule"
274 When I select "Alert summary report" from "Select report type"
275 Then "Select report" should have option "saved test report"
276 And I should see "saved_test_report"
277 When I click "View report" on the row where "Report" is "saved test report"
278 Then I should see "Top alert producers"
280 @configuration @asmonitor @reports
281 Scenario: Delete previously created summary report
282 Given I am on the Host details page
283 And I hover over the "Reporting" button
284 When I click "Alert Summary"
285 Then I should see "Saved reports"
286 And "Saved reports" should have option "saved test report ( *Scheduled* )"
287 When I select "saved test report"
288 Then "Custom" should be checked
289 And "Selected hostgroups" should have option "LinuxServers"
290 When I click "Delete"
291 Then "Saved reports" shouldn't have option "saved test report"
292 And "Selected hostgroups" shouldn't have option "LinuxServers"
294 @configuration @asmonitor @reports
295 Scenario: Ensure previously added summary schedule is gone
296 Given I am on the Host details page
297 And I hover over the "Reporting" button
298 When I click "Schedule Reports"
299 Then I should see "New Schedule"
300 When I select "Alert summary report" from "Select report type"
301 And I shouldn't see "saved_test_report"
302 And I shouldn't see "saved test report"
303 And "Select report" shouldn't have option "saved test report"