Example #1
0
        public void BTA_03_LN_Program_eCollateral_ValidaitonsBonus()
        {
            #region Object Declaration
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            var             bonusData = new NonAdminUserData(driverContext);
            CategoryFields  bonus     = new CategoryFields();
            ProjectBasePage basePages = new ProjectBasePage(driverContext);
            var             application_Nav_Util_Page               = new Application_Nav_Util_Page(DriverContext);
            var             navigator_Users_ProgramPage             = new Navigator_Users_ProgramPage(DriverContext);
            var             navigator_Users_Program_ComponentsPage  = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var             navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var             navigator_CreateBonus_Category          = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var             navigator_CreateBonus = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext);
            string          stepOutput            = "";
            string          stepName = "";
            #endregion

            try
            {
                #region Object Initialization
                var common = new Common(DriverContext);
                bonus.CategoryName = bonusData.BonusCategoryName;
                var date = DateTime.Now;
                bonus.StartDate             = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
                bonus.ExpiryDate            = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
                bonus.Logo_Img_Hero         = "null";
                bonus.CategoryTypeValue     = CategoryFields.CategoryType.Bonus.ToString();
                bonus.ValueToSetInAttribute = "ValueGivenForAttribute";
                bonus.SetType = CategoryFields.Property.Name.ToString();
                var organizationsPage = new Navigator_Admin_OrganizationsPage(DriverContext);
                bonus.MultiLanguage     = CategoryFields.Languages.English.ToString();
                bonus.ChannelProperties = CategoryFields.Channel.Web.ToString();
                #endregion

                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create New Category with Bonus
                stepName = "Create new Category as " + bonus.CategoryName;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories);
                testStep.SetOutput(navigator_CreateBonus_Category.CreateCategory(bonus));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Verify Error Message if Bonus Name is Empty
                stepName = "Verify Error Message if Bonus Name is Empty";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Bonuses);
                testStep.SetOutput(navigator_CreateBonus.VerifyErrorMessageForEmptyName());
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                //#region Step5: Verify Error Message if Bonus Name is more than 100 Charecters
                //stepName = "Verify Error Message if User Name Name is more than 100 Charecters";
                //testStep = TestStepHelper.StartTestStep(testStep);
                //bonus.Name = organizationsPage.RandomAlphanumericString(new System.Random().Next(101, 105));
                //navigator_CreateBonus.ValidateBonusName(bonus, out string message).ToString();
                //testStep.SetOutput(message);
                //testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                //listOfTestSteps.Add(testStep);
                //#endregion

                #region Step6: Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
            }
            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
