Example #1
0
        public void BTA_227_LN_JobCreationValidationsInSchedulePage()
        {
            #region Object Initialization
            CategoryFields   coupon    = new CategoryFields();
            ProjectBasePage  basePages = new ProjectBasePage(driverContext);
            NonAdminUserData data      = new NonAdminUserData(driverContext);
            var            application_Nav_Util_Page      = new Application_Nav_Util_Page(DriverContext);
            var            navigator_Users_ProgramPage    = new Navigator_Users_ProgramPage(DriverContext);
            var            Program_RewardCatalogPage      = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var            RewardCatalog_ExchangeRatePage = new Navigator_Users_Program_RewardCatalog_ExchangeRatesPage(DriverContext);
            CategoryFields rate = new CategoryFields();
            CategoryFields job  = new CategoryFields();
            job.Name = data.JobName + RandomDataHelper.RandomString(5);
            job.FrequencyDropDown = CategoryFields.FrequencyType.Hourly.ToString();
            job.Hour = job.RunEveryHour;
            var date = DateTime.Now;
            job.StartDate   = DateHelper.GetDate("Current");
            job.ExpiryDate  = DateHelper.GetDate("Future");
            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: Verify that Job Name is a required value for creating a new Job
                stepName = "Verify that Job Name is a required value for creating a new Job ";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.ExchangeRates);
                RewardCatalog_ExchangeRatePage.NavigateToExchangeRatesTab(Navigator_Users_Program_RewardCatalog_ExchangeRatesPage.ExchangeTabs.Schedule);
                RewardCatalog_ExchangeRatePage.VerifyJobNameIsRequiredValueForCreatingNewJob("Job Name is a required value.", out string status);
                testStep.SetOutput(status);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Verify that Frequency is a required value for creating a new Job
                stepName = "Verify that Frequency  is a required value for creating a new Job";
                testStep = TestStepHelper.StartTestStep(testStep);
                RewardCatalog_ExchangeRatePage.VerifyThatFrequencyValueIsRequiredValueForCreatingNewJob(job, "A frequency value must be seleted.", out status);
                testStep.SetOutput(status);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Verify that Start Date is a required value for creating a new Job
                stepName = "Verify that Start Date is a required value for creating a new Job";
                testStep = TestStepHelper.StartTestStep(testStep);
                RewardCatalog_ExchangeRatePage.VerifyThatStartDateIsRequiredValueForCreatingNewJob(job, "Start date is a required value.", out status);
                testStep.SetOutput(status);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: Verify that End Date is a required value for creating a new Job
                stepName = "Verify that End Date is a required value for creating a new Job";
                testStep = TestStepHelper.StartTestStep(testStep);
                RewardCatalog_ExchangeRatePage.VerifyThatEndDateIsRequiredValueForCreatingNewJob(job, "End date is a required value.", out status);
                testStep.SetOutput(status);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: Verify that the 'Run At' field does not disappear when you click save button with no 'Run At' value provided for 'One time
                stepName = " Verify that the 'Run At' field does not disappear when you click save button with no 'Run At' value provided for 'One time";
                testStep = TestStepHelper.StartTestStep(testStep);
                job.FrequencyDropDown = CategoryFields.FrequencyType.OneTime.ToString();
                RewardCatalog_ExchangeRatePage.VerifyRunFieldIsRequiredForCreatingNewJobBySelectingOneTimeFrequency(job, "Please enter a date and time or run the job.", out status);
                testStep.SetOutput(status);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: 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 + e, 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_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);
            }
        }
        public void BTA85_Navigator_Users_CreateAttributSets()
        {
            ProjectBasePage basePages        = new ProjectBasePage(driverContext);
            var             attributeSetData = new NonAdminUserData(driverContext);
            MethodBase      method           = MethodBase.GetCurrentMethod();
            string          methodName       = method.Name;

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

            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;
                NonAdminUserData Wesitedata = new NonAdminUserData(driverContext);
                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:Navigating Model and Navigate to Attribute Set page
                stepName = "Navigating Model and Navigate to Attribute Set page";
                testStep = TestStepHelper.StartTestStep(testStep);
                var models_HomePage = new Navigator_ModelHomePage(DriverContext);
                models_HomePage.NavigateToModels_Page(out string Pageoutput); testStep.SetOutput(Pageoutput);
                models_HomePage.NavigatetoToAttributeSet_Page(out Pageoutput); testStep.SetOutput(Pageoutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Create Attributes set , Add  Attribute sets and Generate Table
                var attributeSetPage = new Navigator_AttributeSetPage(DriverContext);
                attribute.MainAttributeSets = "Member";
                string randomStr = RandomDataHelper.RandomString(4);
                attribute.AttributeSets = attributeSetData.AttributeSets;
                attribute.Attributes    = attributeSetData.Attribute;
                stepName = "Create Attributes set" + attribute.MainAttributeSets + "  Add  Attributes to the attribute set:" + attribute.Attributes + " is Successful and Generate Table is successful";
                testStep = TestStepHelper.StartTestStep(testStep);
                attributeSetPage.CreateAttributeSet(attribute.MainAttributeSets, attribute.AttributeSets);
                if (attributeSetPage.CreateAttributes(attribute.MainAttributeSets, attribute.AttributeSets, attribute.Attributes, attribute.Attributes, attribute.Attributes, "String", "1", "20").Contains("Attribute Element is Created Successfully"))
                {
                    attributeSetPage.GenerateTable(attribute.MainAttributeSets, attribute.AttributeSets);
                }
                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 Member Profile
                stepName = "Navigate to Websites and Select Website  as BTA_Dev_CS and Module Type as Member Profile";
                testStep = TestStepHelper.StartTestStep(testStep);
                var Website = new Application_Nav_Util_Page(DriverContext);
                Website.OpenApplication(NavigatorEnums.ApplicationName.website);
                var websitePage = new Navigator_Users_WebsitePage(DriverContext);
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg);
                var Website_Modules = new Navigator_Users_Website_ModulesPage(DriverContext);
                var webSiteName     = Wesitedata.CSPortal_WebSiteName;
                var moduleType      = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.MemberProfile);
                Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Config Attribute set to CS portal
                stepName = "Select CSMemberRegConfig file and Drag Drap above created Attribute";
                testStep = TestStepHelper.StartTestStep(testStep);
                Website_Modules.CSMemberRegConfigurebutton();
                Website_Modules.DragandDropAttibuteSet(attribute.Attributes, "Country");
                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:Launch CS Portal and Login to CS Portal as csadmin
                stepName = "Launch CS Portal and Login to CS Portal as csadmin";
                testStep = TestStepHelper.StartTestStep(testStep);
                var CSPortal_LoginPage = new CSPortal_LoginPage(DriverContext);
                CSPortal_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output);
                string username = CsPortalData.csadmin;
                string password = CsPortalData.csadmin_password;
                CSPortal_LoginPage.LoginCSPortal(username, password, out Step_Output); testStep.SetOutput(Step_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9:Navigate to Member Registration page and Verify Attribute
                stepName = "Navigate to Member Registration page and Verify Attribute:" + attribute.Attributes;
                testStep = TestStepHelper.StartTestStep(testStep);
                var CSPortal_HomePage = new CSPortal_HomePage(DriverContext);
                CSPortal_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, out string message);
                var CSPortal_MemberRegistration = new CSPortal_MemberRegistrationPage(DriverContext);
                CSPortal_MemberRegistration.VerifyAttributeSetonRegisterPage(attribute.Attributes);
                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 #4
