From 2ad62fd48e8485ecd95b36a3fec4304805a791ac Mon Sep 17 00:00:00 2001 From: Sharath Babu Date: Mon, 13 Jun 2016 14:53:04 +0000 Subject: [PATCH 1/2] CP-17752: make unit tests use a generic class of policy wizard and added support for New Policy Wizard help document. Signed-off-by: Sharath Babu --- XenAdmin/Help/HelpManager.resx | 18 ++++++++++++++++++ .../NewPolicyWizard/NewPolicyWizardSpecific.cs | 14 ++++++++++++-- .../WizardTests/NewPolicyWizardTest.cs | 4 ++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/XenAdmin/Help/HelpManager.resx b/XenAdmin/Help/HelpManager.resx index 3148d4078..5243cc5ef 100644 --- a/XenAdmin/Help/HelpManager.resx +++ b/XenAdmin/Help/HelpManager.resx @@ -657,6 +657,24 @@ 6535 + + 6551 + + + 6551 + + + 6551 + + + 6551 + + + 6551 + + + 6551 + 5100 diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs index d2986ca67..95f068a0d 100644 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs +++ b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs @@ -261,8 +261,18 @@ namespace XenAdmin.Wizards.NewPolicyWizard protected override string WizardPaneHelpID() { - return CurrentStepTabPage is RBACWarningPage ? FormatHelpId("Rbac") : base.WizardPaneHelpID(); + if (CurrentStepTabPage is RBACWarningPage) + { + return FormatHelpId("Rbac"); + } + + else if (!VMGroup.isVMPolicyVMPP) + { + return "NewPolicyWizardSpecific_" + CurrentStepTabPage.HelpID + "Pane"; + } + + return "NewPolicyWizard_" + CurrentStepTabPage.HelpID + "Pane"; } } -} \ No newline at end of file +} diff --git a/XenAdminTests/WizardTests/NewPolicyWizardTest.cs b/XenAdminTests/WizardTests/NewPolicyWizardTest.cs index 081a81520..4d24ede25 100644 --- a/XenAdminTests/WizardTests/NewPolicyWizardTest.cs +++ b/XenAdminTests/WizardTests/NewPolicyWizardTest.cs @@ -38,9 +38,9 @@ namespace XenAdminTests.WizardTests.cowleyPolicies_xml { [TestFixture, Category(TestCategories.UICategoryB)] - class NewPolicyWizardTest : WizardTest + class NewPolicyWizardSpecific : WizardTest { - public NewPolicyWizardTest() + public NewPolicyWizardSpecific() : base(new string[] { "Policy Name", "Protected VMs", "Snapshot Type", "Snapshot Schedule","Archive Options","Email Alerts","Finish" } , true, false) { } From 93e3c05216d794ea8ca26603821d33126f27f874 Mon Sep 17 00:00:00 2001 From: Sharath Babu Date: Tue, 14 Jun 2016 15:22:15 +0000 Subject: [PATCH 2/2] Incoporating review comments by Mihaela. Signed-off-by: Sharath Babu --- XenAdmin/Help/HelpManager.resx | 12 ++++++------ .../NewPolicyWizard/NewPolicyWizardSpecific.cs | 2 +- XenAdminTests/WizardTests/NewPolicyWizardTest.cs | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/XenAdmin/Help/HelpManager.resx b/XenAdmin/Help/HelpManager.resx index 5243cc5ef..f2a0f43a5 100644 --- a/XenAdmin/Help/HelpManager.resx +++ b/XenAdmin/Help/HelpManager.resx @@ -657,22 +657,22 @@ 6535 - + 6551 - + 6551 - + 6551 - + 6551 - + 6551 - + 6551 diff --git a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs index 95f068a0d..47293af0a 100644 --- a/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs +++ b/XenAdmin/Wizards/NewPolicyWizard/NewPolicyWizardSpecific.cs @@ -268,7 +268,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard else if (!VMGroup.isVMPolicyVMPP) { - return "NewPolicyWizardSpecific_" + CurrentStepTabPage.HelpID + "Pane"; + return "NewPolicyWizardVMSS_" + CurrentStepTabPage.HelpID + "Pane"; } return "NewPolicyWizard_" + CurrentStepTabPage.HelpID + "Pane"; diff --git a/XenAdminTests/WizardTests/NewPolicyWizardTest.cs b/XenAdminTests/WizardTests/NewPolicyWizardTest.cs index 4d24ede25..f940189dc 100644 --- a/XenAdminTests/WizardTests/NewPolicyWizardTest.cs +++ b/XenAdminTests/WizardTests/NewPolicyWizardTest.cs @@ -38,16 +38,16 @@ namespace XenAdminTests.WizardTests.cowleyPolicies_xml { [TestFixture, Category(TestCategories.UICategoryB)] - class NewPolicyWizardSpecific : WizardTest + class NewPolicyWizardTest : WizardTest> { public NewPolicyWizardSpecific() - : base(new string[] { "Policy Name", "Protected VMs", "Snapshot Type", "Snapshot Schedule","Archive Options","Email Alerts","Finish" } + : base(new string[] { "Policy Name", "Protected VMs", "Snapshot Type", "Snapshot schedule","Archive Options","Email Alerts","Finish" } , true, false) { } - protected override NewPolicyWizard NewWizard() + protected override NewPolicyWizardSpecific NewWizard() { - return new NewPolicyWizard(base.GetAnyPool()); + return new NewPolicyWizardSpecific(base.GetAnyPool()); } protected override void TestPage(string pageName)