From e8b3fb84d6a3300b3693b994873009fd6fdc6500 Mon Sep 17 00:00:00 2001 From: Tobias Sjondin Date: Tue, 8 Jul 2014 14:36:51 +0200 Subject: [PATCH] Updated testing for filter selects in reports Added multiselect step_definition Change-Id: I380076346155c7eb64154fb5efc6e184c5c2a9d4 Signed-off-by: Tobias Sjondin --- features/availability.feature | 125 ++++++++++++++------------------- features/histogram.feature | 115 +++++++++++++------------------ features/schedule.feature | 31 ++++----- features/sla.feature | 134 +++++++++++++++--------------------- features/step_definitions/status.rb | 16 +++++ 5 files changed, 184 insertions(+), 237 deletions(-) diff --git a/features/availability.feature b/features/availability.feature index e268c5e72..8e96919e4 100644 --- a/features/availability.feature +++ b/features/availability.feature @@ -50,9 +50,8 @@ Feature: Availability reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - And I select "EmptyGroup" from "Available hostgroups" - And I doubleclick "EmptyGroup" - Then "Selected hostgroups" should have option "EmptyGroup" + And I select "EmptyGroup" from the multiselect "objects" + Then "objects[]" should have option "EmptyGroup" When I click "Show report" Then I should see "The groups you selected (EmptyGroup) had no members, so cannot create a report from them" And I should see "Report Settings" @@ -63,9 +62,8 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Servicegroups" from "Report type" - And I select "empty" from "Available servicegroups" - And I doubleclick "empty" - Then "Selected servicegroups" should have option "empty" + And I select "empty" from "objects" + Then "objects[]" should have option "empty" When I click "Show report" Then I should see "The groups you selected (empty) had no members, so cannot create a report from them" And I should see "Report Settings" @@ -76,15 +74,14 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Hosts" from "Report type" - And I select "linux-server1" from "Available hosts" - And I doubleclick "linux-server1" - Then "Selected hosts" should have option "linux-server1" + And I select "linux-server1" from "objects" + Then "objects[]" should have option "linux-server1" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" Then I should see "Host details for linux-server1" - And I should see "Selected services" - And I shouldn't see "Selected hosts" + And I should see "objects[]" + And I shouldn't see "objects[]" And I should see "PING" And I shouldn't see "linux-server2" And I shouldn't see "win-server1" @@ -100,18 +97,16 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Hosts" from "Report type" - And I select "linux-server1" from "Available hosts" - And I doubleclick "linux-server1" - And I select "win-server1" from "Available hosts" - And I doubleclick "win-server1" - Then "Selected hosts" should have option "linux-server1" - And "Selected hosts" should have option "win-server1" + And I select "linux-server1" from "objects" + And I select "win-server1" from "objects" + Then "objects[]" should have option "linux-server1" + And "objects[]" should have option "win-server1" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" Then I should see "Host state breakdown" - And I should see "Selected hosts" - And I shouldn't see "Selected services" + And I should see "objects[]" + And I shouldn't see "objects[]" And I should see "linux-server1" And I should see "win-server1" And I shouldn't see "linux-server2" @@ -128,9 +123,8 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - Then "Selected services" should have option "linux-server1;PING" + And I select "linux-server1;PING" from "objects" + Then "objects[]" should have option "linux-server1;PING" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" @@ -146,12 +140,10 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - And I select "linux-server1;System Load" from "Available services" - And I doubleclick "linux-server1;System Load" - Then "Selected services" should have option "linux-server1;PING" - And "Selected services" should have option "linux-server1;System Load" + And I select "linux-server1;PING" from "objects" + And I select "linux-server1;System Load" from "objects" + Then "objects[]" should have option "linux-server1;PING" + And "objects[]" should have option "linux-server1;System Load" When I check "Use alias" And I click "Show report" Then I should see "Service state breakdown" @@ -172,12 +164,10 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - And I select "linux-server2;System Load" from "Available services" - And I doubleclick "linux-server2;System Load" - Then "Selected services" should have option "linux-server1;PING" - And "Selected services" should have option "linux-server2;System Load" + And I select "linux-server1;PING" from "objects" + And I select "linux-server2;System Load" from "objects" + Then "objects[]" should have option "linux-server1;PING" + And "objects[]" should have option "linux-server2;System Load" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" @@ -198,9 +188,8 @@ Feature: Availability reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from "objects" + Then "objects[]" should have option "LinuxServers" When I check "Use alias" And I click "Show report" Then I should see "Hostgroup breakdown" @@ -218,12 +207,10 @@ Feature: Availability reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - And I select "WindowsServers" from "Available hostgroups" - And I doubleclick "WindowsServers" - Then "Selected hostgroups" should have option "LinuxServers" - And "Selected hostgroups" should have option "WindowsServers" + And I select "LinuxServers" from "objects" + And I select "WindowsServers" from "objects" + Then "objects[]" should have option "LinuxServers" + And "objects[]" should have option "WindowsServers" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" @@ -242,12 +229,10 @@ Feature: Availability reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - And I select "MixedGroup" from "Available hostgroups" - And I doubleclick "MixedGroup" - Then "Selected hostgroups" should have option "LinuxServers" - And "Selected hostgroups" should have option "MixedGroup" + And I select "LinuxServers" from "objects" + And I select "MixedGroup" from "objects" + Then "objects[]" should have option "LinuxServers" + And "objects[]" should have option "MixedGroup" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" @@ -267,9 +252,8 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Servicegroups" from "Report type" - And I select "pings" from "Available servicegroups" - And I doubleclick "pings" - Then "Selected servicegroups" should have option "pings" + And I select "pings" from "objects" + Then "objects[]" should have option "pings" When I check "Use alias" And I click "Show report" Then I should see "Servicegroup breakdown" @@ -291,12 +275,10 @@ Feature: Availability reports And I hover over the "Reporting" button When I click "Availability" And I select "Servicegroups" from "Report type" - And I select "pings" from "Available servicegroups" - And I doubleclick "pings" - And I select "empty" from "Available servicegroups" - And I doubleclick "empty" - Then "Selected servicegroups" should have option "pings" - And "Selected servicegroups" should have option "empty" + And I select "pings" from "objects" + And I select "empty" from "objects" + Then "objects[]" should have option "pings" + And "objects[]" should have option "empty" When I check "Include pie charts" And I check "Include trends graph" And I click "Show report" @@ -317,9 +299,8 @@ Feature: Availability reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from "objects" + Then "objects[]" should have option "LinuxServers" When I select "Custom" from "Reporting period" And I enter "2013-01-02" into "Start date" And I enter "23:31" into "time_start" @@ -335,9 +316,8 @@ Feature: Availability reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from "objects" + Then "objects[]" should have option "LinuxServers" When I select "Custom" from "Reporting period" And I enter "2013-01-02" into "Start date" And I enter "" into "time_start" @@ -355,9 +335,8 @@ Feature: Availability reports When I click "Availability" Then I shouldn't see "Saved reports" #And "Saved reports" shouldn't have option "saved test report" - When I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + When I select "LinuxServers" from "objects" + Then "objects[]" should have option "LinuxServers" # Toggle *everything*! When I select "Last month" from "Reporting period" And I select "workhours" from "Report time period" @@ -399,7 +378,7 @@ Feature: Availability reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" And "Last month" should be selected from "Reporting period" And "workhours" should be selected from "Report time period" And "Down" should be checked @@ -435,7 +414,7 @@ Feature: Availability reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" And "Include soft states" should be checked And "Use alias" should be checked When I uncheck "Include soft states" @@ -462,7 +441,7 @@ Feature: Availability reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" And "Include soft states" should be unchecked And "Use alias" should be unchecked @@ -474,9 +453,9 @@ Feature: Availability reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" When I click "Delete" # Test available first, to force capybara to wait for page reload - Then "Available hostgroups" should have option "LinuxServers" + Then "objects" should have option "LinuxServers" And "Saved reports" shouldn't have option "saved test report" - And "Selected hostgroups" shouldn't have option "LinuxServers" + And "objects[]" shouldn't have option "LinuxServers" diff --git a/features/histogram.feature b/features/histogram.feature index bbffbaf3d..89df8536c 100644 --- a/features/histogram.feature +++ b/features/histogram.feature @@ -45,14 +45,13 @@ Feature: Histogram reports Then I should see "Please select what objects to base the report on" And I should see "Report Settings" - @configuration @asmonitor @reports + @configuration @asmonitor @reports Scenario: Generate report on empty hostgroup Given I am on the Host details page And I hover over the "Reporting" button When I click "Histogram" - And I select "EmptyGroup" from "Available hostgroups" - And I doubleclick "EmptyGroup" - Then "Selected hostgroups" should have option "EmptyGroup" + And I select "EmptyGroup" from the multiselect "objects" + Then "objects[]" should have option "EmptyGroup" When I click "Show report" Then I should see "The groups you selected (EmptyGroup) had no members, so cannot create a report from them" And I should see "Report Settings" @@ -63,9 +62,8 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Servicegroups" from "Report type" - And I select "empty" from "Available servicegroups" - And I doubleclick "empty" - Then "Selected servicegroups" should have option "empty" + And I select "empty" from the multiselect "objects" + Then "objects[]" should have option "empty" When I click "Show report" Then I should see "The groups you selected (empty) had no members, so cannot create a report from them" And I should see "Report Settings" @@ -76,9 +74,8 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Hosts" from "Report type" - And I select "linux-server1" from "Available hosts" - And I doubleclick "linux-server1" - Then "Selected hosts" should have option "linux-server1" + And I select "linux-server1" from the multiselect "objects" + Then "objects" should have option "linux-server1" When I select "Hard states" from "State types to graph" And I select "Day of month" from "Statistics breakdown" And I select "This year" from "Reporting period" @@ -94,12 +91,10 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Hosts" from "Report type" - And I select "linux-server1" from "Available hosts" - And I doubleclick "linux-server1" - And I select "win-server1" from "Available hosts" - And I doubleclick "win-server1" - Then "Selected hosts" should have option "linux-server1" - And "Selected hosts" should have option "win-server1" + And I select "linux-server1" from the multiselect "objects" + And I select "win-server1" from the multiselect "objects" + Then "objects[]" should have option "linux-server1" + And "objects[]" should have option "win-server1" When I select "Monthly" from "Statistics breakdown" And I click "Show report" Then I should see "Alert histogram" @@ -113,9 +108,8 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - Then "Selected services" should have option "linux-server1;PING" + And I select "linux-server1;PING" from the multiselect "objects" + Then "objects[]" should have option "linux-server1;PING" When I click "Show report" Then I should see "Alert histogram" And I should see "Included services" @@ -128,12 +122,10 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - And I select "linux-server1;System Load" from "Available services" - And I doubleclick "linux-server1;System Load" - Then "Selected services" should have option "linux-server1;PING" - And "Selected services" should have option "linux-server1;System Load" + And I select "linux-server1;PING" from the multiselect "objects" + And I select "linux-server1;System Load" from the multiselect "objects" + Then "objects[]" should have option "linux-server1;PING" + And "objects[]" should have option "linux-server1;System Load" When I select "Day of week" from "Statistics breakdown" And I check "Ignore repeated states" And I click "Show report" @@ -150,12 +142,10 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - And I select "linux-server2;System Load" from "Available services" - And I doubleclick "linux-server2;System Load" - Then "Selected services" should have option "linux-server1;PING" - And "Selected services" should have option "linux-server2;System Load" + And I select "linux-server1;PING" from the multiselect "objects" + And I select "linux-server2;System Load" from the multiselect "objects" + Then "objects[]" should have option "linux-server1;PING" + And "objects[]" should have option "linux-server2;System Load" When I click "Show report" Then I should see "Alert histogram" And I should see "Included services" @@ -167,9 +157,8 @@ Feature: Histogram reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Histogram" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I click "Show report" Then I should see "Alert histogram" And I should see "Included hosts" @@ -181,12 +170,10 @@ Feature: Histogram reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Histogram" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - And I select "WindowsServers" from "Available hostgroups" - And I doubleclick "WindowsServers" - Then "Selected hostgroups" should have option "LinuxServers" - And "Selected hostgroups" should have option "WindowsServers" + And I select "LinuxServers" from the multiselect "objects" + And I select "WindowsServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" + And "objects[]" should have option "WindowsServers" When I click "Show report" Then I should see "Alert histogram" And I should see "Included hosts" @@ -199,12 +186,10 @@ Feature: Histogram reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Histogram" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - And I select "MixedGroup" from "Available hostgroups" - And I doubleclick "MixedGroup" - Then "Selected hostgroups" should have option "LinuxServers" - And "Selected hostgroups" should have option "MixedGroup" + And I select "LinuxServers" from the multiselect "objects" + And I select "MixedGroup" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" + And "objects[]" should have option "MixedGroup" When I click "Show report" Then I should see "Alert histogram" And I should see "Included hosts" @@ -218,9 +203,8 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Servicegroups" from "Report type" - And I select "pings" from "Available servicegroups" - And I doubleclick "pings" - Then "Selected servicegroups" should have option "pings" + And I select "pings" from the multiselect "objects" + Then "objects[]" should have option "pings" When I click "Show report" Then I should see "Alert histogram" And I should see "Included services" @@ -232,12 +216,10 @@ Feature: Histogram reports And I hover over the "Reporting" button When I click "Histogram" And I select "Servicegroups" from "Report type" - And I select "pings" from "Available servicegroups" - And I doubleclick "pings" - And I select "empty" from "Available servicegroups" - And I doubleclick "empty" - Then "Selected servicegroups" should have option "pings" - And "Selected servicegroups" should have option "empty" + And I select "pings" from the multiselect "objects" + And I select "empty" from the multiselect "objects" + Then "objects[]" should have option "pings" + And "objects[]" should have option "empty" When I click "Show report" Then I should see "Alert histogram" And I should see "Included services" @@ -248,9 +230,8 @@ Feature: Histogram reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Histogram" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I select "Custom" from "Reporting period" And I enter "2013-01-02" into "Start date" And I enter "23:31" into "time_start" @@ -265,9 +246,8 @@ Feature: Histogram reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Histogram" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I select "Custom" from "Reporting period" And I enter "2013-01-02" into "Start date" And I enter "" into "time_start" @@ -284,9 +264,8 @@ Feature: Histogram reports When I click "Histogram" Then I shouldn't see "Saved reports" #And "Saved reports" shouldn't have option "saved test report" - When I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + When I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" # Toggle *everything*! When I select "Last month" from "Reporting period" And I select "Day of week" from "Statistics breakdown" @@ -312,7 +291,7 @@ Feature: Histogram reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" And "Last month" should be selected from "Reporting period" And "Day of week" should be selected from "Statistics breakdown" And "Soft states" should be selected from "State types to graph" @@ -332,9 +311,9 @@ Feature: Histogram reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" When I click "Delete" # Test available first, to force capybara to wait for page reload - Then "Available hostgroups" should have option "LinuxServers" + Then "objects" should have option "LinuxServers" And "Saved reports" shouldn't have option "saved test report" - And "Selected hostgroups" shouldn't have option "LinuxServers" + And "objects[]" shouldn't have option "LinuxServers" diff --git a/features/schedule.feature b/features/schedule.feature index da2d23aca..b7ef14ed7 100644 --- a/features/schedule.feature +++ b/features/schedule.feature @@ -44,9 +44,8 @@ Feature: Scheduled reports Given I am on the Host details page And I hover over the "Reporting" button When I click "Availability" - When I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + When I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I click "Show report" Then I should see "Hostgroup breakdown" And I should see "LinuxServers" @@ -117,12 +116,12 @@ Feature: Scheduled reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" When I click "Delete" # Test available first, to force capybara to wait for page reload - Then "Available hostgroups" should have option "LinuxServers" + Then "objects" should have option "LinuxServers" And "Saved reports" shouldn't have option "saved test report" - And "Selected hostgroups" shouldn't have option "LinuxServers" + And "objects[]" shouldn't have option "LinuxServers" @configuration @asmonitor @reports Scenario: Ensure previously added avail schedule is gone @@ -139,9 +138,8 @@ Feature: Scheduled reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - When I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + When I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I enter "9" into "Jan" And I click "Show report" Then I should see "SLA breakdown for: LinuxServers" @@ -212,12 +210,12 @@ Feature: Scheduled reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" When I click "Delete" # Test available first, to force capybara to wait for page reload - Then "Available hostgroups" should have option "LinuxServers" + Then "objects" should have option "LinuxServers" And "Saved reports" shouldn't have option "saved test report" - And "Selected hostgroups" shouldn't have option "LinuxServers" + And "objects[]" shouldn't have option "LinuxServers" @configuration @asmonitor @reports Scenario: Ensure previously added sla schedule is gone @@ -236,9 +234,8 @@ Feature: Scheduled reports And I hover over the "Reporting" button When I click "Alert Summary" And I choose "Custom" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I click "Show report" Then I should see "Top alert producers" When I click "Save report" @@ -285,10 +282,10 @@ Feature: Scheduled reports And "Saved reports" should have option "saved test report" When I select "saved test report" Then "Custom" should be checked - And "Selected hostgroups" should have option "LinuxServers" + And "objects[]" should have option "LinuxServers" When I click "Delete" Then "Saved reports" shouldn't have option "saved test report" - And "Selected hostgroups" shouldn't have option "LinuxServers" + And "objects[]" shouldn't have option "LinuxServers" @configuration @asmonitor @reports Scenario: Ensure previously added summary schedule is gone diff --git a/features/sla.feature b/features/sla.feature index d5aa5f9de..66ad63de7 100644 --- a/features/sla.feature +++ b/features/sla.feature @@ -52,9 +52,8 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "EmptyGroup" from "Available hostgroups" - And I doubleclick "EmptyGroup" - Then "Selected hostgroups" should have option "EmptyGroup" + And I select "EmptyGroup" from the multiselect "objects" + Then "objects[]" should have option "EmptyGroup" When I enter "9" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -68,9 +67,8 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Servicegroups" from "Report type" - And I select "empty" from "Available servicegroups" - And I doubleclick "empty" - Then "Selected servicegroups" should have option "empty" + And I select "empty" from the multiselect "objects" + Then "objects[]" should have option "empty" When I enter "9" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -82,9 +80,8 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I click "Show report" Then I should see "Please enter at least one SLA value" And I should see "Report Settings" @@ -95,9 +92,8 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Hosts" from "Report type" - And I select "linux-server1" from "Available hosts" - And I doubleclick "linux-server1" - Then "Selected hosts" should have option "linux-server1" + And I select "linux-server1" from the multiselect "objects" + Then "objects[]" should have option "linux-server1" When I enter "9" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -114,12 +110,10 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Hosts" from "Report type" - And I select "linux-server1" from "Available hosts" - And I doubleclick "linux-server1" - And I select "win-server1" from "Available hosts" - And I doubleclick "win-server1" - Then "Selected hosts" should have option "linux-server1" - And "Selected hosts" should have option "win-server1" + And I select "linux-server1" from the multiselect "objects" + And I select "win-server1" from the multiselect "objects" + Then "objects[]" should have option "linux-server1" + And "objects[]" should have option "win-server1" When I enter "9" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -141,9 +135,8 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - Then "Selected services" should have option "linux-server1;PING" + And I select "linux-server1;PING" from the multiselect "objects" + Then "objects[]" should have option "linux-server1;PING" When I enter "9.1" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -160,12 +153,10 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - And I select "linux-server1;System Load" from "Available services" - And I doubleclick "linux-server1;System Load" - Then "Selected services" should have option "linux-server1;PING" - And "Selected services" should have option "linux-server1;System Load" + And I select "linux-server1;PING" from the multiselect "objects" + And I select "linux-server1;System Load" from the multiselect "objects" + Then "objects[]" should have option "linux-server1;PING" + And "objects[]" should have option "linux-server1;System Load" When I enter "9,1" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -188,12 +179,10 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Services" from "Report type" - And I select "linux-server1;PING" from "Available services" - And I doubleclick "linux-server1;PING" - And I select "linux-server2;System Load" from "Available services" - And I doubleclick "linux-server2;System Load" - Then "Selected services" should have option "linux-server1;PING" - And "Selected services" should have option "linux-server2;System Load" + And I select "linux-server1;PING" from the multiselect "objects" + And I select "linux-server2;System Load" from the multiselect "objects" + Then "objects[]" should have option "linux-server1;PING" + And "objects[]" should have option "linux-server2;System Load" When I enter "9.99" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -217,9 +206,8 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I enter "9,99" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -240,12 +228,10 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - And I select "WindowsServers" from "Available hostgroups" - And I doubleclick "WindowsServers" - Then "Selected hostgroups" should have option "LinuxServers" - And "Selected hostgroups" should have option "WindowsServers" + And I select "LinuxServers" from the multiselect "objects" + And I select "WindowsServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" + And "objects[]" should have option "WindowsServers" When I enter "99.999" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -268,12 +254,10 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - And I select "MixedGroup" from "Available hostgroups" - And I doubleclick "MixedGroup" - Then "Selected hostgroups" should have option "LinuxServers" - And "Selected hostgroups" should have option "MixedGroup" + And I select "LinuxServers" from the multiselect "objects" + And I select "MixedGroup" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" + And "objects[]" should have option "MixedGroup" When I enter "99,999" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -297,9 +281,8 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Servicegroups" from "Report type" - And I select "pings" from "Available servicegroups" - And I doubleclick "pings" - Then "Selected servicegroups" should have option "pings" + And I select "pings" from the multiselect "objects" + Then "objects[]" should have option "pings" When I enter "100" into "Jan" And I click "Click to propagate this value to all months" And I click "Show report" @@ -324,10 +307,8 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" And I select "Servicegroups" from "Report type" - And I select "pings" from "Available servicegroups" - And I doubleclick "pings" - And I select "empty" from "Available servicegroups" - And I doubleclick "empty" + And I select "pings" from the multiselect "objects" + And I select "empty" from the multiselect "objects" Then "Selected servicegroups" should have option "pings" And "Selected servicegroups" should have option "empty" When I enter "9" into "Jan" @@ -353,9 +334,8 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I select "Custom" from "Reporting period" And I select "2013" from "Start year" And I select "Jan" from "Start month" @@ -379,9 +359,8 @@ Feature: SLA reports Given I am on the Host details page And I hover over the "Reporting" button When I click "SLA" - And I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + And I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" When I select "Last 12 months" from "Reporting period" And I enter "9" into "Jan" And I click "Click to propagate this value to all months" @@ -404,9 +383,8 @@ Feature: SLA reports And I hover over the "Reporting" button When I click "SLA" Then "Saved reports" shouldn't have option "saved test report" - When I select "LinuxServers" from "Available hostgroups" - And I doubleclick "LinuxServers" - Then "Selected hostgroups" should have option "LinuxServers" + When I select "LinuxServers" from the multiselect "objects" + Then "objects[]" should have option "LinuxServers" # Toggle *everything*! When I select "Last year" from "Reporting period" And I enter "9" into "Jan" @@ -447,7 +425,7 @@ Feature: SLA reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Selected hostgroups" should have option "LinuxServers" + Then "objects[]" should have option "LinuxServers" And "Last year" should be selected from "Reporting period" And "workhours" should be selected from "Report time period" And "Down" should be checked @@ -482,17 +460,15 @@ Feature: SLA reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Selected hostgroups" should have option "LinuxServers" - And "Available hostgroups" should have option "WindowsServers" + Then "objects[]" should have option "LinuxServers" + And "objects" should have option "WindowsServers" And "Include soft states" should be checked And "Use alias" should be checked - When I select "LinuxServers" from "Selected hostgroups" - And I doubleclick "LinuxServers" - And I deselect options in "Available hostgroups" - And I select "WindowsServers" from "Available hostgroups" - And I doubleclick "WindowsServers" - Then "Selected hostgroups" shouldn't have option "LinuxServers" - And "Available hostgroups" shouldn't have option "WindowsServers" + When I select "LinuxServers" from "objects[]" + And I deselect options in "objects" + And I select "WindowsServers" from "objects" + Then "objects[]" shouldn't have option "LinuxServers" + And "objects" shouldn't have option "WindowsServers" When I uncheck "Include soft states" And I click "Show report" And I click "Edit settings" @@ -512,8 +488,8 @@ Feature: SLA reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" from "Saved reports" - Then "Available hostgroups" should have option "LinuxServers" - Then "Selected hostgroups" should have option "WindowsServers" + Then "objects" should have option "LinuxServers" + Then "objects[]" should have option "WindowsServers" And "Include soft states" should be unchecked And "Use alias" should be unchecked @@ -525,9 +501,9 @@ Feature: SLA reports Then I should see "Saved reports" And "Saved reports" should have option "saved test report" When I select "saved test report" - Then "Selected hostgroups" should have option "WindowsServers" + Then "objects[]" should have option "WindowsServers" When I click "Delete" # Test available first, to force capybara to wait for page reload - Then "Available hostgroups" should have option "WindowsServers" + Then "objects" should have option "WindowsServers" And "Saved reports" shouldn't have option "saved test report" - And "Selected hostgroups" shouldn't have option "WindowsServers" + And "objects[]" shouldn't have option "WindowsServers" diff --git a/features/step_definitions/status.rb b/features/step_definitions/status.rb index 25bec8dd2..f67e02f05 100644 --- a/features/step_definitions/status.rb +++ b/features/step_definitions/status.rb @@ -32,3 +32,19 @@ Then /^all helptexts should be defined$/ do page.should have_no_css(".qtip-content", :visible => true) } end + +When /I select "(.*)" from the multiselect "(.*)"$/ do |option, selector| + tmp_sel = find_field(find_field(selector)[:id].sub('[', '_tmp[')) + tmp_sel.select(option) + page.execute_script("$('##{tmp_sel[:id].gsub('[', '\\\\\[').gsub(']', '\\\\\]')}').trigger('change');") +end + +When /I deselect "(.*)" from the multiselect "(.*)"$/ do |option, selector| + tmp_sel = find_field(selector) + tmp_sel.select(option) + page.execute_script("$('##{tmp_sel[:id].gsub('[', '\\\\\[').gsub(']', '\\\\\]')}').trigger('change');") +end + +When /^I filter "(.*)" on "(.*)"$/ do |selector, regex| + find(:xpath, ".//input[following-sibling::*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = '#{selector}' or ./@name = '#{selector}') or ./@placeholder = '#{selector}') or ./@id = //label[normalize-space(string(.)) = '#{selector}']/@for)]]").set(regex) +end \ No newline at end of file -- 2.11.4.GIT