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); } }
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); } }
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); } }
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 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_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 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 BTA573_Navigator_GenerateAssembly() { ProjectBasePage basePages = new ProjectBasePage(driverContext); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; string stroutput = ""; try { #region Pre-Conditions Application_Nav_Util_Page Model = new Application_Nav_Util_Page(DriverContext); Navigator_GenerateAssembly nav_GenerateAssembly = new Navigator_GenerateAssembly(DriverContext); string assemblyDev = basePages.ConfigDownloadPath + @"\" + ProjectBasePage.Orgnization_value + ".zip"; string assemblyXsd = basePages.ConfigDownloadPath + @"\XSD.zip"; string assemblyJava = basePages.ConfigDownloadPath + @"\LWIntgr-Java.zip"; string assemblyDotnet = basePages.ConfigDownloadPath + @"\LWIntgr-DotNet.zip"; basePages.DeleteExistedFile(assemblyDev); basePages.DeleteExistedFile(assemblyXsd); basePages.DeleteExistedFile(assemblyJava); basePages.DeleteExistedFile(assemblyDotnet); #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 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:Generate Assembly stepName = "Generate Assembly in Navigator"; testStep = TestStepHelper.StartTestStep(testStep); Model.OpenApplication(NavigatorEnums.ApplicationName.model); nav_GenerateAssembly.GenerateAssembly(out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Generate dot net client Assembly stepName = "Generate dot net client Assembly in Navigator"; testStep = TestStepHelper.StartTestStep(testStep); Model.OpenApplication(NavigatorEnums.ApplicationName.model); nav_GenerateAssembly.GenerateDotNetClientAssembly(out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Generate java client Assembly stepName = "Generate java client Assembly in Navigator"; testStep = TestStepHelper.StartTestStep(testStep); Model.OpenApplication(NavigatorEnums.ApplicationName.model); nav_GenerateAssembly.GenerateJavaClientAssembly(out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Generate XSD client Assembly stepName = "Generate XSD client Assembly in Navigator"; testStep = TestStepHelper.StartTestStep(testStep); Model.OpenApplication(NavigatorEnums.ApplicationName.model); nav_GenerateAssembly.GenerateXSDClientAssembly(out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Verify Assembly downloaded stepName = "Verify Dev Assembly downloaded"; testStep = TestStepHelper.StartTestStep(testStep); Thread.Sleep(3000);//This is exclusive to wait for the download time basePages.VerifyExistedorDownloadedFile(assemblyDev, "BTADEV File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Verify DotNet Assembly downloaded stepName = "Verify DotNet Assembly downloaded"; testStep = TestStepHelper.StartTestStep(testStep); basePages.VerifyExistedorDownloadedFile(assemblyDotnet, "DotNet File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Verify Java Assembly downloaded stepName = "Verify Java Assembly downloaded"; testStep = TestStepHelper.StartTestStep(testStep); basePages.VerifyExistedorDownloadedFile(assemblyJava, "Java File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Verify XSD Assembly downloaded stepName = "Verify XSD Assembly downloaded"; testStep = TestStepHelper.StartTestStep(testStep); Thread.Sleep(10000); basePages.VerifyExistedorDownloadedFile(assemblyXsd, "XSD File downloaded Successfully to config path:" + basePages.ConfigDownloadPath, out stroutput); testStep.SetOutput(stroutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11: 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, 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 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 BTA79_Navigator_CreateAdminUser_And_Login_With_AdminUser() { List <TestStep> listOfTestSteps = new List <TestStep>(); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); // testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), ""); #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()); #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 bpadmin stepName = "Login to Navigator using bpadmin"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.bpAdminUser; login.Password = NavigatorUsers.bpAdminUser_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 LWadmin user and assign role stepName = "Create LWadmin user and assign role"; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.users); var user = adminPage.UserDetails(adminUserName, password); testStep.SetOutput(adminPage.Create_AdminUsers(user, Users.AdminRole.LWADM.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 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 stroutput); testStep.SetOutput(stroutput); 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 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); } }