0
        public void BTA574_MP_Verify_SocialMediaForRewardsAndCoupon()
        {
            ProjectBasePage  basePages   = new ProjectBasePage(driverContext);
            NonAdminUserData WebsiteData = new NonAdminUserData(driverContext);

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

            try
            {
                #region Object Initialization
                var userName                  = NavigatorUsers.NonAdminUser;
                var password                  = NavigatorUsers.NavigatorPassword;
                var navigator_LoginPage       = new Navigator_LoginPage(DriverContext);
                var navigator_UsersHomePage   = new Navigator_UsersHomePage(DriverContext);
                var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext);
                var websitePage               = new Navigator_Users_WebsitePage(DriverContext);
                var modulesPage               = new Navigator_Users_Website_ModulesPage(DriverContext);
                common = new Common(DriverContext);
                CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common);
                var MPortal_LoginPage     = new MemberPortal_LoginPage(DriverContext);
                var MPortal_MyWalletPage  = new MemberPortal_MyWalletPage(DriverContext);
                var MPortal_MyAccountPage = new MemberPortal_MyAccountPage(DriverContext);
                #endregion

                #region Part1: Navigator portal-Enable social media for rewards and coupons
                #region Step1:Launch Navigator Portal
                stepName = "Launch 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 Step2:Login As User with All roles User
                stepName       = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment";
                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 Step3 : 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 Step4: Navigate to Website > Modules page
                stepName = "Navigate to Website > Modules page";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website);
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Enable Social Media for Coupons
                stepName = "Enable Social Media for Coupons";
                testStep = TestStepHelper.StartTestStep(testStep);
                var webSiteName = WebsiteData.MemberPortal_WebSiteName;
                var moduleType  = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.CouponsListView);
                var configName  = Navigator_Users_Website_ModulesPage.ConfigNames.CFCoupons_Config.ToString();
                modulesPage.EnableSocialMedia(moduleType, webSiteName, configName, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Enable Social Media for Rewards
                stepName   = "Enable Social Media for Rewards";
                testStep   = TestStepHelper.StartTestStep(testStep);
                moduleType = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.RewardHistoryListView);
                configName = Navigator_Users_Website_ModulesPage.ConfigNames.CFRewardsHistory_Config.ToString();
                moduleType = "Reward History - List View";
                configName = "CFRewardsHistory_Config";
                websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg);
                modulesPage.EnableSocialMedia(moduleType, webSiteName, configName, out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Bounce the Member portal App pool
                stepName = "Bounce the Member Portal App pool";
                testStep = TestStepHelper.StartTestStep(testStep);
                var WebsiteManagement = new Navigator_Users_WebsiteManagementPage(DriverContext);
                WebsiteManagement.Navigator_Website_Select_WebsiteManagementTab();
                WebsiteManagement.BounceAppPool("MemberPortal");
                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
                #endregion

                #region Part2: Creating members using CDIS service and adding rewards and coupons
                #region Step9: Adding member with CDIS service
                cdis_Service_Method = new CDIS_Service_Methods(common);
                testStep            = TestStepHelper.StartTestStep(testStep);
                stepName            = "Adding member with CDIS service";
                Member output = basePages.CreateMemberThroughCDIS();
                testStep.SetOutput("Member UserName:"******"; Member First Name:" + output.FirstName);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10: Getting Coupon Definitions from Service
                IList <VirtualCard> vc = output.GetLoyaltyCards();
                testStep = TestStepHelper.StartTestStep(testStep);
                stepName = "Getting Coupon Definitions from Service";
                GetCouponDefinitionsOut def = cdis_Service_Method.GetCouponDefinitions();
                testStep.SetOutput("First Coupon Name : " + def.CouponDefinition[1].Name);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11: Adding Coupon to  member from Service
                testStep = TestStepHelper.StartTestStep(testStep);
                stepName = "Adding Coupon to  member from Service";
                long memberCouponId = cdis_Service_Method.AddMemberCoupon(vc[0].LoyaltyIdNumber, def.CouponDefinition[0].Id);
                testStep.SetOutput("MemberCoupon Added to the user : "******"API"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12: Get Recent Reward Catalog with CDIS service
                testStep = TestStepHelper.StartTestStep(testStep);
                stepName = "Get Recent Reward Catalog with CDIS service";
                RewardCatalogSummaryStruct[] rewardCatalog = cdis_Service_Method.GetRecentRewardCatalog(0, 0, 0);
                RewardCatalogSummaryStruct   reward        = new RewardCatalogSummaryStruct();
                foreach (RewardCatalogSummaryStruct r in rewardCatalog)
                {
                    if (r.CurrencyToEarn == 0)
                    {
                        reward = r;
                        break;
                    }
                }
                testStep.SetOutput("RewardID:" + reward.RewardID + " and the reward name is :" + reward.RewardName);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step13: Add Members to Reward Catalog with CDIS service
                vc       = output.GetLoyaltyCards();
                testStep = TestStepHelper.StartTestStep(testStep);
                stepName = "Add Members to Reward Catalog with CDIS service";
                AddMemberRewardsOut memberRewardsOut = (AddMemberRewardsOut)cdis_Service_Method.AddMemberRewards(vc[0].LoyaltyIdNumber, vc[0].LoyaltyIdNumber, reward);
                testStep.SetOutput("The reward with RewardID:" + memberRewardsOut.MemberRewardID + " has been added to the member with IPCODE: " + output.IpCode);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API"));
                listOfTestSteps.Add(testStep);
                #endregion
                #endregion

                #region Part3: Verifying the social media share options on Member Portal
                #region Step14:Launch Member Portal
                stepName = "Launch Member Portal URL";
                testStep = TestStepHelper.StartTestStep(testStep);
                MPortal_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out string Output);
                testStep.SetOutput(Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step15: Login As Member
                stepName       = "Login As Member User";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = output.Username;
                login.Password = "******";
                MPortal_LoginPage.LoginMemberPortal(login.UserName, login.Password, out string Message);
                testStep.SetOutput(Message);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step16: Navigate to Mywallet page
                stepName = "Navigate to Mywallet page";
                testStep = TestStepHelper.StartTestStep(testStep);
                MPortal_MyAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyWallet, out string message);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step17: Verify My Reward Social media share options
                stepName = "Verify My Reward Social Media Share Options";
                testStep = TestStepHelper.StartTestStep(testStep);
                MPortal_MyWalletPage.VerifySociaMediaOptionsForRewardsAndCoupons("rewards", out var Step_Output);
                testStep.SetOutput(Step_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step18: Verify My Coupons Social media share options
                stepName = "Verify My Coupons Social Media Share Options";
                testStep = TestStepHelper.StartTestStep(testStep);
                MPortal_MyAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyWallet, out message);
                var stepstatus = MPortal_MyWalletPage.VerifySociaMediaOptionsForRewardsAndCoupons("coupons", out Step_Output);
                testStep.SetOutput(Step_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step19: Logout from member portal
                stepName = "Logout from Member Portal";
                testStep = TestStepHelper.StartTestStep(testStep);
                MPortal_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion
                #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 #6
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);
            }
        }
        public void BTA_105_LN_Programa_Components_Tier_VerifyTheWarningMessageInDefaultRewardPageWhenThereIsNoTierCreated()
        {
            #region Object Initialization
            bool             stepstatus     = true;
            CategoryFields   product        = new CategoryFields();
            Migration        Migration      = new Migration(driverContext);
            ProjectBasePage  basePages      = new ProjectBasePage(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 Program_ComponentsPage      = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var navigator_Users_Program_Components_TiersPage = new Navigator_Users_Program_Components_TiersPage(DriverContext);
            var attributesPage            = new Navigator_Users_Program_Components_AttributesPage(driverContext);
            var Program_RewardCatalogPage = new Navigator_Users_Program_RewardCatalogPage(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, stepstatus, 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);
                //navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Select a newly created environment
                stepName = "Select a newly created environment";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext);
                navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(Migration.MigrationEnvironment, Migration.MigrationOrderId, out string _output); testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Select the program application and verify the program configuration panel displayed
                stepName = "Select the program application and verify the program configuration panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                testStep.SetOutput("Program configuration panel opened successfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Select the tier application under components and verify the tiers panel displayed
                stepName = "Select the tier application under components and verify the tiers panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Tiers);
                testStep.SetOutput("Tiers panel opened successfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Verify there is no tier displayed
                stepName   = "Verify there is no tier displayed";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = navigator_Users_Program_Components_TiersPage.VerifyThereISNoTierDisplayed(out string outMessage);
                testStep.SetOutput(outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Navigate to default rewards page and verify the warning message
                stepName = "Navigate to default rewards page and verify the warning message";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.DefaultRewards);
                stepstatus = navigator_Users_Program_Components_TiersPage.VerifyTheWarningMessageInDefaultRewardPage(out outMessage);
                testStep.SetOutput(outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, 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_71_LN_CloneProduct()
        {
            #region Object Declaration
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            CategoryFields   product                 = new CategoryFields();
            ProjectBasePage  basePages               = new ProjectBasePage(driverContext);
            NonAdminUserData data                    = new NonAdminUserData(driverContext);
            var    application_Nav_Util_Page         = new Application_Nav_Util_Page(DriverContext);
            var    rewardCatlog_productImagePage     = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext);
            var    navigator_Users_ProgramPage       = new Navigator_Users_ProgramPage(DriverContext);
            var    Program_ComponentsPage            = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var    navigator_CreateProduct_Category  = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var    navigator_CreateBonus             = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext);
            var    RewardCatalog_ProductsPage        = new Navigator_Users_Program_RewardCatalog_ProductsPage(DriverContext);
            var    Program_RewardCatalogPage         = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var    RewardCatalog_RewardsPage         = new Navigator_Users_Program_RewardCatalog_RewardsPage(DriverContext);
            var    RewardCatalog_ProductVariantsPage = new Navigator_Users_Program_RewardCatalog_ProductVariantsPage(DriverContext);
            var    navigator_LoginPage               = new Navigator_LoginPage(DriverContext);
            string stepName = "";
            #endregion
            try
            {
                #region Object Initialization
                product.SetType = "Product Name";
                var attName = data.AttributeAllContentType;
                #endregion

                #region Step1: Launch Navigator Portal
                stepName = "Launch 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 Step2: Login As User Admin
                stepName       = "Login As User Admin 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 the existence of category and create category if doesn't exist
                stepName = "Verify the existence of category and create category if doesn't exist";
                product.CategoryTypeValue = CategoryFields.CategoryType.Product.ToString();
                product.CategoryName      = data.ProductCategoryName;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories);
                testStep.SetOutput(navigator_CreateProduct_Category.CreateCategory(product));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create new product and Verify
                var contentType = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Product;
                product.Name                  = data.ProductName + RandomDataHelper.RandomString(4);
                product.AttributeName         = attName + contentType.ToString();
                product.ValueToSetInAttribute = "ValueGivenForAttributeSetProduct";
                stepName = "Create New Product with Category as " + product.Name + "";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products);
                testStep.SetOutput(RewardCatalog_ProductsPage.CreateProduct_With_ProductCategory(product));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Search and Clone the newly created product
                stepName = "Search and Clone the newly created product";
                testStep.SetOutput(RewardCatalog_ProductsPage.CloneProduct(product, product.SetType, product.Name, product.CategoryName));
                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_70_LN_ProductCount_AfterAppeasements()
        {
            #region Object Declaration
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            Common           common               = new Common(DriverContext);
            CategoryFields   product              = new CategoryFields();
            ProjectBasePage  basePages            = new ProjectBasePage(driverContext);
            NonAdminUserData data                 = new NonAdminUserData(driverContext);
            var application_Nav_Util_Page         = new Application_Nav_Util_Page(DriverContext);
            var rewardCatlog_productImagePage     = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext);
            var navigator_Users_ProgramPage       = new Navigator_Users_ProgramPage(DriverContext);
            var Program_ComponentsPage            = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var navigator_CreateProduct_Category  = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var navigator_CreateBonus             = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext);
            var RewardCatalog_ProductsPage        = new Navigator_Users_Program_RewardCatalog_ProductsPage(DriverContext);
            var Program_RewardCatalogPage         = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var RewardCatalog_RewardsPage         = new Navigator_Users_Program_RewardCatalog_RewardsPage(DriverContext);
            var RewardCatalog_ProductVariantsPage = new Navigator_Users_Program_RewardCatalog_ProductVariantsPage(DriverContext);
            var navigator_LoginPage               = new Navigator_LoginPage(DriverContext);
            var CSP_LoginPage        = new CSPortal_LoginPage(DriverContext);
            var CSPSearchPage        = new CSPortal_SearchPage(DriverContext);
            var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext);
            var CSP_HomePage         = new CSPortal_HomePage(DriverContext);
            var cSPortal_CustomerAppeasementsPage = new CSPortal_CustomerAppeasementsPage(DriverContext);
            var MPortal_LoginPage = new MemberPortal_LoginPage(DriverContext);
            var MP_MyAccountPage  = new MemberPortal_MyAccountPage(DriverContext);
            var myAccountPage     = new MemberPortal_MyAccountPage(driverContext);
            var myWalletPage      = new MemberPortal_MyWalletPage(driverContext);
            var Mp_LoginPage      = new MemberPortal_LoginPage(DriverContext);
            CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common);
            string stepName = "";
            #endregion
            try
            {
                #region Object Initialization
                var attName = data.AttributeAllContentType;
                product.SetType = "Product Name";
                Member output          = cdis_Service_Method.GetCDISMemberGeneral();
                IList <VirtualCard> vc = output.GetLoyaltyCards();
                #endregion

                #region Step1: Launch Navigator Portal
                stepName = "Launch 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 Step2: Login As User Admin
                stepName       = "Login As User Admin 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 the existence of category and create category if doesn't exist
                stepName = "Verify the existence of category and create category if doesn't exist";
                product.CategoryTypeValue = CategoryFields.CategoryType.Product.ToString();
                product.CategoryName      = data.ProductCategoryName;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories);
                testStep.SetOutput(navigator_CreateProduct_Category.CreateCategory(product));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create a new Product with quantity as 3 and search the newly created product
                var contentType = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Product;
                product.Name                  = data.ProductName + RandomDataHelper.RandomString(4);
                product.AttributeName         = attName + contentType.ToString();
                product.ValueToSetInAttribute = "ValueGivenForAttributeSetProduct";
                stepName = "Create New Product with Qunatity as " + product.Name + "";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products);
                testStep.SetOutput(RewardCatalog_ProductsPage.CreateProductWithQuantity(product, product.ProductQuantity));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Verify LW_product table to see if quantity is showing up as 3
                stepName = "Verify LW_product table to see if quantity is showing up as 5";
                List <string> TransactionList_Header = new List <string>();
                testStep = TestStepHelper.StartTestStep(testStep);
                var Name = ProjectBasePage.GetProductDetailsFromProductTableFromDB(product.Name, product.Quantity, out string Step_Output);
                testStep.SetOutput(Step_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Create new reward and Verify
                CategoryFields reward = new CategoryFields();
                reward.Name              = data.RewardName + RandomDataHelper.RandomString(5);
                reward.BalanceNeeded     = "0";
                reward.CategoryTypeValue = product.Name;
                reward.SetType           = "Reward Name";
                var date = DateTime.Now;
                reward.StartDate             = date.ToString("MM/dd/yyyy  HH:mm:ss", new CultureInfo("en-US"));
                reward.ExpiryDate            = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US"));
                stepName                     = "Create new reward for product as " + reward.Name + "";
                testStep                     = TestStepHelper.StartTestStep(testStep);
                reward.ValueToSetInAttribute = "ValueGivenForAttributeSetReward";
                contentType                  = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Reward;
                reward.AttributeName         = attName + contentType.ToString();
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Rewards);
                testStep.SetOutput(RewardCatalog_RewardsPage.CreateReward_With_Product(reward));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: Make Reward Customer Appeasement
                stepName = "Make Reward Customer Appeasement ";
                RewardCatalogSummaryStruct rewarddata = new RewardCatalogSummaryStruct();
                rewarddata.RewardName = reward.Name;
                rewarddata.TypeCode   = RandomDataHelper.RandomString(5);
                testStep = TestStepHelper.StartTestStep(testStep);
                stepName = "Appease Rewards to Members using SOAP Services";
                RewardCatalog_RewardsPage.RewardCustomerAppeasement(product.ProductQuantity, vc[0].LoyaltyIdNumber, rewarddata);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: Verify LW_product table to see if quantity is showing up as 3
                stepName = "Verify LW_product table to see if quantity is showing up as 5";
                testStep = TestStepHelper.StartTestStep(testStep);
                var result = RewardCatalog_RewardsPage.VerifyProductQuantityAfterRewardCustomerAppeasement(product);
                testStep.SetOutput(Step_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, result, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: 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 #10
0
        public void BTA_25_LN_EditUserRole()
        {
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";

            try
            {
                #region Object initialization
                var    navigator_LoginPage       = new Navigator_LoginPage(DriverContext);
                var    application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext);
                var    adminPage     = new Navigator_Admin_UsersPage(driverContext);
                string adminUserName = adminPage.GetUserName(NavigatorUsers.AdminUser, Users.AdminRole.LWADM.ToString());
                string WebuserName   = adminPage.GetUserName(NavigatorUsers.WebUser, Users.AdminRole.WEB.ToString());
                WebuserName = ProjectBasePage.GetUserInfo("RegressionUser", "username");
                //WebuserName + "_" + RandomDataHelper.RandomString(5);
                string DbauserName = adminPage.GetUserName(NavigatorUsers.DBAUser, Users.AdminRole.DBA.ToString());
                #endregion

                #region Step1: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 Step2:Login to Navigator using LWAdminUser
                stepName       = "Login to Navigator using LWAdminUser";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.AdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.LWADM.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create WEBAdmin user and assign role
                stepName = "Verify Regression user and assign role as Web Admin user";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users);
                var user = adminPage.UserDetails(WebuserName, password);
                testStep.SetOutput(adminPage.Create_AdminUsers(user, Users.AdminRole.WEB.ToString()));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

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

                #region Step5:Login to Navigator using WEBAdmin
                stepName       = "Login to Navigator using Regression User";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = WebuserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.WEB.ToString(), out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

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

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

                #region Step8:Login to Navigator using LWAdminUser
                stepName       = "Login to Navigator using LWAdminUser";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.AdminUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.LWADM.ToString(), out string stroutput1); testStep.SetOutput(stroutput1);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: Update WEBAdmin user to DBAAdmin user
                stepName = "Update Regression user to DBAAdmin user";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users);
                var user1 = adminPage.UserDetails(WebuserName, password);
                adminPage.ClickEditUser_And_AssignRoles(WebuserName, Users.AdminRole.DBA.ToString());
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

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

                #region Step11:Login to Navigator using BTADBAADMIN
                stepName       = "Login to Navigator using Regression User";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = DbauserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12:Logout from BTADBAADMIN
                stepName = "Logout from BTADBAADMIN";
                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 #11