Example #2
0
        public void BTA_01_LN_Program_eCollateral_CreateBonus()
        {
            #region Object Declaration
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            CategoryFields  bonus     = new CategoryFields();
            ProjectBasePage basePages = new ProjectBasePage(driverContext);
            var             application_Nav_Util_Page               = new Application_Nav_Util_Page(DriverContext);
            var             navigator_Users_ProgramPage             = new Navigator_Users_ProgramPage(DriverContext);
            var             navigator_Users_Program_ComponentsPage  = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var             navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var             navigator_CreateBonus_Category          = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var             navigator_CreateBonus = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext);
            var             bonusData             = new NonAdminUserData(driverContext);
            string          stepOutput            = "";
            string          stepName = "";
            #endregion

            try
            {
                #region Object Initialization
                string BonusName = bonusData.BonusName;
                string randomStr = RandomDataHelper.RandomString(4);
                bonus.Name         = BonusName + randomStr;
                bonus.CategoryName = bonusData.BonusCategoryName;
                var date = DateTime.Now;
                bonus.StartDate             = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
                bonus.ExpiryDate            = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
                bonus.Logo_Img_Hero         = "Null";
                bonus.CategoryTypeValue     = CategoryFields.CategoryType.Bonus.ToString();
                bonus.ValueToSetInAttribute = "ValueGivenForAttribute";
                bonus.SetType           = CategoryFields.Property.Name.ToString();
                bonus.MultiLanguage     = CategoryFields.Languages.English.ToString();
                bonus.ChannelProperties = CategoryFields.Channel.Web.ToString();
                #endregion

                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create New Category with Bonus
                stepName = "Create new Category as " + bonus.CategoryName;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories);
                testStep.SetOutput(navigator_CreateBonus_Category.CreateCategory(bonus));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Create new bonus
                stepName = "Create bonus with Category " + bonus.CategoryName;
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Bonuses);
                testStep.SetOutput(navigator_CreateBonus.CreateBonus(bonus));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Generate PDF and Verify in Download folder
                stepName = " Generate PDF and Verify in Download folder";
                testStep = TestStepHelper.StartTestStep(testStep);
                string bonusPDFFilePath = basePages.ConfigDownloadPath;
                testStep.SetOutput(navigator_CreateBonus.GenerateAndVerifyBonusesPDF(bonusPDFFilePath, "Bonuses_*.pdf", out stepOutput));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
            }
            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
        public void BTA_165_Navigator_Migrate_Website()
        {
            #region Object Initialization
            Migration        Migration                                       = new Migration(driverContext);
            var              Website_Modules                                 = new Navigator_Users_Website_ModulesPage(DriverContext);
            ProjectBasePage  basePages                                       = new ProjectBasePage(driverContext);
            var              websitePage                                     = new Navigator_Users_WebsitePage(driverContext);
            NonAdminUserData WebsiteData                                     = new NonAdminUserData(driverContext);
            var              application_Nav_Util_Page                       = new Application_Nav_Util_Page(DriverContext);
            var              navigator_Users_ProgramPage                     = new Navigator_Users_ProgramPage(DriverContext);
            var              navigator_Users_Program_ComponentsPage          = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var              navigator_Users_Program_eCollateralPage         = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var              navigator_Users_Program_eCollateral_CouponsPage = new Navigator_Users_Program_eCollateral_CouponsPage(DriverContext);
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";
            #endregion

            try
            {
                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3 :Create Member portal website if it does not exists
                stepName = "Navigate to Website application and Create org_env_MP website if it does not exists  ";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website);
                Portal portalMP = new Portal
                {
                    WebSiteName = WebsiteData.MemberPortal_WebSiteName,
                    WebSiteType = Navigator_Users_WebsitePage.PortalType.MP.ToString(),
                    DefaultSkin = Navigator_Users_WebsitePage.DefaultPortalSkinTypes.MemberFacing.ToString()
                };
                testStep.SetOutput(websitePage.Create_MP(portalMP));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Search and Drag Account Status Attribute name into CFUpdateProfile_Config Configuration file
                stepName = "Search and Drag Account Status Attribute name into CFUpdateProfile_Config Configuration file ";
                testStep = TestStepHelper.StartTestStep(testStep);
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg);
                var webSiteName = WebsiteData.MemberPortal_WebSiteName;
                var moduleType  = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.MemberProfile);
                Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType);
                AttributeSet attribute = new AttributeSet();
                string       source = "Account Status", target = "SmsOptIn";
                testStep.SetOutput(Website_Modules.AddAttributeInCFUpdateProfile_Config(source, target));
                Website_Modules.SaveConfigSetting();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Switch to Migration Environment
                stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment;
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_UsersHomePage.Navigator_Users_SwitchEnvironment();
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Verify Website Module In QA Env and Delete existing
                stepName = "Verify Website Module In QA Env and Delete existing";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website);
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg_Outpu);
                Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType);
                string stepOutput = Website_Modules.VerifyAttributeInQAEnv(source);
                testStep.SetOutput(stepOutput);
                if (stepOutput.Equals(source + " is exists in CFUpdateProfile_Config file"))
                {
                    Website_Modules.DeleteAttributeFromFile(source);
                }
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: Navigate to Migration Page and Delete Migration Set if any
                stepName = "Navigate to Migration Page and Delete Migration Set isf any";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration);
                Navigator_MigrationPage _MigrationPage = new Navigator_MigrationPage(DriverContext);
                Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Website_Set.ToString();
                _MigrationPage.DeleteIfMigrationSetExists(Migration.BuildMigrationSetName, out string output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8:Create New Migration Set
                stepName = "Create New Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Website_Set.ToString() + "_" + DateHelper.GetDate("Current");
                _MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9:Edit Items and Generate Items
                stepName = "Edit Items and Generate Items";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.EditItems(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2));
                string ModuleName = "BrierleyPortal:MemberProfile:CFUpdateProfile_Config";
                _MigrationPage.SelectItemsForWebsiteModuleMigration(ModuleName, out _output);
                testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10:Initiate Migration Set
                stepName = "Initiate Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11:Approve Migration Set
                stepName = "Approve Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12:Run Migration Set
                stepName = "Run Now Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step13:Verify Website Module Migrated with Added attribute name in CFUpdateProfile_Config file
                stepName = "Verify Website Module Migrated  with Added attribute name in CFUpdateProfile_Config file";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website);
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg1);
                Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType);
                testStep.SetOutput(Website_Modules.VerifyAttributeInQAEnv("Account Status"));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step14: Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
            }
            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
        public void BTA_119_Navigator_Migrate_Message()
        {
            #region Object Initialization
            Migration        Migration                               = new Migration(driverContext);
            var              Website_Modules                         = new Navigator_Users_Website_ModulesPage(DriverContext);
            ProjectBasePage  basePages                               = new ProjectBasePage(driverContext);
            var              websitePage                             = new Navigator_Users_WebsitePage(driverContext);
            NonAdminUserData WebsiteData                             = new NonAdminUserData(driverContext);
            var              application_Nav_Util_Page               = new Application_Nav_Util_Page(DriverContext);
            var              navigator_Users_ProgramPage             = new Navigator_Users_ProgramPage(DriverContext);
            var              navigator_Users_Program_ComponentsPage  = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var              navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var              messagesPage                            = new Navigator_Users_Program_eCollateral_MessagesPage(driverContext);
            string           randomStr                               = RandomDataHelper.RandomString(4);
            var              attributeSetData                        = new NonAdminUserData(driverContext);
            testCase = new TestCase(TestContext.TestName);
            CategoryFields messageData = new CategoryFields();
            messageData.Name = ProjectBasePage.Orgnization_value + NonAdminUserData.MessageName;
            var date = DateTime.Now;
            date = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, TimeZoneInfo.Local.Id, "Central Standard Time");
            messageData.StartDate  = date.ToString("MM/dd/yyyy  HH:mm:ss", new CultureInfo("en-US"));
            messageData.ExpiryDate = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
            listOfTestSteps        = new List <TestStep>();
            testStep = new TestStep();
            string stepName = "";
            #endregion

            try
            {
                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3: Create new message if message does not exist already
                stepName = "Create new message if message does not exist already";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Messages);
                testStep = messagesPage.CreateNewMessage(messageData, out string messageStatus);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Switch to Migration Environment
                stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment;
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_UsersHomePage.Navigator_Users_SwitchEnvironment();
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Verify and Delete Message if available in QA Env
                stepName = "Verify and Delete Message if available in QA Env";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Messages);
                bool OutputStr = messagesPage.DeleteIfMessageExists(messageData.Name, out string Message);
                testStep.SetOutput(Message);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Navigate to Migration Page and Delete Message Migration Set if any
                stepName = "Navigate to Migration Page and Delete Message Migration Set if any";
                testStep = TestStepHelper.StartTestStep(testStep);
                Navigator_MigrationPage _MigrationPage = new Navigator_MigrationPage(DriverContext);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration);
                Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Message_Set.ToString();
                bool status = _MigrationPage.DeleteIfMigrationSetExists(Migration.BuildMigrationSetName, out string output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Create New Migration Set
                stepName = "Create New Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Message_Set.ToString() + "_" + DateHelper.GetDate("Current");
                _MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8:Edit Items and Generate Items
                stepName = "Edit Items and Generate Items";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GetDate("Current"));
                _MigrationPage.SelectItemsForMessage(messageData.Name, out _output);
                testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9:Initiate Migration Set
                stepName = "Initiate Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10:Approve Migration Set
                stepName = "Approve Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11:Run Migration Set
                stepName = "Run Now Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12:Verify Migrated Message is available in QA Env
                stepName = "Verify Migrated Message is available in QA Env";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Messages);
                bool Out_status = messagesPage.VerifyMessageExists(messageData.Name);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Out_status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step13: Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
            }

            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
