public void BTA115_Navigator_Create_BonusCategory_And_BonusWithExtendedAttributeSet() { #region Object Declaration MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List<TestStep>(); testStep = new TestStep(); string Prereq_testCase1 = "BTA119_Navigator_VerifyAttributes_On_ExtendedAttributesPage"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, methodName, testStep); CategoryFields bonus = new CategoryFields(); ProjectBasePage basePages = new ProjectBasePage(driverContext); var bonusData = 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_CreateBonus_Category = new Navigator_Users_Program_Components_CategoriesPage(DriverContext); var navigator_CreateBonus = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext); 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 with Attribute Set stepName = "Create bonus with Category " + bonus.CategoryName + " 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.Bonuses); testStep.SetOutput(navigator_CreateBonus.CreateBonusWithAttributeSet(bonus).ToString()); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: 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 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); } }
public void BTA81_Navigator_GenerateKeys() { 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 = ""; try { #region :OrderExection Requirement string Prereq_testCase = "BTA79_Navigator_CreateKEYAdminUser_And_Login_With_KEYAdminUser"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep); #endregion #region Step1:Verify Key Files Existed ,If Existed Delete Existed Files stepName = "Delete Existed Keystore.dat Files and SymmetricKeystore.dat from :" + basePages.ConfigDownloadPath; testStep = TestStepHelper.StartTestStep(testStep); string keyStorefile = basePages.ConfigDownloadPath + @"\Keystore.dat"; string symmetricKeystore = basePages.ConfigDownloadPath + @"\SymmetricKeystore.dat"; basePages.DeleteExistedFile(keyStorefile); basePages.DeleteExistedFile(symmetricKeystore); stepOutput = "Existed Keystore.dat Files and SymmetricKeystore.dat from :" + basePages.ConfigDownloadPath + " Deleted Successfully"; testStep.SetOutput(stepOutput); 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 stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3: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.KEYUser_Password; 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 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:Generate Keys file Symmetric Key file with valid Password details and Export stepName = "Generate Keys file Symmetric Key file with valid Password details and Export"; testStep = TestStepHelper.StartTestStep(testStep); navigator_MangeKeysPage.EnterKeyStorePassword("Password1*", "512", out stepOutput); string Output1 = stepOutput; navigator_MangeKeysPage.ExportPrivateKey(keyStorefile, out stepOutput); string Output2 = stepOutput; navigator_MangeKeysPage.ExportSymmetrickey(symmetricKeystore, out stepOutput); string Output3 = stepOutput; testStep.SetOutput(";" + Output1 + ".;" + Output2 + ".;" + Output3); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: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 Step7: Copy Keystore file stepName = "Copy Keystore file to Config folder"; testStep = TestStepHelper.StartTestStep(testStep); basePages.CopyFile(keyStorefile, basePages.ConfigUploadPath + @"\Keystore.dat"); basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\Keystore.dat", "Keystore.dat File uploaded Successfully to config path:" + basePages.ConfigUploadPath, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Copy SymmetricKeystore file stepName = "Copy SymmetricKeystore file to Config folder"; testStep = TestStepHelper.StartTestStep(testStep); basePages.CopyFile(symmetricKeystore, basePages.ConfigUploadPath + @"\SymmetricKeystore.dat"); basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\SymmetricKeystore.dat", "SymmetricKeystore.dat File uploaded Successfully to config path:" + basePages.ConfigUploadPath, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: 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.SetOutput(stepName + e); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, 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); } }
public void BTA_116_Navigator_CreateCouponCategoryWithExtendedAttributeSet() { MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); string Prereq_testCase1 = "BTA119_Navigator_VerifyAttributes_On_ExtendedAttributesPage"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, methodName, testStep); #region Object Initialization CategoryFields coupon = new CategoryFields(); ProjectBasePage basePages = new ProjectBasePage(driverContext); var couponData = new NonAdminUserData(driverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var navigator_Users_Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var navigator_Users_Program_eCollateralPage = new Navigator_Users_Program_eCollateralPage(DriverContext); var navigator_CreateCoupon_Category = new Navigator_Users_Program_Components_CategoriesPage(DriverContext); var navigator_Users_Program_eCollateral_CouponsPage = new Navigator_Users_Program_eCollateral_CouponsPage(DriverContext); string CouponName = couponData.CouponName; string randomStr = RandomDataHelper.RandomString(4); coupon.CouponCode = ""; coupon.Name = CouponName + randomStr; coupon.CategoryName = couponData.CouponCategoryName; var date = DateTime.Now; date = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, TimeZoneInfo.Local.Id, "Central Standard Time"); coupon.StartDate = date.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); coupon.ExpiryDate = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); coupon.UsesAllowed = "10"; coupon.CategoryTypeValue = CategoryFields.CategoryType.Coupon.ToString(); coupon.ValueToSetInAttribute = "ValueGivenForAttribute"; coupon.SetType = CategoryFields.Property.Name.ToString(); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; coupon.MultiLanguage = CategoryFields.Languages.English.ToString(); coupon.ChannelProperties = CategoryFields.Channel.Web.ToString(); #endregion try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Create Category with Coupon stepName = "Create new Category as " + coupon.CategoryTypeValue; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); navigator_Users_Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories); testStep.SetOutput(navigator_CreateCoupon_Category.CreateCategory(coupon)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Create new Coupon with Attribute Set stepName = "Create Coupon with a category " + coupon.CategoryTypeValue + " with Attribute Set"; testStep = TestStepHelper.StartTestStep(testStep); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.eCollateral); navigator_Users_Program_eCollateralPage.NavigateToProgramECollateralTab(Navigator_Users_Program_eCollateralPage.eCollateralTabs.Coupons); navigator_Users_Program_eCollateral_CouponsPage.CreateCouponWithAttributeSet(coupon); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Websites and Select Website as BTA_Dev_CS and Module Type as stepName = "Navigate to Websites and Select Website as BTA_Dev_CS and Module Type as Customer Service - Award Coupons"; testStep = TestStepHelper.StartTestStep(testStep); var Website = new Application_Nav_Util_Page(DriverContext); Website.OpenApplication(NavigatorEnums.ApplicationName.website); var Website_Modules = new Navigator_Users_Website_ModulesPage(DriverContext); var websitePage = new Navigator_Users_WebsitePage(DriverContext); websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg); var webSiteName = WebsiteData.CSPortal_WebSiteName; var moduleType = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.CustomerServiceAwardCoupons); Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Config Coupon to CS portal stepName = "Select CSCouponAppeasement_Config file and Add created Coupon into it"; testStep = TestStepHelper.StartTestStep(testStep); Website_Modules.CSCouponAppeasementConfigurebutton(); Website_Modules.AddCouponInCSCouponAppeasementConfig(coupon.Name); Website_Modules.SaveConfigSetting(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Bounce the CS portal App pool stepName = "Bounce the CS Portal App pool"; testStep = TestStepHelper.StartTestStep(testStep); var WebsiteManagement = new Navigator_Users_WebsiteManagementPage(DriverContext); WebsiteManagement.Navigator_Website_Select_WebsiteManagementTab(); WebsiteManagement.BounceAppPool("CSPortal"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); //testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA79_Navigator_CreateWEBAdminUser_And_Login_With_WEBAdminUser() { MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); List <TestStep> listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region :OrderExection Requirement string Prereq_testCase = "BTA79_Navigator_CreateAdminUser_And_Login_With_AdminUser"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep); #endregion #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 adminPassword = adminPage.GetUserName(NavigatorUsers.AdminUser_Password, Users.AdminRole.LWADM.ToString()); string WebuserName = adminPage.GetUserName(NavigatorUsers.WebUser, Users.AdminRole.WEB.ToString()); string WebuserPassword = adminPage.GetUserName(NavigatorUsers.WebUser_Password, 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 BTAADMIN stepName = "Login to Navigator using BTAADMIN"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = adminUserName; login.Password = adminPassword; 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 = "Create WEBAdmin user and assign role"; 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 bpadmin stepName = "Logout from bpadmin"; 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 BTAWEBADMIN stepName = "Login to Navigator using BTAWEBADMIN"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = WebuserName; login.Password = WebuserPassword; 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 BTAWEBADMIN stepName = "Logout from BTAWEBADMIN"; 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); 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 BTA80_Navigator_CreateOrganizationsAndEnvironments() { testStep = new TestStep(); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region OrderExecution Requirement string Prereq_testCase = "BTA79_Navigator_CreateAdminUser_And_Login_With_AdminUser"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep); #endregion #region Object Initialization var navigator_LoginPage = new Navigator_LoginPage(DriverContext); var navigator_AdminPage = new Navigator_Admin_UsersPage(DriverContext); var organizationsPage = new Navigator_Admin_OrganizationsPage(DriverContext); #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 BTAADMIN stepName = "Login to Navigator using BTAADMIN"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.AdminUser; login.Password = NavigatorUsers.AdminUser_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 : Navigate to Organization page var application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.organization); #endregion #region Step4 : Create Organization with default development envionment if Organization does not exists stepName = "Create Organization with default development envionment if it does not exists"; testStep = TestStepHelper.StartTestStep(testStep); var orgName = ProjectBasePage.Orgnization_value; organizationsPage.CreateOrganization(orgName, out string outStatus); testStep.SetOutput(outStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5 : Create QA envionment if it does not exists stepName = "Create QA envionment if it does not exists"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.organization); organizationsPage.CreateQAEnvironment(orgName, out outStatus); testStep.SetOutput(outStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6 : Logout from BTAADMIN stepName = "Logout from BTAADMIN"; 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); 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 BTA84_Navigator_CreateUserWithAllPermissions() { testStep = new TestStep(); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region :OrderExection Requirement string Prereq_testCase1 = "BTA81_Navigator_GenerateKeys"; string Prereq_testCase2 = "BTA82_Navigator_GenerateDBConfig"; string Prereq_testCase3 = "BTA83_Navigator_GenerateFrameworkCfgFile"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, Prereq_testCase2, Prereq_testCase3, methodName, testStep); #endregion #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); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); string adminUserName = adminPage.GetUserName(NavigatorUsers.AdminUser, Users.AdminRole.LWADM.ToString()); string adminPassword = adminPage.GetUserName(NavigatorUsers.AdminUser_Password, 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 BTAADMIN stepName = "Login to Navigator using BTAADMIN"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = adminUserName; login.Password = adminPassword; 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 Step 3 - Create BTAUSER_DEV user and assign role to Org stepName = "Create BTAUSER_DEV user and assign role to Org"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users); string AllRolesUserName = adminPage.GetUserName(NavigatorUsers.NonAdminUser, Users.AdminRole.USER.ToString()); string AllRolesUserName_Password = adminPage.GetUserName(NavigatorUsers.NonAdminUser_Password, Users.AdminRole.USER.ToString()); var orgName = ProjectBasePage.Orgnization_value; var user = adminPage.UserDetails(AllRolesUserName, password); testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(adminPage.CreateUserWithAllRoles(user, orgName)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 4 - Logout from bpadmin stepName = "Logout from BTAADMIN"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 5 - Login with newly created USER stepName = "Login with newly created USER"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AllRolesUserName; login.Password = AllRolesUserName_Password; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out stroutput); testStep.SetOutput(stroutput); navigator_UsersHomePage.Navigator_Users_ClickHome(); 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().ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString().ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, 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); } }
public void BTA86_Navigator_Create_CSPortal_MemberPortal() { #region :OrderExection Requirement MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string Prereq_testCase1 = "BTA84_Navigator_CreateUserWithAllPermissions"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase1, methodName, testStep); #endregion var navigator_LoginPage = new Navigator_LoginPage(DriverContext); NonAdminUserData WebsiteData = new NonAdminUserData(driverContext); testStep = new TestStep(); string stepName = ""; try { #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 = 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 Step 3 : Select organization and environment on USER Home 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 Step 4 : Create CS portal website stepName = "Navigate to Website application and Create org_env_CS website"; var application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext); var websitePage = new Navigator_Users_WebsitePage(driverContext); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.website); Portal portal = new Portal { WebSiteName = WebsiteData.CSPortal_WebSiteName, WebSiteType = Navigator_Users_WebsitePage.PortalType.CS.ToString(), DefaultSkin = Navigator_Users_WebsitePage.DefaultPortalSkinTypes.CSDefaultSkin.ToString() }; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(websitePage.Create_CS(portal)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step 5 : Create Member portal website stepName = "Navigate to Website application and Create org_env_MP website"; Portal portalMP = new Portal { WebSiteName = WebsiteData.MemberPortal_WebSiteName, WebSiteType = Navigator_Users_WebsitePage.PortalType.MP.ToString(), DefaultSkin = Navigator_Users_WebsitePage.DefaultPortalSkinTypes.MemberFacing.ToString() }; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(websitePage.Create_MP(portalMP)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); 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(); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA83_Navigator_GenerateFrameworkCfgFile() { #region Object declaration string configPath = BnPBaseFramework.Web.Helpers.FilesHelper.GetFolder(BaseConfiguration.DownloadFolder, Directory.GetCurrentDirectory()); ProjectBasePage basePages = new ProjectBasePage(driverContext); string FrameworkCfgFile = basePages.ConfigDownloadPath + @"\Framework.cfg"; basePages.DeleteExistedFile(FrameworkCfgFile); 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 = ""; #endregion try { #region OrderExection Requirement string Prereq_testCase = "BTA79_Navigator_CreateAdminUser_And_Login_With_AdminUser"; ProjectBasePage.VerifyOrderTest(OrderTest_Status, Prereq_testCase, methodName, testStep); #endregion #region Object initilization var loginPage = new Navigator_LoginPage(DriverContext); var manageOrganizationPage = new Navigator_Orgnizations_FrameworkConfigurationPage(DriverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(driverContext); var organizationPage = new Navigator_Admin_OrganizationsPage(driverContext); #endregion #region Step1: Open Navigator URL stepName = "Open Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); 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 ADMIN stepName = "Login to navigator using ADMIN"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.AdminUser; login.Password = NavigatorUsers.NavigatorPassword; 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: Navigate to organization page stepName = "Navigate to organization page"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.organization); testStep.SetOutput("Successfully navigated to Organization page"); 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); manageOrganizationPage.DrillDownOrg(out string Message); manageOrganizationPage.SelectEnvironment(out string Message1); testStep.SetOutput(Message + ";" + Message1); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Framework Configuration tab stepName = "Select Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); organizationPage.NavigateToOrganizationsTabs(Navigator_Admin_OrganizationsPage.OrganizationsTabs.FrameworkConfiguration, out Message); testStep.SetOutput(Message + ";" + Message); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Update changes to the framework configuration page and file stepName = "Update changes to the framework configuration page and file"; testStep = TestStepHelper.StartTestStep(testStep); manageOrganizationPage.ExportFrameworkCfgFile(FrameworkCfgFile); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Copy framework configuration file to configuration path stepName = "Copy framework configuration file to configuration path"; testStep = TestStepHelper.StartTestStep(testStep); basePages.CreateOrVerfiyConfigFolder(); File.Copy(FrameworkCfgFile, basePages.ConfigUploadPath + @"\Framework.cfg", true); basePages.VerifyExistedorDownloadedFile(basePages.ConfigUploadPath + @"\Framework.cfg", "Framework.cfg File uploaded Successfully in config path:" + basePages.ConfigUploadPath, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Logout from USER page stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); 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); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }