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 the multiselect "objects"
48 Then "objects[]" should have option "LinuxServers"
49 When I click "Show report"
50 Then I should see "Hostgroup breakdown"
51 And I should see "LinuxServers"
52 And I should see "linux-server1"
53 When I click "Save report"
54 And I enter "saved test report" into "report_name"
55 And I click "Save report" inside "#save_report_form"
56 Then I should see "Report was successfully saved"
58 @configuration @asmonitor @reports
59 Scenario: Schedule avail report
60 Given I am on the Host details page
61 And I hover over the "Reporting" button
62 When I click "Schedule Reports"
63 Then I should see "New Schedule"
64 And "Availability reports" should be selected from "Select report type"
65 When I select "Weekly" from "Report interval"
66 And I select "saved test report" from "Select report"
67 And I enter "dev@op5.com" into "Recipients"
68 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"
69 And I select "Yes" from "Attach description"
71 Then I shouldn't see "There are no scheduled availability reports"
72 And I should see "saved_test_report_Weekly.pdf"
73 And I should see "dev@op5.com"
75 @configuration @asmonitor @reports
76 Scenario: View scheduled avail report
77 Given I am on the Host details page
78 And I hover over the "Reporting" button
79 When I click "Schedule Reports"
80 Then I should see "New Schedule"
81 And "Availability reports" should be selected from "Select report type"
82 And "Select report" should have option "saved test report"
83 And I should see "saved_test_report"
84 When I click "View report" on the row where "Report" is "saved test report"
85 Then I should see "Hostgroup breakdown"
86 And I should see "LinuxServers"
87 And I should see "linux-server1"
89 @configuration @asmonitor @reports
90 Scenario: Add second avail schedule
91 Given I am on the Host details page
92 And I hover over the "Reporting" button
93 When I click "Schedule Reports"
94 Then I should see "New Schedule"
95 And "Availability reports" should be selected from "Select report type"
96 And "Weekly" should be selected from "Report interval"
97 When I select "saved test report" from "Select report"
98 Then "Filename" should contain "saved_test_report_Weekly.pdf"
99 When I select "Monthly" from "Report interval"
100 Then "Filename" should contain "saved_test_report_Monthly.pdf"
101 When I enter "dev@op5.com" into "Recipients"
103 Then I should see "saved_test_report_Monthly.pdf"
104 And I shouldn't see " "
105 # Description comes before persistent path, so that's where we'll click
106 When I doubleclick "Double click to edit" on the row where "Filename" is "saved_test_report_Monthly.pdf"
107 And I enter "A description" into "newvalue" on the row where "Filename" is "saved_test_report_Monthly.pdf"
108 And I click "OK" on the row where "Filename" is "saved_test_report_Monthly.pdf"
109 Then the "Description" column should be "A description" on the row where "Filename" is "saved_test_report_Monthly.pdf"
111 @configuration @asmonitor @reports
112 Scenario: Delete previously created avail report
113 Given I am on the Host details page
114 And I hover over the "Reporting" button
115 When I click "Availability"
116 Then I should see "Saved reports"
117 And "Saved reports" should have option "saved test report"
118 When I select "saved test report"
119 Then "objects[]" should have option "LinuxServers"
120 When I click "Delete"
121 # Test available first, to force capybara to wait for page reload
122 Then "objects" should have option "LinuxServers"
123 And "Saved reports" shouldn't have option "saved test report"
124 And "objects[]" shouldn't have option "LinuxServers"
126 @configuration @asmonitor @reports
127 Scenario: Ensure previously added avail schedule is gone
128 Given I am on the Host details page
129 And I hover over the "Reporting" button
130 When I click "Schedule Reports"
131 Then I should see "New Schedule"
132 And I shouldn't see "saved_test_report"
133 And I shouldn't see "saved test report"
134 And "Select report" shouldn't have option "saved test report"
136 @configuration @asmonitor @reports
137 Scenario: Save SLA report
138 Given I am on the Host details page
139 And I hover over the "Reporting" button
141 When I select "LinuxServers" from the multiselect "objects"
142 Then "objects[]" should have option "LinuxServers"
143 When I enter "9" into "Jan"
144 And I click "Show report"
145 Then I should see "SLA breakdown for: LinuxServers"
146 And I should see "Group members"
147 And I should see "linux-server1"
148 And I should see "linux-server2"
149 When I click "Save report"
150 And I enter "saved test report" into "report_name"
151 And I click "Save report" inside "#save_report_form"
152 Then I should see "Report was successfully saved"
154 @configuration @asmonitor @reports
155 Scenario: Schedule SLA report
156 Given I am on the Host details page
157 And I hover over the "Reporting" button
158 When I click "Schedule Reports"
159 Then I should see "New Schedule"
160 When I select "SLA report" from "Select report type"
161 Then "Select report" should have option "saved test report" waiting patiently
162 When I select "saved test report" from "Select report"
163 And I select "Weekly" from "Report interval"
164 And I enter "dev@op5.com" into "Recipients"
165 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"
166 And I select "Yes" from "Attach description"
168 Then I shouldn't see "There are no scheduled SLA reports"
169 And I should see "saved_test_report_Weekly.pdf"
170 And I should see "dev@op5.com"
172 @configuration @asmonitor @reports
173 Scenario: View scheduled SLA report
174 Given I am on the Host details page
175 And I hover over the "Reporting" button
176 When I click "Schedule Reports"
177 Then I should see "New Schedule"
178 When I select "SLA report" from "Select report type"
179 Then "Select report" should have option "saved test report"
180 And I should see "saved_test_report"
181 When I click "View report" on the row where "Report" is "saved test report"
182 Then I should see "SLA breakdown for: LinuxServers"
183 And I should see "Group members"
184 And I should see "linux-server1"
186 @configuration @asmonitor @reports
187 Scenario: Delete SLA schedule
188 Given I am on the Host details page
189 And I hover over the "Reporting" button
190 When I click "Schedule Reports"
191 Then I should see "New Schedule"
192 When I select "SLA report" from "Select report type"
193 Then "Select report" should have option "saved test report"
194 And I should see "saved_test_report"
195 When I click "Delete scheduled report" on the row where "Report" is "saved test report"
196 Then I should see "Schedule deleted"
197 And I should see "There are no scheduled SLA reports"
198 When I hover over the "Reporting" button
199 And I click "Schedule Reports"
200 And I select "SLA report" from "Select report type"
201 Then I shouldn't see "saved test report" within "#scheduled_sla_reports"
202 When I select "SLA report" from "Select report type"
203 Then "Select report" should have option "saved test report"
205 @configuration @asmonitor @reports
206 Scenario: Delete previously created SLA report
207 Given I am on the Host details page
208 And I hover over the "Reporting" button
210 Then I should see "Saved reports"
211 And "Saved reports" should have option "saved test report"
212 When I select "saved test report"
213 Then "objects[]" should have option "LinuxServers"
214 When I click "Delete"
215 # Test available first, to force capybara to wait for page reload
216 Then "objects" should have option "LinuxServers"
217 And "Saved reports" shouldn't have option "saved test report"
218 And "objects[]" shouldn't have option "LinuxServers"
220 @configuration @asmonitor @reports
221 Scenario: Ensure previously added sla schedule is gone
222 Given I am on the Host details page
223 And I hover over the "Reporting" button
224 When I click "Schedule Reports"
225 And I select "SLA report" from "Select report type"
226 Then I should see "New Schedule"
227 And I shouldn't see "saved_test_report"
228 And I shouldn't see "saved test report"
229 And "Select report" shouldn't have option "saved test report"
231 @configuration @asmonitor @reports
232 Scenario: Save summary report
233 Given I am on the Host details page
234 And I hover over the "Reporting" button
235 When I click "Alert Summary"
236 And I choose "Custom"
237 And I select "LinuxServers" from the multiselect "objects"
238 Then "objects[]" should have option "LinuxServers"
239 When I click "Show report"
240 Then I should see "Top alert producers"
241 When I click "Save report"
242 And I enter "saved test report" into "report_name"
243 And I click "Save report" inside "#save_report_form"
244 Then I should see "Report was successfully saved"
246 @configuration @asmonitor @reports
247 Scenario: Schedule summary report
248 Given I am on the Host details page
249 And I hover over the "Reporting" button
250 When I click "Schedule Reports"
251 Then I should see "New Schedule"
252 When I select "Alert Summary Report" from "Select report type"
253 Then "Select report" should have option "saved test report" waiting patiently
254 When I select "saved test report" from "Select report"
255 And I select "Weekly" from "Report interval"
256 And I enter "dev@op5.com" into "Recipients"
257 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"
258 And I select "Yes" from "Attach description"
260 Then I shouldn't see "There are no scheduled alert summary reports"
261 And I should see "saved_test_report_Weekly.pdf"
262 And I should see "dev@op5.com"
264 @configuration @asmonitor @reports
265 Scenario: View scheduled summary report
266 Given I am on the Host details page
267 And I hover over the "Reporting" button
268 When I click "Schedule Reports"
269 Then I should see "New Schedule"
270 When I select "Alert Summary Report" from "Select report type"
271 Then "Select report" should have option "saved test report"
272 And I should see "saved_test_report"
273 When I click "View report" on the row where "Report" is "saved test report"
274 Then I should see "Top alert producers"
276 @configuration @asmonitor @reports
277 Scenario: Delete previously created summary report
278 Given I am on the Host details page
279 And I hover over the "Reporting" button
280 When I click "Alert Summary"
281 Then I should see "Saved reports"
282 And "Saved reports" should have option "saved test report"
283 When I select "saved test report"
284 Then "Custom" should be checked
285 And "objects[]" should have option "LinuxServers"
286 When I click "Delete"
287 Then "Saved reports" shouldn't have option "saved test report"
288 And "objects[]" shouldn't have option "LinuxServers"
290 @configuration @asmonitor @reports
291 Scenario: Ensure previously added summary schedule is gone
292 Given I am on the Host details page
293 And I hover over the "Reporting" button
294 When I click "Schedule Reports"
295 Then I should see "New Schedule"
296 When I select "Alert Summary Report" from "Select report type"
297 And I shouldn't see "saved_test_report"
298 And I shouldn't see "saved test report"
299 And "Select report" shouldn't have option "saved test report"