Example #5
0
        public void BTA281_Navigator_Create_New_Message()
        {
            var        navigator_LoginPage = new Navigator_LoginPage(DriverContext);
            MethodBase method     = MethodBase.GetCurrentMethod();
            string     methodName = method.Name;

            testCase        = new TestCase(methodName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";

            try
            {
                #region Object initialization
                var            application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext);
                var            navigator_UsersHomePage   = new Navigator_UsersHomePage(DriverContext);
                var            programPage     = new Navigator_Users_ProgramPage(driverContext);
                var            componentsPage  = new Navigator_Users_Program_ComponentsPage(driverContext);
                var            eCollateralPage = new Navigator_Users_Program_eCollateralPage(driverContext);
                var            eCollateralTab  = Navigator_Users_Program_eCollateralPage.eCollateralTabs.Messages;
                var            messagesPage    = new Navigator_Users_Program_eCollateral_MessagesPage(driverContext);
                CategoryFields messageData     = new CategoryFields();
                messageData.Name = ProjectBasePage.Orgnization_value + NonAdminUserData.MessageName;
                var date = DateTime.Now;
                date = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, TimeZoneInfo.Local.Id, "Central Standard Time");
                messageData.StartDate  = date.ToString("MM/dd/yyyy  HH:mm:ss", new CultureInfo("en-US"));
                messageData.ExpiryDate = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
                bool status;
                #endregion

                #region Step 1 : Open Navigator URL
                stepName = "Open Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 2 : Login to navigator using USER_WithAllRoles
                stepName       = "Login to navigator using USER_WithAllRoles";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = userName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 3 : Select organization and environment on USER Home page
                stepName = "Select organization and environment on USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 4 : Navigate to program -> eCollateralTab
                stepName = "Navigate to program -> eCollateralTab";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                programPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                eCollateralPage.NavigateToProgramECollateralTab(eCollateralTab);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 5 : Create new message if message does not exist already
                testStep = messagesPage.CreateNewMessage(messageData, out string messageStatus);
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 6 : Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
                ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed");
            }
            catch (Exception e)
            {
                ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed");

                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                if (!OrderTest_Status.Contains("true"))
                {
                    Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                }
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
Example #6
0
        public void BTA_52_Navigator_Migrate_Coupon_VerifyDeselectOfIsGlobalFalgMigratedCorrectly()
        {
            #region Object Initialization
            CategoryFields coupon    = new CategoryFields();
            Migration      Migration = new Migration(driverContext);

            ProjectBasePage  basePages   = new ProjectBasePage(driverContext);
            var              couponData  = new NonAdminUserData(driverContext);
            NonAdminUserData WebsiteData = new NonAdminUserData(driverContext);
            var              application_Nav_Util_Page                       = new Application_Nav_Util_Page(DriverContext);
            var              navigator_Users_ProgramPage                     = new Navigator_Users_ProgramPage(DriverContext);
            var              navigator_Users_Program_ComponentsPage          = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var              navigator_Users_Program_eCollateralPage         = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var              navigator_CreateCoupon_Category                 = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var              navigator_Users_Program_eCollateral_CouponsPage = new Navigator_Users_Program_eCollateral_CouponsPage(DriverContext);
            string           CouponName = Migration.MigrationCouponame;
            string           randomStr  = RandomDataHelper.RandomString(4);
            coupon.Name         = CouponName + randomStr;
            coupon.CouponCode   = "";
            coupon.CategoryName = Migration.MigrationCouponCategoryName;

            coupon.StartDate         = DateHelper.GetDate("Current");
            coupon.ExpiryDate        = DateHelper.GetDate("Future");
            coupon.UsesAllowed       = RandomDataHelper.RandomNumber(2).ToString();
            coupon.CategoryTypeValue = CategoryFields.CategoryType.Coupon.ToString();
            coupon.SetType           = CategoryFields.Property.Name.ToString();
            coupon.MultiLanguage     = CategoryFields.Languages.English.ToString();
            coupon.ChannelProperties = CategoryFields.Channel.Web.ToString();
            coupon.IsGlobal          = "unchecked";
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";
            #endregion

            try
            {
                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create Category with Coupon if not Exists in Dev environment
                stepName = "Create new Category for " + coupon.CategoryTypeValue;
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.VerifyCategory_IfNotExistedCreateNew(ProjectBasePage.Env_value, coupon, CategoryFields.CategoryType.Coupon.ToString(), out string stepoutput);
                testStep.SetOutput(stepoutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create new Coupon in Dev  environment
                stepName = "Create Coupon with a category " + coupon.CategoryTypeValue;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Coupons);
                testStep.SetOutput(navigator_Users_Program_eCollateral_CouponsPage.CreateCoupon(coupon));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Switch to Migration Environment
                stepName = "Switching to Migration Environment :" + Migration.MigrationEnvironment;
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_UsersHomePage.Navigator_Users_SwitchEnvironment();
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Create Category with Coupon if not Exists in QA environment
                stepName = "Create new Category as " + coupon.CategoryTypeValue + ", if not exists.";
                testStep = TestStepHelper.StartTestStep(testStep);
                bool CategoryAlreadyMigrated = true;
                if (!basePages.VerifyCategory_IfNotExistedCreateNew(Migration.MigrationEnvironment, coupon, CategoryFields.CategoryType.Coupon.ToString(), out stepoutput, true))
                {
                    CategoryAlreadyMigrated = false;
                }
                testStep.SetOutput(stepoutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: Navigate to Migration Page and Delete Migration Set if any
                stepName = "Navigate to Migration Page and Delete Migration Set if any";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.migration);
                Navigator_MigrationPage _MigrationPage = new Navigator_MigrationPage(DriverContext);
                Migration.BuildMigrationSetName = Migration.MigrationSets.Migration_Coupon_Default.ToString() + "_" + DateHelper.GetDate("Current");
                _MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Coupon_Default.ToString(), out string output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8:Create  New Migration Set
                stepName = "Create  New Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.MigrationSetCreation(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9:Edit Items and Generate Items
                stepName = "Edit Items and Generate Items";
                testStep = TestStepHelper.StartTestStep(testStep);
                //_MigrationPage.EditItems(Migration.BuildMigrationSetName, ProjectBasePage.Env_value,DateHelper.GeneratePastTimeStampBasedonMin(2));
                _MigrationPage.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2));
                _MigrationPage.SelectItemsForCouponDef(CategoryAlreadyMigrated, coupon.CategoryName, coupon.Name, out _output);
                testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10:Initiate Migration Set
                stepName = "Initiate Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.InitiateMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11:Approve Migration Set
                stepName = "Approve Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.ApproveMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12:Run Migration Set
                stepName = "Run Now Migration Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                _MigrationPage.RunNowMigrationSet(Migration.BuildMigrationSetName, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step13:Verify Coupon Migrated  on Coupon Page
                stepName = "Verify Coupon Migrated on Coupon Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Coupons);
                navigator_Users_Program_eCollateral_CouponsPage.VerifyCreatedCoupon(coupon.SetType, coupon.Name, coupon.CategoryName);
                testStep.SetOutput(" Coupon :" + coupon.Name + " Migrated Successfully and Appeared on Coupon Page");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step14:Verify the Is Global checkbox is unchecked
                stepName = "Verify the Is Global checkbox is unchecked";
                testStep = TestStepHelper.StartTestStep(testStep);
                if (!navigator_Users_Program_eCollateral_CouponsPage.VerifyISGlobalCheckedorNot(coupon.Name))
                {
                    testStep.SetOutput("Global checkbox is unchecked for the coupon: " + coupon.Name);
                }
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step15:Verify Coupon Category Migrated  on Categories Page
                stepName = "Verify Coupon Category Migrated  on Categories Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                if (!basePages.VerifyCategory_IfNotExistedCreateNew(Migration.MigrationEnvironment, coupon, CategoryFields.CategoryType.Coupon.ToString(), out stepoutput, true))
                {
                    throw new Exception("Failed to Migrate Category:" + Migration.MigrationCouponCategoryName);
                }
                testStep.SetOutput(stepoutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step16: Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
            }

            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
Example #7
0
        public void BTA_116_Navigator_CreateCouponCategoryWithExtendedAttributeSet()
        {
            MethodBase method     = MethodBase.GetCurrentMethod();
            string     methodName = method.Name;

            testCase = new TestCase(methodName);
            string Prereq_testCase1 = "BTA119_Navigator_VerifyAttributes_On_ExtendedAttributesPage";

            ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, methodName, testStep);

            #region Object Initialization
            CategoryFields   coupon      = new CategoryFields();
            ProjectBasePage  basePages   = new ProjectBasePage(driverContext);
            var              couponData  = new NonAdminUserData(driverContext);
            NonAdminUserData WebsiteData = new NonAdminUserData(driverContext);
            var              application_Nav_Util_Page                       = new Application_Nav_Util_Page(DriverContext);
            var              navigator_Users_ProgramPage                     = new Navigator_Users_ProgramPage(DriverContext);
            var              navigator_Users_Program_ComponentsPage          = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var              navigator_Users_Program_eCollateralPage         = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var              navigator_CreateCoupon_Category                 = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var              navigator_Users_Program_eCollateral_CouponsPage = new Navigator_Users_Program_eCollateral_CouponsPage(DriverContext);
            string           CouponName = couponData.CouponName;
            string           randomStr  = RandomDataHelper.RandomString(4);
            coupon.CouponCode   = "";
            coupon.Name         = CouponName + randomStr;
            coupon.CategoryName = couponData.CouponCategoryName;
            var date = DateTime.Now;
            date                         = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, TimeZoneInfo.Local.Id, "Central Standard Time");
            coupon.StartDate             = date.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
            coupon.ExpiryDate            = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
            coupon.UsesAllowed           = "10";
            coupon.CategoryTypeValue     = CategoryFields.CategoryType.Coupon.ToString();
            coupon.ValueToSetInAttribute = "ValueGivenForAttribute";
            coupon.SetType               = CategoryFields.Property.Name.ToString();
            listOfTestSteps              = new List <TestStep>();
            testStep                     = new TestStep();
            string stepName = "";
            coupon.MultiLanguage     = CategoryFields.Languages.English.ToString();
            coupon.ChannelProperties = CategoryFields.Channel.Web.ToString();

            #endregion

            try
            {
                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create Category with Coupon
                stepName = "Create new Category as " + coupon.CategoryTypeValue;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories);
                testStep.SetOutput(navigator_CreateCoupon_Category.CreateCategory(coupon));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create new Coupon with Attribute Set
                stepName = "Create Coupon with a category " + coupon.CategoryTypeValue + " with Attribute Set";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral);
                navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Coupons);
                navigator_Users_Program_eCollateral_CouponsPage.CreateCouponWithAttributeSet(coupon);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Navigate to Websites and Select Website as BTA_Dev_CS and Module Type as
                stepName = "Navigate to Websites and Select Website  as BTA_Dev_CS and Module Type as Customer Service - Award Coupons";
                testStep = TestStepHelper.StartTestStep(testStep);
                var Website = new Application_Nav_Util_Page(DriverContext);
                Website.OpenApplication(NavigatorEnums.ApplicationName.website);
                var Website_Modules = new Navigator_Users_Website_ModulesPage(DriverContext);
                var websitePage     = new Navigator_Users_WebsitePage(DriverContext);
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg);
                var webSiteName = WebsiteData.CSPortal_WebSiteName;
                var moduleType  = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.CustomerServiceAwardCoupons);
                Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Config Coupon to CS portal
                stepName = "Select CSCouponAppeasement_Config file and Add created Coupon into it";
                testStep = TestStepHelper.StartTestStep(testStep);
                Website_Modules.CSCouponAppeasementConfigurebutton();
                Website_Modules.AddCouponInCSCouponAppeasementConfig(coupon.Name);
                Website_Modules.SaveConfigSetting();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Bounce the CS portal App pool
                stepName = "Bounce the CS Portal App pool";
                testStep = TestStepHelper.StartTestStep(testStep);
                var WebsiteManagement = new Navigator_Users_WebsiteManagementPage(DriverContext);
                WebsiteManagement.Navigator_Website_Select_WebsiteManagementTab();
                WebsiteManagement.BounceAppPool("CSPortal");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion
                testCase.SetStatus(true);
                ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed");
            }

            catch (Exception e)
            {
                ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                //testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                if (!OrderTest_Status.Contains("true"))
                {
                    Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                }
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
        public void BTA227_Regression_Navigator_Program_Components_Channels_Create_Sort_Validations()
        {
            #region Object Initialization
            var    application_Nav_Util_Page               = new Application_Nav_Util_Page(DriverContext);
            var    navigator_Users_ProgramPage             = new Navigator_Users_ProgramPage(DriverContext);
            var    navigator_Users_Program_ComponentsPage  = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var    navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var    LocationGroup = new Navigator_Users_Program_Components_LocationGroupsPage(driverContext);
            var    ChannelPage   = new Navigator_Users_Program_Components_ChannelPage(DriverContext);
            string randomStr     = RandomDataHelper.RandomString(3);
            testCase = new TestCase(TestContext.TestName);
            CategoryFields Channel = new CategoryFields
            {
                Name        = NonAdminUserData.ChannelName + randomStr,
                Description = "Write Data In Description Area",
                ChannelType = Navigator_Users_Program_Components_ChannelPage.ChannelTypes.HTML.ToString()
            };
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";
            #endregion

            try
            {
                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Verify displayed Columns for the Channels Grid
                stepName = "Verify displayed Columns for the Channels Grid";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Channels);
                bool   Out_Status = ChannelPage.CreateAndVerifyChannelExists(Channel, out string Out_Msg);
                string Col_Msg    = "";
                if (Out_Status)
                {
                    ChannelPage.VerifyAllChannelColumnsInGrid(out Col_Msg);
                }
                testStep.SetOutput(Col_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Out_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Verify that this grid is sortable by Channel Name
                stepName = "Verify that this grid is sortable by Channel Name";
                testStep = TestStepHelper.StartTestStep(testStep);
                bool Sort_Status = ChannelPage.VerifyGridIsSortableWithColName("Channel Name", out string Sort_Msg);
                testStep.SetOutput(Sort_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Sort_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Verify that this grid is sortable by Channel Description
                stepName    = "Verify that this grid is sortable by Channel Description";
                testStep    = TestStepHelper.StartTestStep(testStep);
                Sort_Status = ChannelPage.VerifyGridIsSortableWithColName("Channel Description", out Sort_Msg);
                testStep.SetOutput(Sort_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Sort_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Verify that this grid is sortable by Channel Type
                stepName    = "Verify that this grid is sortable by Channel Type";
                testStep    = TestStepHelper.StartTestStep(testStep);
                Sort_Status = ChannelPage.VerifyGridIsSortableWithColName("Channel Type", out Sort_Msg);
                testStep.SetOutput(Sort_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Sort_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Verify Max Rows before Pagination
                stepName = "Verify Max Rows before Pagination";
                testStep = TestStepHelper.StartTestStep(testStep);
                bool _Status = ChannelPage.VerifyMaxRows(Channel, out string _Msg);
                testStep.SetOutput(_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, _Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8:Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion
                testCase.SetStatus(true);
            }
            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }
        public void BTA_230_Regression_Navigator_Components_Channels_EditChanel()
        {
            #region Object Initialization
            var    application_Nav_Util_Page               = new Application_Nav_Util_Page(DriverContext);
            var    navigator_Users_ProgramPage             = new Navigator_Users_ProgramPage(DriverContext);
            var    navigator_Users_Program_ComponentsPage  = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var    navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext);
            var    LocationGroup = new Navigator_Users_Program_Components_LocationGroupsPage(driverContext);
            var    ChannelPage   = new Navigator_Users_Program_Components_ChannelPage(DriverContext);
            string randomStr     = RandomDataHelper.RandomString(3);
            testCase = new TestCase(TestContext.TestName);
            CategoryFields Channel = new CategoryFields
            {
                Name        = NonAdminUserData.ChannelName + randomStr,
                Description = "Write Data In Description Area",
                ChannelType = Navigator_Users_Program_Components_ChannelPage.ChannelTypes.HTML.ToString()
            };
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";
            #endregion

            try
            {
                #region Step1:Launch Navigator Portal
                stepName = "Launch Navigator URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As User Admin User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.NonAdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Verify that a user is able to add a new HTML Channel
                stepName = " Verify that a user is able to add a new HTML Channel";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Channels);
                bool Out_Status = ChannelPage.CreateAndVerifyChannelExists(Channel, out string Out_Msg);
                testStep.SetOutput(Out_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Out_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Edit and verify the chanel details gets updated
                stepName   = " Edit and verify the chanel details gets updated ";
                testStep   = TestStepHelper.StartTestStep(testStep);
                Out_Status = ChannelPage.EditAndVerifyChannelDetailsUpdated(Channel, out Out_Msg);
                testStep.SetOutput(Out_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Out_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Delete and Verify Existance of the Channel
                stepName = "Delete and Verify Existance of the Channel ";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Channels);
                bool Del_Status = ChannelPage.DeleteChannelAndVerify(Channel, out string Del_Msg);
                testStep.SetOutput(Del_Msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, Del_Status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Logout
                stepName = "Logout from USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                testCase.SetStatus(true);
            }

            catch (Exception e)
            {
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                testCase.SetImageContent(DriverContext.TakeScreenshot().ToString());
                Assert.Fail();
            }
            finally
            {
                testCase.SetTestCaseSteps(listOfTestSteps);
                testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow());
                listOfTestCases.Add(testCase);
            }
        }