0
        public void BTA_26_LN_EditUserInformationAndPassword()
        {
            ProjectBasePage basePages = new ProjectBasePage(driverContext);

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

            try
            {
                #region Object Initialization
                var navigator_LoginPage       = new Navigator_LoginPage(DriverContext);
                var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext);
                var adminPage = new Navigator_Admin_UsersPage(driverContext);

                string adminUserName = adminPage.GetUserName(NavigatorUsers.AdminUser, Users.AdminRole.LWADM.ToString());
                string DbauserName   = ProjectBasePage.GetUserInfo("RegressionUser", "username");
                #endregion

                #region Step1 - 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 Step2 - Login to Navigator using  LoyaltyWare Administrator
                stepName       = "Login to Navigator using  LoyaltyWare Administrator";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = adminUserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.LWADM.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create DBAAdmin user and assign role
                stepName = "Create DBAAdmin user and assign role";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users);
                var user = adminPage.UserDetails(DbauserName, password);
                testStep.SetOutput(adminPage.Create_AdminUsers(user, Users.AdminRole.DBA.ToString()));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 4 - Logout from  LoyaltyWare Administrator
                stepName = "Logout from  LoyaltyWare Administrator";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Login to Navigator using BTADBAADMIN
                stepName       = "Login to Navigator using BTADBAADMIN";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = DbauserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

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

                #region Step7 - Login to Navigator using  LoyaltyWare Administrator
                stepName       = "Login to Navigator using  LoyaltyWare Administrator";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = adminUserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.LWADM.ToString(), out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8 - Click the Edit User action for the newly-created user and verify the user loaded in edit mode
                stepName = "Click the Edit User action for the newly-created user and verify the user loaded in edit mode";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users);
                testStep.SetOutput(adminPage.ClickEditUser_And_VerifyTheEditModeAndRolesTab(user));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9 - Update user information and save
                stepName = "Update user information and save";
                testStep = TestStepHelper.StartTestStep(testStep);
                adminPage.EditUser(user);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step 10 - Logout from  LoyaltyWare Administrator
                stepName = "Logout from  LoyaltyWare Administrator";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_LoginPage.Logout();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11:Login to Navigator using updated BTADBAADMIN credentials
                stepName       = "Login to Navigator using updated BTADBAADMIN credentials";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = user.UserName;
                login.Password = user.Password;
                navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12:Logout from BTADBAADMIN
                stepName = "Logout from BTADBAADMIN";
                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 #12
0
        public void BTA_7_LN_ChangeKeys()
        {
            ProjectBasePage basePages = new ProjectBasePage(driverContext);

            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName   = "";
            string stepOutput = "";

            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 stepOutput); testStep.SetOutput(stepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2:Login As Key Admin User
                stepName = "Login As Key Admin User and Navigate to Keys Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                var navigator_KeyUser_HomePage = new Navigator_KeysHomePage(DriverContext);
                var navigator_MangeKeysPage    = new Navigator_ManageKeysPage(DriverContext);
                login.UserName = NavigatorUsers.KEYUser;
                login.Password = NavigatorUsers.NavigatorPassword;
                navigator_LoginPage.Login(login, Users.AdminRole.KEY.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                navigator_KeyUser_HomePage.NavigatetoMangeKeys_Page(out stepName);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Select Organization and Environment
                stepName = "Select Organization and Environment";
                testStep = TestStepHelper.StartTestStep(testStep);
                var    navigator_DBDevHomePage = new Navigator_DBFramework_Page(DriverContext);
                string Org_Output; string Env_Output;
                navigator_DBDevHomePage.DrillDownTestOrg(out Org_Output);
                navigator_DBDevHomePage.SelectTestEnvironment(out Env_Output); testStep.SetOutput(Org_Output + ";" + Env_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:ChangeKey
                stepName = "ChangeKey";
                testStep = TestStepHelper.StartTestStep(testStep);
                var output = navigator_MangeKeysPage.ChangeKey("Password1*", "512", out stepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, output, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: LogOut
                stepName = "Logout as KEYADMIN";
                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.SetOutput(stepName + 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 #13
0
        public void BTA_27_Navigator_LN_DeleteUser()
        {
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";

            try
            {
                #region Object initialization
                var    navigator_LoginPage       = new Navigator_LoginPage(DriverContext);
                var    application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext);
                var    adminPage   = new Navigator_Admin_UsersPage(driverContext);
                string DbauserName = adminPage.GetUserName(NavigatorUsers.DBAUser, Users.AdminRole.DBA.ToString());

                DbauserName = ProjectBasePage.GetUserInfo("RegressionUser", "username");
                string adminUserName = adminPage.GetUserName(NavigatorUsers.AdminUser, Users.AdminRole.LWADM.ToString());
                #endregion

                #region Step1: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 Step2:Login to Navigator using LWAdminUser
                stepName       = "Login to Navigator using LWAdminUser";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = adminUserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.LWADM.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Create DBAAdmin user and assign role
                stepName = "Create DBAAdmin user and assign role";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users);
                var user = adminPage.UserDetails(DbauserName, password);
                testStep.SetOutput(adminPage.Create_AdminUsers(user, Users.AdminRole.DBA.ToString()));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Delete Newely Created User
                stepName = "Delete Newely Created User";
                testStep = TestStepHelper.StartTestStep(testStep);
                testStep.SetOutput(adminPage.Delete_AdminUsers(user));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

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

                #region Step6:Login to Navigator using Deleted User and Verify
                stepName       = "Login to Navigator using Deleted User and Verify";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = DbauserName;
                login.Password = password;
                navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out stroutput); testStep.SetOutput(stroutput);
                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 #14
0
        public void BTA_228_LN_CreateNewJobInSchedulePage()
        {
            #region Object Initialization
            CategoryFields   coupon    = new CategoryFields();
            ProjectBasePage  basePages = new ProjectBasePage(driverContext);
            NonAdminUserData data      = new NonAdminUserData(driverContext);
            var            application_Nav_Util_Page      = new Application_Nav_Util_Page(DriverContext);
            var            navigator_Users_ProgramPage    = new Navigator_Users_ProgramPage(DriverContext);
            var            Program_RewardCatalogPage      = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var            RewardCatalog_ExchangeRatePage = new Navigator_Users_Program_RewardCatalog_ExchangeRatesPage(DriverContext);
            CategoryFields rate = new CategoryFields();
            CategoryFields job  = new CategoryFields();
            job.Name = data.JobName;
            job.FrequencyDropDown = CategoryFields.FrequencyType.Hourly.ToString();
            job.Hour = job.RunEveryHour;
            var date = DateTime.Now;
            job.StartDate   = DateHelper.GetDate("Current");
            job.ExpiryDate  = DateHelper.GetDate("Future");
            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 Step9: Create New Job and verify the Job is created successfully
                stepName = "Create New Job and verify the Job is created successfully";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.ExchangeRates);
                RewardCatalog_ExchangeRatePage.NavigateToExchangeRatesTab(Navigator_Users_Program_RewardCatalog_ExchangeRatesPage.ExchangeTabs.Schedule);
                RewardCatalog_ExchangeRatePage.CreateJobAndVerifyCreatedJobInSchedulePage(job);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10: 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 + e, 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 #15
0
        public void BTA_224_LN_Regression_Navigator_Store_CreateAndEditStore()
        {
            #region Object Initialization
            bool             stepstatus                  = true;
            ProjectBasePage  basePages                   = new ProjectBasePage(driverContext);
            NonAdminUserData WebsiteData                 = new NonAdminUserData(driverContext);
            var   navigator_Users_ProgramPage            = new Navigator_Users_ProgramPage(DriverContext);
            var   navigator_Users_Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var   application_Nav_Util_Page              = new Application_Nav_Util_Page(DriverContext);
            var   StorePage = new Navigator_Users_Program_Components_StoresPage(driverContext);
            Store store     = new Store
            {
                StoreNumber = RandomDataHelper.RandomNumber(4),
                StoreName   = "Auto_Store" + RandomDataHelper.RandomString(4),
                PhoneNumber = RandomDataHelper.RandomNumber(10),
                City        = "TestCity",
                State       = "TestState",
                Country     = "TestCountry",
                Address     = "TestAddress"
            };

            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, stepstatus, 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, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Select the program application and verify the program configuration panel displayed
                stepName = "Select the program application and verify the program configuration panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                testStep.SetOutput("Program configuration panel opened successfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create new Store
                stepName = "Create new Store";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Stores);
                StorePage.CreateStore(store, out string msg);
                testStep.SetOutput(msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Verify the presence of newly created store in the grid
                stepName = "Verify the presence of newly created store in the grid";
                testStep = TestStepHelper.StartTestStep(testStep);
                StorePage.VerifyTheExistanceOfStore(store, out msg);
                testStep.SetOutput(msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Edit and Verify the updated store details
                stepName = "Edit and Verify the updated store details";
                testStep = TestStepHelper.StartTestStep(testStep);
                StorePage.EditAndVerify_StoreDetails(store, out msg);
                testStep.SetOutput(msg);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: 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 #16
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);
            }
        }
Example #17
0
        public void BTA82_Navigator_GenerateDBConfig()
        {
            ProjectBasePage basePages = new ProjectBasePage(driverContext);

            testStep = new TestStep();
            MethodBase method     = MethodBase.GetCurrentMethod();
            string     methodName = method.Name;

            testCase = new TestCase(methodName);


            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName   = "";
            string StepOutput = "";
            bool   stepstatus;

            try
            {
                #region :OrderExection Requirement
                string Prereq_testCase = "BTA79_Navigator_CreateDBAAdminUser_And_Login_With_DBAAdminUser";
                ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep);
                #endregion

                #region Step1:Verify Key Files Existed ,If Existed Delete Existed Files
                stepName = "Delete Existed DBConfig.dat File From :" + basePages.ConfigDownloadPath;
                testStep = TestStepHelper.StartTestStep(testStep);

                string dbFile = basePages.ConfigDownloadPath + @"\DBConfig.dat";
                basePages.DeleteExistedFile(dbFile);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step2: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 Step3:Login As DB Admin User
                stepName       = "Login As DB Admin User and Navigate to Keys Page";
                testStep       = TestStepHelper.StartTestStep(testStep);
                login.UserName = NavigatorUsers.DBAUser;
                login.Password = NavigatorUsers.DBAUser_Password;
                navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out string stroutput); testStep.SetOutput(stroutput);
                var navigator_DBUser_HomePage = new Navigator_DBHomePage(DriverContext);
                navigator_DBUser_HomePage.NavigatetoDatabases_Page(out StepOutput); testStep.SetOutput(StepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Select Organization and Environment
                stepName = "Select Organization and Environment";
                testStep = TestStepHelper.StartTestStep(testStep);
                var    navigator_DBDevHomePage = new Navigator_DBFramework_Page(DriverContext);
                string Org_Output; string Env_Output;
                navigator_DBDevHomePage.DrillDownOrg(out Org_Output);
                navigator_DBDevHomePage.SelectEnvironment(out Env_Output);
                testStep.SetOutput(Org_Output + ";" + Env_Output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Creating DB Connection is not existed ,Generate DBConfig
                stepName = "Creating DB Connection";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_DBDevHomePage.CreatingDBConnection(db.Name, db.DataBasesType, db.UserID, db.Password, db.DefaultSchema, db.Server, db.Database, db.ConnectionProps, out StepOutput); testStep.SetOutput(StepOutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Generate DBConfig file and Download
                stepName   = "Generate DBConfig file and Download";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = navigator_DBDevHomePage.Download_DBConfigFile(dbFile, out StepOutput); testStep.SetOutput(StepOutput);
                testStep   = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7:Create Config Folder for Organization if not existed
                stepName = "Create Config Folder for Organization if not existed";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.CreateOrVerfiyConfigFolder();
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: Copy DB file
                stepName = "Copy DBConfig file to Config folder";
                testStep = TestStepHelper.StartTestStep(testStep);
                basePages.CopyFile(dbFile, basePages.ConfigUploadPath + @"\DBConfig.dat");
                stepstatus = basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\DBConfig.dat", "DBConfig.datFile uploaded Successfully in config path:" + basePages.ConfigUploadPath, out StepOutput); testStep.SetOutput(StepOutput);
                testStep   = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: Initialize DB Framework if the DB is not Initialized
                stepName   = "Initialize DB Framework if the DB is not Initialized";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = navigator_DBDevHomePage.InitializeFrameworkDB(true, true, out StepOutput); testStep.SetOutput(StepOutput);

                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10: LogOut
                testStep = TestStepHelper.StartTestStep(testStep);
                if (StepOutput.Contains("New DB Initialization is Completed"))
                {
                    stepName = "Verfiying intialization";

                    //navigator_LoginPage.Logout();
                    //navigator_LoginPage.Login(login, Users.AdminRole.DBA.ToString(), out stroutput);
                    navigator_DBUser_HomePage.NavigatetoDatabases_Page(out StepOutput);
                    navigator_DBDevHomePage.DrillDownOrg(out Org_Output);
                    navigator_DBDevHomePage.SelectEnvironment(out Env_Output);
                    stepstatus = navigator_DBDevHomePage.InitializeFrameworkDB(true, true, out StepOutput); testStep.SetOutput(StepOutput);
                }

                stepName = "Logout User";
                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 + e, false, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                testCase.SetStatus(false);
                testCase.SetErrorMessage(e.Message);
                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 #18
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);
            }
        }
        public void BTA_263_LN_Migration_Email()
        {
            #region Object Initialization
            Migration        Migration       = new Migration(driverContext);
            ProjectBasePage  basePages       = new ProjectBasePage(driverContext);
            NonAdminUserData WebsiteData     = new NonAdminUserData(driverContext);
            var    application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext);
            var    EmailPage = new Navigator_EmailMessagePage(DriverContext);
            var    navigator_Users_EmailAWSPage = new Navigator_AWSEmail_EmailsPage(DriverContext);
            bool   StepStatus       = true;
            string randomStr        = RandomDataHelper.RandomString(4);
            string EmailMessageName = ProjectBasePage.Orgnization_value + WebsiteData.EmailMessageName + randomStr;
            string Description      = "Description";
            string DMCCode          = WebsiteData.DMCCode;
            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 new email message
                stepName = "Create new email message";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.email);
                StepStatus = EmailPage.CreateNewEmailMessage(EmailMessageName, Description, DMCCode, out string outMessage);
                testStep.SetOutput(outMessage);
                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: 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_Email.ToString() + "_" + DateHelper.GetDate("Current");
                _MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Email.ToString(), out string output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: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 Step7: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.SelectItemsForAWSEMail(false, "", EmailMessageName, out _output);
                testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: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 Step9: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 Step10: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 Step11:Verify migrated email message displayed on Email Messages page
                stepName = "Verify migrated email message displayed on Email Messages page";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.email);
                StepStatus = EmailPage.VerifyMailingNameMessageDetails(EmailMessageName, DMCCode);
                if (StepStatus)
                {
                    testStep.SetOutput(" Email :" + EmailMessageName + " Migrated Successfully and Appeared on Mails Page");
                }
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12: 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 BTA225_Navigator_Email_Create_Update_Delete_EmailMessages()
        {
            #region Objects
            ProjectBasePage basePages = new ProjectBasePage(driverContext);
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string stepName = "";
            bool   StepStatus;
            login.UserName = NavigatorUsers.NonAdminUser;
            login.Password = NavigatorUsers.NavigatorPassword;
            NonAdminUserData EmailInfo        = new NonAdminUserData(driverContext);
            string           EmailMessageName = ProjectBasePage.Orgnization_value + EmailInfo.EmailMessageName + "_" + RandomDataHelper.RandomString(4);;
            string           Description      = "Description";
            string           DMCCode          = EmailInfo.DMCCode;
            #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);
                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:Navigating Email Page
                stepName = "Navigating Email Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                var Website = new Application_Nav_Util_Page(DriverContext);
                Website.OpenApplication(NavigatorEnums.ApplicationName.email);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Create new MailingName Messsage, if the MailingName is not existed
                stepName = "Create new MailingName Messsage, if the MailingName is not existed ";
                testStep = TestStepHelper.StartTestStep(testStep);
                var EmailPage = new Navigator_EmailMessagePage(DriverContext);
                StepStatus = EmailPage.CreateNewEmailMessage(EmailMessageName, Description, DMCCode, out string stepoutput);
                testStep.SetOutput(stepoutput);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Update and Verify if the Mailing Description Updated with new description
                stepName    = "Update and Verify if the Mailing Description Updated with new description";
                testStep    = TestStepHelper.StartTestStep(testStep);
                Description = "UpdatedDescription";
                StepStatus  = EmailPage.UpdateEmailMessage(EmailMessageName, Description, DMCCode, out string UpdateStatus);
                testStep.SetOutput(UpdateStatus);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6:Delete and Verify if the Mail deleted successfully or not
                stepName    = "Delete and Verify if the Mail deleted successfully or not";
                testStep    = TestStepHelper.StartTestStep(testStep);
                Description = "UpdatedDescription";
                StepStatus  = EmailPage.DeleteEmailMessage(EmailMessageName, Description, DMCCode, out string deleteStatus);
                testStep.SetOutput(deleteStatus);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: LogOut
                stepName = "Logout as USER Admin With All roles";
                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 + e, 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_103_LN_Programa_Components_Tier_CreateTier()
        {
            #region Object Initialization
            bool             stepstatus     = true;
            CategoryFields   product        = new CategoryFields();
            ProjectBasePage  basePages      = new ProjectBasePage(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 Program_ComponentsPage      = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var navigator_Users_Program_Components_TiersPage = new Navigator_Users_Program_Components_TiersPage(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, stepstatus, 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, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3:Select the program application and verify the program configuration panel displayed
                stepName = "Select the program application and verify the program configuration panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                testStep.SetOutput("Program configuration panel opened successfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Select the tier application under components and verify the tiers panel displayed
                stepName = "Select the tier application under components and verify the tiers panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Tiers);
                testStep.SetOutput("Tiers panel opened successfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5:Create a new tier and verify it is present in the grid
                string TierName = CategoryFields.TierType.Tier_Defaults.ToString() + RandomDataHelper.RandomAlphanumericString(4);
                stepName   = "Create a new tier and verify it is present in the grid";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = navigator_Users_Program_Components_TiersPage.CreateTierAndVerify(TierName, out string outMessage);
                testStep.SetOutput(outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, 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_102_LN_Migration_Email_AWS()
        {
            #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_EmailAWSPage = new Navigator_AWSEmail_EmailsPage(DriverContext);

            string randomStr            = RandomDataHelper.RandomString(4);
            string template             = WebsiteData.AWSEmailTemplate;
            string template_description = "Testing";
            string awsEmailName         = WebsiteData.AWSEmailName + randomStr;
            string subject   = WebsiteData.Subject + randomStr;
            string fromEmail = WebsiteData.FromMail;

            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: Verify Email Template exists if not create one
                stepName = "Verify Email Template exists if not create one ";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.email_aws);
                navigator_Users_EmailAWSPage.NavigateToEmailAWSTab(Navigator_AWSEmail_EmailsPage.AWSEMailTabs.Templates);
                navigator_Users_EmailAWSPage.CreateNewTemplate(template, template_description, out string outMessage);
                testStep.SetOutput(outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create new AWS email message
                stepName = "Create new AWS email message";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_EmailAWSPage.NavigateToEmailAWSTab(Navigator_AWSEmail_EmailsPage.AWSEMailTabs.Emails);
                navigator_Users_EmailAWSPage.CreateNewAWSEmailMessage(awsEmailName, template, subject, fromEmail, out outMessage);
                testStep.SetOutput(outMessage);
                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: 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_EmailAWS.ToString() + "_" + DateHelper.GetDate("Current");
                _MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_EmailAWS.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.SelectItemsForAWSEMail(false, "", awsEmailName, 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 Email(AWS) migrated on mails page
                stepName = "Verify Email(AWS) migrated on mails page";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.email_aws);
                navigator_Users_EmailAWSPage.NavigateToEmailAWSTab(Navigator_AWSEmail_EmailsPage.AWSEMailTabs.Emails);
                bool status = navigator_Users_EmailAWSPage.VerifyMailWithTemplate(awsEmailName, template);
                if (status)
                {
                    testStep.SetOutput(" Email :" + awsEmailName + " Migrated Successfully and Appeared on Mails Page");
                }
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step15: 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);
            }
        }
Example #24
0
        public void BTA_75_LN_VerifyFinishedWithErrorsMessageShownWhileMigratingProductImage()
        {
            #region Object Initialization
            bool             stepstatus       = true;
            CategoryFields   product          = new CategoryFields();
            Migration        Migration        = new Migration(driverContext);
            ProjectBasePage  basePages        = new ProjectBasePage(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 Program_RewardCatalogPage     = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var rewardCatlog_productImagePage = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext);
            product.CategoryName = WebsiteData.ProductCategoryName;
            product.Name         = WebsiteData.ProductName;
            string imageName  = Migration.MigrationSets.Migration_ProductImage.ToString() + RandomDataHelper.RandomString(5);
            string imageOrder = WebsiteData.ProductImageOrder;
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string Status   = "FinishedWithErrors";
            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, stepstatus, 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, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step3: Select the program application and verify the program configuration panel displayed
                stepName = "Select the program application and verify the program configuration panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                testStep.SetOutput("Program configuration panel opened successfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Click on reward catalog and verify product images tab displayed
                stepName = "Click on reward catalog and verify product images tab displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                testStep.SetOutput("Reward catalog panel opened successfully with all the tabs including product image");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: Click on product images tab and verify product images panel displayed
                stepName = "Click on product images tab and verify product images panel displayed";
                testStep = TestStepHelper.StartTestStep(testStep);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.ProductImages);
                testStep.SetOutput("Product images panel Openedsuccessfully");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: Verify the existence of category and create category if doesn't exist
                stepName = "Verify the existence of category and create category if doesn't exist";
                testStep = TestStepHelper.StartTestStep(testStep);
                rewardCatlog_productImagePage.VerifyCategoryExistanceAndCreateIfNotExists(product, out string outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step7: Verify the existence of product and create product if doesn't exist
                stepName = "Verify the existence of product and create product if doesn't exist";
                testStep = TestStepHelper.StartTestStep(testStep);
                rewardCatlog_productImagePage.VerifyProductExistanceAndCreateIfNotExists(product, out outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: Click on create new product image button and verify new product image panel opened successfully
                stepName   = "Click on create new product image button and verify new product image panel opened successfully";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = rewardCatlog_productImagePage.ClickOnCreateNewProductImageAndVerifyNewProductImagePanel(out outMessage);
                testStep.SetOutput(outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: Create a new product image
                stepName   = "Create a new product image";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = rewardCatlog_productImagePage.CreateProductImage(product, imageName, imageOrder, out outMessage);
                testStep.SetOutput(outMessage);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step10: Verify the product image displayed in the table
                stepName   = "Verify the product image displayed in the Product Image Grid";
                testStep   = TestStepHelper.StartTestStep(testStep);
                stepstatus = rewardCatlog_productImagePage.VerifyProductImageExists(imageName);
                testStep.SetOutput("ProductImage :" + imageName + " in the Product Image Grid");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step11: 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 Step12: 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_ProductImage.ToString() + "_" + DateHelper.GetDate("Current");
                MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_ProductImage.ToString(), out string output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step13: 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 Step14: Edit Items and Generate Items
                stepName = "Edit Items and Generate Items";
                testStep = TestStepHelper.StartTestStep(testStep);
                MigrationPage.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2));
                MigrationPage.SelectItemsForProductImage(imageName, out _output);
                testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step15: 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 Step16: 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 Step17: 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 Step18: Verify that the Finished with Errors status is displayed while migrating the image to an environment that doesn't have the associated product
                stepName = "Verify that the Finished with Errors status is displayed while migrating the image to an environment that doesn't have the associated product";
                testStep = TestStepHelper.StartTestStep(testStep);
                MigrationPage.VerifyErrorStatusInMigrationPage(Migration.BuildMigrationSetName, Status, out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step19: "Verify The product no longer exists in the destination database error message while migrating product image";
                stepName = "Verify The product with name " + imageName + " no longer exists in the destination database error message while migrating product image";
                testStep = TestStepHelper.StartTestStep(testStep);
                MigrationPage.VerifyProductNoLongerExistsExceptionInMigrationViewItemsPage(Migration.BuildMigrationSetName, Status, out output, imageName);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step20: 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 + e, 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 #25
0
        public void BTA118_Navigator_CreateSMSMessages()

        {
            ProjectBasePage  basePages  = new ProjectBasePage(driverContext);
            NonAdminUserData SmsData    = new NonAdminUserData(driverContext);
            MethodBase       method     = MethodBase.GetCurrentMethod();
            string           methodName = method.Name;

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

            login.UserName = NavigatorUsers.NonAdminUser;
            login.Password = NavigatorUsers.NavigatorPassword;
            string SMSMessageName = ProjectBasePage.Orgnization_value + SmsData.SMSMessageName;
            string Description    = "Description";
            string DMCCode        = SmsData.SMSDMCCode;


            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);
                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:Navigating SMS Page
                stepName = "Navigating SMS Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                var Website = new Application_Nav_Util_Page(DriverContext);
                Website.OpenApplication(NavigatorEnums.ApplicationName.sms);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4:Verify if the SMS Exists, if the SMS is not existed Create new SMS Messsage
                stepName = "Verify if the SMS Exists, if the SMS is not existed Create new SMS Messsage";
                testStep = TestStepHelper.StartTestStep(testStep);
                var SMSPage = new Navigator_SMSMessagePage(DriverContext);
                StepStatus = SMSPage.CreateNewSMSMessage(SMSMessageName, Description, DMCCode, out stroutput); testStep.SetOutput(stroutput);
                testStep   = TestStepHelper.EndTestStep(testCase, testStep, stepName, StepStatus, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step5: LogOut
                stepName = "Logout as USER Admin With All roles";
                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 + e, 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 #26
0
        public void BTA_73_LN_Migration_Product_With_AttributeSet()
        {
            #region Object Initialization
            CategoryFields   coupon                      = new CategoryFields();
            Migration        Migration                   = new Migration(driverContext);
            ProjectBasePage  basePages                   = new ProjectBasePage(driverContext);
            var              ProgramPage                 = new Navigator_Users_ProgramPage(driverContext);
            var              componentsPage              = new Navigator_Users_Program_ComponentsPage(driverContext);
            var              attributesPage              = new Navigator_Users_Program_Components_AttributesPage(driverContext);
            var              data                        = 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);
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            CategoryFields rate = new CategoryFields();
            rate.PredicateDropDown = CategoryFields.Predicates.Ne.ToString();
            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 attribute for Product content type
                stepName = "Create attribute for Product content type";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                componentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Attributes);
                testStep.SetOutput(attributesPage.CreateNewAttribute(Migration.MigrationSets.Migration_Product_AttributeSet.ToString()));
                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: 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_Product_AttributeSet.ToString() + "_" + DateHelper.GetDate("Current");
                MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Product_AttributeSet.ToString(), out string output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: 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 Step7: 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.SelectItemsForProductAttribute(Migration.MigrationSets.Migration_Product_AttributeSet.ToString(), out output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: 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 Step9: 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 Step10: 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 Step11: Verify Attribute Migrated on Attribute Page
                stepName = "Verify Attribute Migrated on Attribute Page";
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                componentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Attributes);
                attributesPage.VerifyAttributeExists(Migration.MigrationSets.Migration_Product_AttributeSet.ToString());
                testStep.SetOutput(" Attribute :" + Migration.MigrationSets.Migration_Product_AttributeSet.ToString() + " Migrated Successfully and appeared on Attribute Page");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12: 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 + e, 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 #27
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);
            }
        }
Example #28
0
        public void BTA_76_LN_Migrate_Product_And_VerifyProductMigrated()
        {
            #region Object Declaration
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            CategoryFields   product              = new CategoryFields();
            ProjectBasePage  basePages            = new ProjectBasePage(driverContext);
            NonAdminUserData data                 = new NonAdminUserData(driverContext);
            Migration        Migration            = new Migration(driverContext);
            var application_Nav_Util_Page         = new Application_Nav_Util_Page(DriverContext);
            var rewardCatlog_productImagePage     = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext);
            var navigator_Users_ProgramPage       = new Navigator_Users_ProgramPage(DriverContext);
            var Program_ComponentsPage            = new Navigator_Users_Program_ComponentsPage(DriverContext);
            var navigator_CreateProduct_Category  = new Navigator_Users_Program_Components_CategoriesPage(DriverContext);
            var navigator_CreateBonus             = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext);
            var RewardCatalog_ProductsPage        = new Navigator_Users_Program_RewardCatalog_ProductsPage(DriverContext);
            var Program_RewardCatalogPage         = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var RewardCatalog_RewardsPage         = new Navigator_Users_Program_RewardCatalog_RewardsPage(DriverContext);
            var RewardCatalog_ProductVariantsPage = new Navigator_Users_Program_RewardCatalog_ProductVariantsPage(DriverContext);
            var navigator_LoginPage               = new Navigator_LoginPage(DriverContext);
            product.Name = Migration.MigrationSets.Migration_Product.ToString() + RandomDataHelper.RandomString(4);
            string stepName = "";
            #endregion
            try
            {
                #region Object Initialization
                product.SetType = "Product Name";
                var attName = data.AttributeAllContentType;
                #endregion

                #region Step1: Launch Navigator Portal
                stepName = "Launch 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 Step2: Login As User Admin
                stepName       = "Login As User Admin 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 the existence of category and create category if doesn't exist
                stepName = "Verify the existence of category and create category if doesn't exist";
                product.CategoryTypeValue = CategoryFields.CategoryType.Product.ToString();
                product.CategoryName      = data.ProductCategoryName;
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components);
                Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories);
                testStep.SetOutput(navigator_CreateProduct_Category.CreateCategory(product));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step4: Create new product and Verify
                var contentType = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Product;
                product.AttributeName         = attName + contentType.ToString();
                product.ValueToSetInAttribute = "ValueGivenForAttributeSetProduct";
                stepName = "Create New Product with Category as " + product.Name + "";
                testStep = TestStepHelper.StartTestStep(testStep);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products);
                testStep.SetOutput(RewardCatalog_ProductsPage.CreateProduct_With_ProductCategory(product));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step9: 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: 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_Product.ToString() + "_" + DateHelper.GetDate("Current");
                MigrationPage.DeleteIfMigrationSetExists(Migration.MigrationSets.Migration_Product.ToString(), out string output);
                testStep.SetOutput(output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step6: 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 Step7: Edit Items and Generate Items
                stepName = "Edit Items and Generate Items";
                testStep = TestStepHelper.StartTestStep(testStep);
                MigrationPage.EditItems_All(Migration.BuildMigrationSetName, ProjectBasePage.Env_value, DateHelper.GeneratePastTimeStampBasedonMin(2));
                MigrationPage.SelectItemsForProductCategoryAndProduct(product.Name, product.CategoryName, out _output);
                testStep.SetOutput(_output);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step8: 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 Step9: 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 Step10: 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 Step11: Verify Product Migrated on Product Page
                stepName = "Verify Product Migrated on Product Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products);
                RewardCatalog_ProductsPage.VerifyCreatedProduct(product.SetType, product.Name, product.CategoryName);
                testStep.SetOutput(" Product :" + Migration.MigrationSets.Migration_Product.ToString() + " Migrated Successfully and appeared on Product Page");
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region Step12: 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 + e, 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 #29
0
        public void BTA120_Navigator_Create_Targeted_Promotion()
        {
            MethodBase method     = MethodBase.GetCurrentMethod();
            string     methodName = method.Name;

            testCase        = new TestCase(methodName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            Promotions       promotions = new Promotions();
            NonAdminUserData promotion  = new NonAdminUserData(DriverContext);

            promotions.StartDate = DateHelper.GetDate("Current");
            promotions.EndDate   = DateHelper.GetDate("Future");
            string stepName = "";

            try
            {
                #region stepName 1: "Open Navigator URL";
                stepName = "Open Navigator URL";
                var navigator_LoginPage = new Navigator_LoginPage(DriverContext);
                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 stepName 2: "Login to Navigator using User With AllRoles";
                stepName       = "Login to Navigator using User With AllRoles";
                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);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region stepName 3: "Select organization and environment on USER page";
                stepName = "Select organization and environment on USER page";
                testStep = TestStepHelper.StartTestStep(testStep);
                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 stepName 4: "Create Targeted Promotion";
                stepName               = "Create Targeted Promotion";
                promotions.Code        = RandomDataHelper.RandomString(3);
                promotions.Name        = promotion.PromotionName + RandomDataHelper.RandomString(5);
                promotions.Description = "Value for " + promotions.Name;
                var navigator_PromotionPage = new Navigator_PromotionsPage(DriverContext);
                testStep = TestStepHelper.StartTestStep(testStep);
                string enrollmentType = Navigator_PromotionsPage.EnrollmentTypes.Supported.ToString();
                testStep.SetOutput(navigator_PromotionPage.Create_Promotions(Navigator_PromotionsPage.PromotionTypes.Targeted.ToString(), promotions, enrollmentType));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region stepName 5: "Verify Targeted Promotion on Model -> Attribute Sets -> TxnHeader -> Rules Page";
                stepName = "Verify Targeted Promotion on Model -> Attribute Sets -> TxnHeader -> Rules Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                var result = navigator_PromotionPage.VerifyPromotionisCreatedOrNot(promotions.Code);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, result, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region stepName 6:"Create Non-Targeted Promotion";
                stepName               = "Create Non-Targeted Promotion";
                testStep               = TestStepHelper.StartTestStep(testStep);
                promotions.Code        = RandomDataHelper.RandomString(3);
                promotions.Name        = "AutoPromo_" + RandomDataHelper.RandomString(5);
                promotions.Description = "Value for " + promotions.Name;
                testStep.SetOutput(navigator_PromotionPage.Create_Promotions(Navigator_PromotionsPage.PromotionTypes.NonTargeted.ToString(), promotions, enrollmentType));
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region stepName 7: "Verify Non-Targeted Promotion on Model -> Attribute Sets -> TxnHeader -> Rules Page";
                stepName = "Verify Non-Targeted Promotion on Model -> Attribute Sets -> TxnHeader -> Rules Page";
                testStep = TestStepHelper.StartTestStep(testStep);
                result   = navigator_PromotionPage.VerifyPromotionisCreatedOrNot(promotions.Code);
                testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, result, DriverContext.SendScreenshotImageContent("WEB"));
                listOfTestSteps.Add(testStep);
                #endregion

                #region stepName 8 :"Logout from USER page";
                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);
                testCase.SetStatus(true);
                #endregion
                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 #30
0
        public void BTA_128_LN_Program_RewardCatalog_SearchWithPredicatesInExchangeRates()
        {
            #region Object Initialization
            CategoryFields  coupon    = new CategoryFields();
            Migration       Migration = new Migration(driverContext);
            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             Program_RewardCatalogPage      = new Navigator_Users_Program_RewardCatalogPage(DriverContext);
            var             RewardCatalog_ExchangeRatePage = new Navigator_Users_Program_RewardCatalog_ExchangeRatesPage(DriverContext);
            testCase        = new TestCase(TestContext.TestName);
            listOfTestSteps = new List <TestStep>();
            testStep        = new TestStep();
            string         stepName = "";
            CategoryFields rate     = new CategoryFields();

            #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 "!=" predicate works for Exchange Rates search functionalily
                stepName = "Verify that selected predicate works for Exchange Rates search functionalily";
                testStep = TestStepHelper.StartTestStep(testStep);
                application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program);
                navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog);
                Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.ExchangeRates);
                RewardCatalog_ExchangeRatePage.SearchExchangeRateBasedOnNotEqualToPredicateValue(CategoryFields.ExchangeRatePropertyType.ToCurrency.ToString(), CategoryFields.Predicates.Ne.ToString(), rate.ExchangeRateValue, out String status);
                testStep.SetOutput(status);
                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 + e, 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);
            }
        }