public void BTA269_CSP_Merge_TwoMembers() { ProjectBasePage ProjectBasePage = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; try { #region Objects and Test Data var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSP_SearchPage = new CSPortal_SearchPage(DriverContext); var CSP_AccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSP_UpdateProfilePage = new CSPortal_MemberUpdateProfilePage(DriverContext); var CSP_AccountActivityPage = new CSPortal_MemberAccountActivityPage(DriverContext); MemberProfile MP_Model = new MemberProfile(DriverContext); Member member = MP_Model.GenerateMemberBasicInfoWithAboveMaxValues(); var CSP_MergAccountPage = new CSPortal_MergeAccountPage(DriverContext); #endregion ProjectBasePage.CreateMember_UsingSoap(out member, out string MemberOne_LoyaltyNumber, listOfTestSteps); string MemberOne_FirstName = member.FirstName.ToString(); ProjectBasePage.CreateMember_UsingSoap(out member, out string MemberTwo_LoyaltyNumber, listOfTestSteps); CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.LoginCSPortal(login, listOfTestSteps); CSP_SearchPage.Search_BasedOnLoyaltyID(MemberOne_LoyaltyNumber, listOfTestSteps); CSP_SearchPage.Select(MemberOne_FirstName, listOfTestSteps); CSP_AccountSummaryPage.VerifyLoyaltyId(MemberOne_LoyaltyNumber, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MergeAccounts, listOfTestSteps); CSP_MergAccountPage.MergeAccounts(MemberOne_LoyaltyNumber, MemberTwo_LoyaltyNumber, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountSummary, listOfTestSteps); string MergeActivityText = "Account " + MemberTwo_LoyaltyNumber + " was merged into " + MemberOne_LoyaltyNumber + "."; CSP_AccountSummaryPage.VerifyMergeActivity("Note", MergeActivityText, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountActivity, listOfTestSteps); CSP_AccountActivityPage.VerifyMergeActivity("Note", MergeActivityText, listOfTestSteps); CSP_HomePage.LogoutCSPortal(listOfTestSteps); testCase.SetStatus(true); } catch (Exception e) { testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA14_CSP_Member_Search_Select() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); Member member = new Member(); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; try { var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSPActivityPage = new CSPortal_MemberAccountActivityPage(DriverContext); basePages.CreateMember_UsingSoap(out member, out string LoyaltyId, listOfTestSteps); CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.LoginCSPortal(login, listOfTestSteps); CSPSearchPage.Search_BasedOnLoyaltyID(LoyaltyId, listOfTestSteps); CSPSearchPage.Select(member.FirstName, listOfTestSteps); CSPAccountSummaryPage.VerifyLoyaltyId(LoyaltyId, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountActivity, listOfTestSteps); CSPActivityPage.VerifyFirstName(member.FirstName, listOfTestSteps); CSPActivityPage.VerifyLastName(member.LastName, listOfTestSteps); CSPActivityPage.VerifyPrimaryEmail(member.PrimaryEmailAddress, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.ContactHistory, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UpdateProfile, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.RequestCredit, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MergeAccounts, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.CustomerAppeasements, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountSummary, listOfTestSteps); CSPAccountSummaryPage.VerifyLoyaltyId(LoyaltyId, listOfTestSteps); CSPAccountSummaryPage.VerifyFirstName(member.FirstName, listOfTestSteps); CSPAccountSummaryPage.VerifyLastName(member.LastName, listOfTestSteps); CSPAccountSummaryPage.VerifyPrimaryEmail(member.PrimaryEmailAddress, listOfTestSteps); CSP_HomePage.LogoutCSPortal(listOfTestSteps); testCase.SetStatus(true); } catch (Exception e) { testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA12_CSP_UpdateMember_BasicInfoAndAddress() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); MemberProfile MP_Model = new MemberProfile(DriverContext); Member member = MP_Model.GenerateMemberBasicInfo(); MemberDetails memberDetails = MP_Model.GenerateMemberDetails(); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; try { var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSP_UpdateProfilePage = new CSPortal_MemberUpdateProfilePage(DriverContext); basePages.CreateMember_UsingSoap(out member, out string LoyaltyId, listOfTestSteps); CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.LoginCSPortal(login, listOfTestSteps); CSPSearchPage.Search_BasedOnLoyaltyID(LoyaltyId, listOfTestSteps); CSPSearchPage.Select(member.FirstName, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UpdateProfile, listOfTestSteps); CSP_UpdateProfilePage.UpdateBasicInfo_Details(member, memberDetails, listOfTestSteps); CSP_UpdateProfilePage.UpdateAddress_Details(memberDetails, listOfTestSteps); CSP_UpdateProfilePage.SaveUpdateProfile(listOfTestSteps); CSPAccountSummaryPage.VerifyLoyaltyId(LoyaltyId, listOfTestSteps); CSPAccountSummaryPage.VerifyFirstName(member.FirstName, listOfTestSteps); CSPAccountSummaryPage.VerifyLastName(member.LastName, listOfTestSteps); CSPAccountSummaryPage.VerifyPrimaryEmail(member.PrimaryEmailAddress, listOfTestSteps); CSPAccountSummaryPage.VerifyAddressLine1(memberDetails.AddressLineOne, listOfTestSteps); CSPAccountSummaryPage.VerifyAddressLine2(memberDetails.AddressLineTwo, listOfTestSteps); CSPAccountSummaryPage.VerifyCity(memberDetails.City, listOfTestSteps); CSPAccountSummaryPage.VerifyState(memberDetails.StateOrProvince, listOfTestSteps); CSPAccountSummaryPage.VerifyZipCode(memberDetails.ZipOrPostalCode, listOfTestSteps); CSP_HomePage.LogoutCSPortal(listOfTestSteps); testCase.SetStatus(true); } catch (Exception e) { testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA15_CSP_HomePage() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); Member member = new Member(); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; try { var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.LoginCSPortal(login, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.ChangePassword, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberSearch, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, listOfTestSteps); CSP_HomePage.LogoutCSPortal(listOfTestSteps); testCase.SetStatus(true); } catch (Exception e) { testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA142_MP_LoginUserCreatedFromCsPortalInMemberPortal() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; string stepOutput = ""; try { Common common = new Common(DriverContext); #region Generating Test Data to Create new user with loyalty card MemberProfile MP_Model = new MemberProfile(DriverContext); Member member = MP_Model.GenerateMemberBasicInfo(); MemberDetails details = MP_Model.GenerateMemberDetails(); VirtualCard vc = MP_Model.GenerateVirtualCard(); var MP_LoginPage = new MemberPortal_LoginPage(DriverContext); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to Member Registration stepName = "Navigate to Member Registration"; var CSP_HomePage = new CSPortal_HomePage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Enter Basic Info stepName = "Enter Basic Info Details on Member Registration page"; var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterBasicInfo_Details(member.FirstName, member.LastName, member.MiddleName, details.Gender, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Enter Address stepName = "Enter Address Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterAddress_Details(details.AddressLineOne, details.AddressLineTwo, details.Country, details.StateOrProvince, details.City, details.ZipOrPostalCode, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Enter ContactInfo stepName = "Enter Contact Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterContactInfo_Details(member.PrimaryEmailAddress, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Enter login Credentials stepName = "Enter login Credentials Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterLoginCredentials_Details(member.Username, member.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Select All Opt In/Out Check boxes stepName = "Select All Opt In/Out Check boxes"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterOptIn_Out_Details("DirectMailOptIn", "EmailOptIn", "SmsOptIn", out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Save Registration stepName = "Save Registration"; testStep = TestStepHelper.StartTestStep(testStep); CSP_RegistrationPage.SaveRegistration(); testStep.SetOutput("Registration Completed Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Logout from CSPortal stepName = "Logout from CSPortal"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout from CSPortal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Launch Member Portal stepName = "Launch Member Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion # region Step12: Login with the user Created from CSPortal stepName = "Login with the user Created from CSPortal"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LoginMemberPortal(member.Username, member.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Login to Member Portal should be successful stepName = "Verify Login to Member Portal should be successful"; testStep = TestStepHelper.StartTestStep(testStep); Step_Output = MP_LoginPage.VerifyMemberPortalLoginSuccessfulForUser(member.FirstName, member.LastName); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14: Logout from Member Portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); MP_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); }
public void BTA266_CSP_VerifyActiveandInActiveStatusofAgents() { ProjectBasePage basePages = new ProjectBasePage(driverContext); AgentRegistration agent_admin = new AgentRegistration(); AgentRegistration agent_Sradmin = new AgentRegistration(); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var agentPage = new CSPortal_UserAdministrationAgentPage(DriverContext); var userAdministration = new CSPortal_UserAdministration(DriverContext); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Edit AdminAgent status Active to Inactive stepName = "Edit AdminAgent status Active to Inactive"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out string output); userAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); agent_admin.FistName = "AdminFirstName"; agent_admin.LastName = "AdminLastName"; agent_admin.Role = RoleValue.Admin.ToString(); agent_admin.UserName = AgentValues.AdminAgent; agent_admin.Password = AgentValues.Agentpassword; agent_admin.Status = AgentRegistration.AgentStatus.Active.ToString(); var status = agentPage.EditAgentStatus(agent_admin, AgentRegistration.AgentStatus.InActive.ToString(), out string result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Edit SrAdminAgent status Active to Inactive stepName = "Edit SrAdminAgent status Active to Inactive"; testStep = TestStepHelper.StartTestStep(testStep); agent_Sradmin.FistName = "SrFirstName"; agent_Sradmin.LastName = "SrLastName"; agent_Sradmin.Role = RoleValue.SrAdmin.ToString(); agent_Sradmin.UserName = AgentValues.SrAdminAgent; agent_Sradmin.Password = AgentValues.Agentpassword; agent_Sradmin.Status = AgentRegistration.AgentStatus.Active.ToString(); status = agentPage.EditAgentStatus(agent_Sradmin, AgentRegistration.AgentStatus.InActive.ToString(), out result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Verify AdminAgent login in inactive state. stepName = "Verify AdminAgent login in Inactive state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.AdminAgent; login.Password = AgentValues.Agentpassword; var testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.InActive.ToString(), out output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Verify SrAdminAgent login in inactive state. stepName = "Verify SrAdminAgent login in Inactive state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.SrAdminAgent; login.Password = AgentValues.Agentpassword; testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.InActive.ToString(), out output); testStep.SetOutput(output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Edit AdminAgent status Inactive to Active stepName = "Edit AdminAgent status Inactive to Active"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out output); userAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); status = agentPage.EditAgentStatus(agent_admin, AgentRegistration.AgentStatus.Active.ToString(), out result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Edit SrAdminAgent status Inactive to Active stepName = "Edit SrAdminAgent status Inactive to Active"; testStep = TestStepHelper.StartTestStep(testStep); agent_Sradmin.Status = AgentRegistration.AgentStatus.Active.ToString(); status = agentPage.EditAgentStatus(agent_Sradmin, AgentRegistration.AgentStatus.Active.ToString(), out result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, status, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Verify AdminAgent login in active state. stepName = "Verify AdminAgent login in active state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.AdminAgent; login.Password = AgentValues.Agentpassword; testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.Active.ToString(), out result); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Verify SrAdminAgent login in active state. stepName = "Verify SrAdminAgent login in active state"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.SrAdminAgent; login.Password = AgentValues.Agentpassword; testResult = agentPage.VerifyLogin(login, AgentRegistration.AgentStatus.Active.ToString(), out output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, testResult, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Logout stepName = "Logout"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA140_CSP_UpdateMemberAnd_VerifyMember() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; string stepOutput = ""; MemberProfile MP_Model = new MemberProfile(DriverContext); try { #region Precondtion:Create Members testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = basePages.CreateMemberThroughCDIS(); testStep.SetOutput("IpCode:" + output.IpCode + ",Name:" + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Generating Test Data to Create new user with loyalty card Member member = MP_Model.GenerateMemberBasicInfo(); MemberDetails details = MP_Model.GenerateMemberDetails(); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Login As csadmin User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(basePages.GetLoyaltyNumber(output), out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Select and Verify Loyalty ID stepName = "Select and Verify Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); CSPSearchPage.Select(output.FirstName); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(basePages.GetLoyaltyNumber(output), out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Member Update stepName = "Navigate to Member Update Profile"; var CSP_HomePage = new CSPortal_HomePage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UpdateProfile, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Update Basic Info stepName = "Update Basic Info Details on Member Update Profile page"; var CSP_UpdateProfilePage = new CSPortal_MemberUpdateProfilePage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_UpdateProfilePage.UpdateBasicInfo_Details(member.FirstName, member.LastName, member.MiddleName, details.Gender, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Update Address stepName = "Update Address Info Details on Member Update Profile page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_UpdateProfilePage.UpdateAddress_Details(details.AddressLineOne, details.AddressLineTwo, details.Country, details.StateOrProvince, details.City, details.ZipOrPostalCode, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Update ContactInfo stepName = "Update Contact Info Details on Member Update Profile page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_UpdateProfilePage.UpdateContactInfo_Details(member.PrimaryEmailAddress, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Select All Opt In/Out Check boxes to Update stepName = "Select All Opt In/Out Check boxes to Update"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_UpdateProfilePage.UpdateOptIn_Out_Details("DirectMailOptIn", "EmailOptIn", "SmsOptIn", out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Save Update profile and Verify Loyalty ID stepName = "Update profile and Verify Loyalty ID on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); CSP_UpdateProfilePage.SaveRegistration(); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(basePages.GetLoyaltyNumber(output), out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Verify FirstName on Account Summary Page stepName = "Verify FirstName on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyFirstName(member.FirstName, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Verify Last tName on Account Summary Page stepName = "Verify Last Name on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyLastName(member.LastName, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Verify Primary Email Address on Account Summary Page stepName = "Verify Primary Email Address on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyPrimaryEmail(member.PrimaryEmailAddress, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Verify Address Line 1 on Account Summary Page stepName = "Verify Address Line 1 on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyAddressLine1(details.AddressLineOne, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step15:Verify Address Line 2 on Account Summary Page stepName = "Verify Address Line 2 on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyAddressLine2(details.AddressLineTwo, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step16:Verify City on Account Summary Page stepName = "Verify City on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyCity(details.City, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step17:Verify State on Account Summary Page stepName = "Verify State on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyState(details.StateOrProvince, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step18:Verify Zip Code on Account Summary Page stepName = "Verify Zip Code on Account Summary Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPAccountSummaryPage.VerifyZipCode(details.ZipOrPostalCode, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step19:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { stepstatus = false; testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA138_CSP_CreateMemberWithLoyaltyID() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; string stepOutput = ""; try { Common common = new Common(DriverContext); #region Generating Test Data to Create new user with loyalty card MemberProfile MP_Model = new MemberProfile(DriverContext); Member member = MP_Model.GenerateMemberBasicInfo(); MemberDetails details = MP_Model.GenerateMemberDetails(); VirtualCard vc = MP_Model.GenerateVirtualCard(); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Launch Customer Service Portal URL is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Login As csadmin User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to Member Registration stepName = "Navigate to Member Registration"; var CSP_HomePage = new CSPortal_HomePage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Enter Basic Info stepName = "Enter Basic Info Details on Member Registration page"; var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterBasicInfo_Details(member.FirstName, member.LastName, member.MiddleName, details.Gender, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Enter Loyalty Card Info stepName = "Enter Loyalty Card Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterDefaultLoyaltyCard_Details(vc.LoyaltyIdNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Enter Address stepName = "Enter Address Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterAddress_Details(details.AddressLineOne, details.AddressLineTwo, details.Country, details.StateOrProvince, details.City, details.ZipOrPostalCode, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Enter ContactInfo stepName = "Enter Contact Info Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterContactInfo_Details(member.PrimaryEmailAddress, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Enter login Credentials stepName = "Enter login Credentials Details on Member Registration page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterLoginCredentials_Details(member.Username, member.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Select All Opt In/Out Check boxes stepName = "Select All Opt In/Out Check boxes"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_RegistrationPage.EnterOptIn_Out_Details("DirectMailOptIn", "EmailOptIn", "SmsOptIn", out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Save Registration and Verify Loyalty ID stepName = "Save Registration and Verify Loyalty ID "; testStep = TestStepHelper.StartTestStep(testStep); CSP_RegistrationPage.SaveRegistration(); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(vc.LoyaltyIdNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Navigate to Member Search stepName = "Navigate to Member Search "; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberSearch, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(vc.LoyaltyIdNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Select and Verify Loyalty ID stepName = "Select and Verify Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); CSPSearchPage.Select(member.FirstName); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(vc.LoyaltyIdNumber, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { stepstatus = false; testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA13_CSP_UpdateMemberWithMaximumValues() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; try { #region Generating Test Data to Create new user with loyalty card MemberProfile MP_Model = new MemberProfile(DriverContext); Member member = MP_Model.GenerateMemberBasicInfoWithAboveMaxValues(); MemberDetails details = MP_Model.GenerateMemberDetailsWithAboveMaxValues(); VirtualCard vc = MP_Model.GenerateVirtualCardAboveMaxValues(); #endregion var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSP_UpdateProfilePage = new CSPortal_MemberUpdateProfilePage(DriverContext); basePages.CreateMember_UsingSoap(out member, out string LoyaltyId, listOfTestSteps); CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.LoginCSPortal(login, listOfTestSteps); CSPSearchPage.Search_BasedOnLoyaltyID(LoyaltyId, listOfTestSteps); CSPSearchPage.Select(member.FirstName, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UpdateProfile, listOfTestSteps); member = MP_Model.GenerateMemberBasicInfoWithAboveMaxValues(); details = MP_Model.GenerateMemberDetailsWithAboveMaxValues(); CSP_UpdateProfilePage.UpdateBasicInfo_Details(member, details, listOfTestSteps); CSP_UpdateProfilePage.UpdateAddress_Details(details, listOfTestSteps); CSP_UpdateProfilePage.UpdateContactInfo_Details(details, member, listOfTestSteps); CSP_UpdateProfilePage.SaveUpdateProfile(listOfTestSteps); string Member_FirstName = member.FirstName.Substring(0, 50); CSPAccountSummaryPage.VerifyFirstName(Member_FirstName, listOfTestSteps); string Member_LastName = member.LastName.Substring(0, 50); CSPAccountSummaryPage.VerifyLastName(Member_LastName, listOfTestSteps); string Member_PrimaryEmailAddress = member.PrimaryEmailAddress.Substring(0, 254); CSPAccountSummaryPage.VerifyPrimaryEmail(Member_PrimaryEmailAddress, listOfTestSteps); string Member_details_AddressLineOne = details.AddressLineOne.Substring(0, 100); CSPAccountSummaryPage.VerifyAddressLine1(Member_details_AddressLineOne, listOfTestSteps); string Member_details_AddressLineTwo = details.AddressLineTwo.Substring(0, 100); CSPAccountSummaryPage.VerifyAddressLine2(Member_details_AddressLineTwo, listOfTestSteps); string Member_details_City = details.City.Substring(0, 50); CSPAccountSummaryPage.VerifyCity(Member_details_City, listOfTestSteps); CSPAccountSummaryPage.VerifyState(details.StateOrProvince, listOfTestSteps); string Member_details_ZipCode = details.ZipOrPostalCode.Substring(0, 25); CSPAccountSummaryPage.VerifyZipCode(Member_details_ZipCode, listOfTestSteps); CSP_HomePage.LogoutCSPortal(listOfTestSteps); testCase.SetStatus(true); } catch (Exception e) { testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_280_CSP_RequestCredit_Online_TransactionAmount() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus = true; var CSPortal_RequestCredit = new CSPortal_RequestCredit(DriverContext); var CSPMemberAccountActivityPage = new CSPortal_MemberAccountActivityPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); try { #region reading Data from dB List <string> TransactionList = new List <string>(); stepName = "Searching Transaction in the Transaction History Details Table"; testStep = TestStepHelper.StartTestStep(testStep); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); TransactionList = ProjectBasePage.GetTransactionDetailsFromTransationHistoryTableFromDB(out Step_Output); RequestCredit_Search_Criteria.TransactionNumber = TransactionList[0].ToString(); RequestCredit_Search_Criteria.RegisterNumber = TransactionList[1].ToString(); RequestCredit_Search_Criteria.TxnAmount = TransactionList[2].ToString(); RequestCredit_Search_Criteria.TxnDate = TransactionList[3].ToString(); RequestCredit_Search_Criteria.StoreNumber = TransactionList[4].ToString(); DateTime Txn_dateformat = DateTime.Parse(RequestCredit_Search_Criteria.TxnDate); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Precondition:Create Member One testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = basePages.CreateMemberThroughCDIS(); string LoyaltyNumber_One_Firstname = output.FirstName; string LoyaltyNumber_One = basePages.GetLoyaltyNumber(output); testStep.SetOutput("LoyaltyNumber_One:" + LoyaltyNumber_One + ",Name:" + output.FirstName + "Created Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep);; CSP_LoginPage.LaunchCSPortal(login.Csp_url, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(LoyaltyNumber_One, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Select and Verify Loyalty ID stepName = "Select and Verify Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); CSPSearchPage.Select(LoyaltyNumber_One_Firstname); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(LoyaltyNumber_One, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Request Credit stepName = "Navigate to Request Credit Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.RequestCredit, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Search With Transaction Amount stepName = "Select Online and Search With Transaction Amount:" + RequestCredit_Search_Criteria.TxnAmount; testStep = TestStepHelper.StartTestStep(testStep); CSPortal_RequestCredit.Select_Online(); stepstatus = CSPortal_RequestCredit.Search_Online_BasedOnTransactionAmount(RequestCredit_Search_Criteria.TransactionNumber, RequestCredit_Search_Criteria.TxnAmount, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Get the data from DB stepName = "Searching Transaction in the Txn_Header Table"; List <string> TransactionList_Header = new List <string>(); testStep = TestStepHelper.StartTestStep(testStep); TransactionList_Header = ProjectBasePage.GetTransactionDetailsFromTransactionHeaderTableFromDB(RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Verify the Transactions stepName = "Verifying Transaction in Txn_Header table"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = basePages.VerifyInputandOutputFromDB("Transaction Number", TransactionList_Header[0].ToString(), RequestCredit_Search_Criteria.TransactionNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Navigate to Account Activity Page stepName = "Navigate to Account ActivityPage"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountActivity, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Search and Verify Purchase History of First Transaction With Specific Date Range stepName = "Search and Verify Purchase History "; testStep = TestStepHelper.StartTestStep(testStep); Txn_dateformat.ToString("MMddyyyy"); CSPMemberAccountActivityPage.SelectDate_RC(Txn_dateformat, Txn_dateformat); testStep.SetOutput(CSPMemberAccountActivityPage.VerifyPurchaseHistoryBasedonHeader(RequestCredit_Search_Criteria.TransactionNumber)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout As csadmin is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA122_CSP_CreateDifferentRoles() { ProjectBasePage basePages = new ProjectBasePage(this.driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); bool stepstatus; string stepName = ""; #region Object Initialization var homePage = new CSPortal_HomePage(DriverContext); var userAdministrationPage = new CSPortal_UserAdministration(DriverContext); var loginPage = new CSPortal_LoginPage(DriverContext); var rolePage = new CSPortal_UserAdministration_RolePage(DriverContext); #endregion try { #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); loginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; loginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3 : Navigate to User Administration testStep = TestStepHelper.StartTestStep(testStep); stepstatus = homePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out stepName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4 : Navigate to Roles stepName = "Navigate to Roles"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = userAdministrationPage.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Roles); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5 : Create AdminRole if it does not exists stepName = "Create AdminRole if it does not exists"; testStep = TestStepHelper.StartTestStep(testStep); var role = RoleValue.Admin; var pointAwardLimit = RoleValue.AdminRole_PointAwardLimit; stepstatus = rolePage.CreateNewRole(role, pointAwardLimit, out string stat); testStep.SetOutput(stat); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6 : Create SrAdminRole if it does not exists stepName = "Create SrAdminRole if it does not exists"; testStep = TestStepHelper.StartTestStep(testStep); role = RoleValue.SrAdmin; pointAwardLimit = RoleValue.SrAdminRole_PointAwardLimit; stepstatus = rolePage.CreateNewRole(role, pointAwardLimit, out stat); testStep.SetOutput(stat); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7 : Create JrAdminRole if it does not exists stepName = "Create JrAdminRole if it does not exists"; testStep = TestStepHelper.StartTestStep(testStep); role = RoleValue.JrAdmin; pointAwardLimit = RoleValue.JrAdminRole_PointAwardLimit; stepstatus = rolePage.CreateNewRole(role, pointAwardLimit, out stat); testStep.SetOutput(stat); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8 : Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); homePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA344_Verify_Member_Rewards() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var common = new Common(DriverContext); var cdis_Service_Method = new CDIS_Service_Methods(common); var cSPortal_CustomerAppeasementsPage = new CSPortal_CustomerAppeasementsPage(DriverContext); var MPortal_LoginPage = new MemberPortal_LoginPage(DriverContext); var MP_MyAccountPage = new MemberPortal_MyAccountPage(DriverContext); var myAccountPage = new MemberPortal_MyAccountPage(driverContext); var myWalletPage = new MemberPortal_MyWalletPage(driverContext); var Mp_LoginPage = new MemberPortal_LoginPage(DriverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); #endregion #region Step1:Adding member with CDIS service stepName = "Adding member through CDIS service"; testStep = TestStepHelper.StartTestStep(testStep); Member member = basePages.CreateMemberThroughCDIS(); testStep.SetOutput("Member Added with LoyaltyID " + basePages.GetLoyaltyNumber(member)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step2:Get Recent Reward Catalog with CDIS service testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get Recent Reward Catalog with CDIS service"; RewardCatalogSummaryStruct[] rewardCatalog = cdis_Service_Method.GetRecentRewardCatalog(cdis_Service_Method.GetActiveRewardCatalogCount() - 5, 10, 100); testStep.SetOutput("RewardName:" + rewardCatalog[0].RewardName); Logger.Info("RewardName:" + rewardCatalog[0].RewardName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step3:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Launch Customer Service Portal URL is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Login As csadmin stepName = "Login As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Login As AdminAgent User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(basePages.GetLoyaltyNumber(member), out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Adding Points To Member stepName = "Adding Points To Member"; testStep = TestStepHelper.StartTestStep(testStep); var userName = member.FirstName; var maxPoints = 10000; var points = new System.Random().Next(100, 500).ToString(); CSPSearchPage.Select(userName); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.CustomerAppeasements, out string result); testStep.SetOutput(cSPortal_CustomerAppeasementsPage.AddingPointsToMember(points, maxPoints)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Adding rewards to member stepName = "Adding rewards to member"; testStep = TestStepHelper.StartTestStep(testStep); userName = member.FirstName; var rewardName = MemberPortalData.RewardName; CSPSearchPage.Select(userName); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.CustomerAppeasements, out result); testStep.SetOutput(cSPortal_CustomerAppeasementsPage.AddRewardAppeasement(rewardName, out string message)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Launch MPPortal Portal stepName = "Launch Member Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); MPortal_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out string Message); testStep.SetOutput("Launch Member Portal URL is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Login As Newely Created Member stepName = "Login As Newely Created Member "; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = member.Username; login.Password = MemberPortalData.MP_password; MPortal_LoginPage.LoginMemberPortal(login.UserName, login.Password, out Message); testStep.SetOutput("Login As " + login.UserName + " User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Navigate to My Wallet page stepName = "Verify successful navigation to My Wallet page"; testStep = TestStepHelper.StartTestStep(testStep); myAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyWallet, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Verify My Reward sections stepName = "Verify My Reward sections"; testStep = TestStepHelper.StartTestStep(testStep); var date = DateTime.Now; date = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, TimeZoneInfo.Local.Id, "Central Standard Time"); var FromDate = date.ToString("MM/dd/yyyy", new CultureInfo("en-US")); var ToDate = date.AddYears(10).ToString("MM/dd/yyyy", new CultureInfo("en-US")); myWalletPage.VerifyMyRewardSection(rewardName, FromDate, ToDate, MemberPortal_MyWalletPage.RewardStatus.Active.ToString(), out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Verify My Reward buttons stepName = "Verify My Reward buttons"; testStep = TestStepHelper.StartTestStep(testStep); myWalletPage.VerifyMyRewardButtonOptions(out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Logout from member portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); Mp_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { stepstatus = false; testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA271__CSP_ForgotPassword() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; string stepOutput = ""; bool stepstatus = false; string BTA_DEV_CS_LogPath = CsPortalData.BTA_DEV_CS_LogPath; try { var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPortal_UserAdministration = new CSPortal_UserAdministration(DriverContext); var CSPortal_UserAdministrationAgentPage = new CSPortal_UserAdministrationAgentPage(DriverContext); var CSP_ForgotPassword = new CSPortal_ForgotPassword(DriverContext); AgentRegistration agent = new AgentRegistration(); #region Step1:Launch CSPortal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to User Administration stepName = "Navigate to UserAdministration Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Navigate to Agent Page stepName = "Navigate to Agent Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPortal_UserAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput("Navigate to Agent Page is Successful"); listOfTestSteps.Add(testStep); #endregion #region Step5:Create new TestAgent user as per config file,if not existed testStep = TestStepHelper.StartTestStep(testStep); agent.FistName = AgentValues.ForgotPasswordTestAgent; agent.LastName = AgentValues.ForgotPasswordTestAgent; agent.Role = RoleValue.Admin.ToString(); agent.UserName = AgentValues.ForgotPasswordTestAgent; agent.Status = AgentRegistration.AgentStatus.Active.ToString(); stepName = "Create New Agent if user is not existed"; agent.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.CreateAgent(agent.FistName, agent.LastName, agent.Role, agent.UserName, agent.Password, agent.Status)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Logout As Test User stepName = "Logout from CS Portal"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput("Logout is Successful as csadmin"); listOfTestSteps.Add(testStep); #endregion #region Step7:Launch CSPortal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep);; CSP_LoginPage.LaunchCSPortal(login.Csp_url, out stepOutput); testStep.SetOutput(stepOutput); CSP_ForgotPassword.GetInitialWordCountFromLogFile(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Click on Forgot Password stepName = "Click on Forgot Password"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_LoginPage.ClickForgotPassword(); testStep.SetOutput("Clicked on Forgot Password Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Enter valid user name and click Submit button stepName = "Enter a valid user name and click Submit button"; testStep = TestStepHelper.StartTestStep(testStep); CSP_ForgotPassword.EnterUserName(agent.UserName); CSP_ForgotPassword.ClickSubmitButton(); testStep.SetOutput("Entered User name: " + agent.UserName + " and clicked on Submit button"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Select Email option to receive reset code stepName = "Select Email option to receive reset code"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_ForgotPassword.SelectEmailOption(); testStep.SetOutput("Selected Email Option to receive reset code"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11: Click on Send my reset code stepName = "Click on Send my reset code"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_ForgotPassword.ClickSendResetCodeButton(); testStep.SetOutput("Clicked on Send my reset code"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12: Select I already have a reset code option stepName = "Select I already have a reset code option"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_ForgotPassword.SelectAlreadyHaveResetCode(); testStep.SetOutput("Selected I already have a rest code option"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13: Click on Send my reset code stepName = "Click on Send my reset code"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_ForgotPassword.ClickSendResetCodeButton(); testStep.SetOutput("Clicked on Send my reset code"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14: Enter the reset code received in the Email/Log stepName = "Enter the reset code received in the Email/Log"; testStep = TestStepHelper.StartTestStep(testStep); CSP_ForgotPassword.EnterResetCodeFromLogFile(BTA_DEV_CS_LogPath, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step15: Click on Submit button stepName = "Click on Submit button"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_ForgotPassword.ClickSubmitButton(); testStep.SetOutput("Clicked on Submit button"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step16: Create new Password for Test User testStep = TestStepHelper.StartTestStep(testStep); stepName = "Create new Passwod for Test User"; agent.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); stepstatus = CSP_ForgotPassword.CreateNewPassword(agent.UserName, agent.Password, agent.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step17: Return back to login page stepName = "Return back to login page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_ForgotPassword.ReturnToLoginPage(out stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput(stepOutput); listOfTestSteps.Add(testStep); #endregion #region Step18: Login with the newly created Password stepName = "Login with User, User Name:" + agent.UserName + "with newly reset Password:"******"WEB")); testStep.SetOutput(stepName); listOfTestSteps.Add(testStep); #endregion #region Step19: Verify First Name and Last Name stepName = "Verify First Name and Last Name"; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(CSP_HomePage.VerifyFirstNameAndLastName(agent.FistName, agent.LastName)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step20: Navigate to Change Password testStep = TestStepHelper.StartTestStep(testStep); stepName = "Navigate to Change Password"; stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.ChangePassword, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Stept21: Change Password for Test Agent to default testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change Password for Test Agent to default"; var cSP_ChangePassword = new CSPortal_ChangePassword(DriverContext); string agen_OldPassword = agent.Password; string agent_DefaultPassword = AgentValues.Agentpassword; cSP_ChangePassword.EnterPasswordDetails(agen_OldPassword, agent_DefaultPassword, agent_DefaultPassword, out string ValidationMessage); cSP_ChangePassword.SavePassword(); stepstatus = cSP_ChangePassword.VerifySuccessMessage(agen_OldPassword, agent_DefaultPassword, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step22: Logout As Test User stepName = "Logout from CS Portal User:"******"WEB")); testStep.SetOutput("Logout is Successful as User:"******"WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_510_CSP_CustomerAppeasement_RewardAppeasement() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); Common common = new Common(DriverContext); ProjectBasePage basePages = new ProjectBasePage(DriverContext); string stepName = ""; try { #region var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); var cSPortal_CustomerAppeasementsPage = new CSPortal_CustomerAppeasementsPage(DriverContext); var MPortal_LoginPage = new MemberPortal_LoginPage(DriverContext); var MP_MyAccountPage = new MemberPortal_MyAccountPage(DriverContext); var myAccountPage = new MemberPortal_MyAccountPage(driverContext); var myWalletPage = new MemberPortal_MyWalletPage(driverContext); var Mp_LoginPage = new MemberPortal_LoginPage(DriverContext); #endregion #region Step1:Adding member with CDIS service stepName = "Adding member with CDIS service"; testStep = TestStepHelper.StartTestStep(testStep); Member output = basePages.CreateMemberThroughCDIS(); testStep.SetOutput("Created Member With LoyaltyId " + basePages.GetLoyaltyNumber(output)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step2: Get Recent Reward Catalog with CDIS service testStep = TestStepHelper.StartTestStep(testStep); stepName = "Get Recent Reward Catalog with CDIS service"; RewardCatalogSummaryStruct[] rewardCatalog = cdis_Service_Method.GetRecentRewardCatalog(cdis_Service_Method.GetActiveRewardCatalogCount() - 5, 10, 100); testStep.SetOutput("RewardName:" + rewardCatalog[0].RewardName); Logger.Info("RewardName:" + rewardCatalog[0].RewardName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step3:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Launch Customer Service Portal URL is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Login As csadmin stepName = "Login As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Login As AdminAgent User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(basePages.GetLoyaltyNumber(output), out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Verify Member details displayed on Account Summary page stepName = "Verify Member details displayed on Account Summary page"; testStep = TestStepHelper.StartTestStep(testStep); var userName = output.FirstName; CSPSearchPage.Select(userName); testStep.SetOutput("Member details displayed in Account Summary page"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Navigate to CustomerAppeasements page stepName = "Navigate to CustomerAppeasements page"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.CustomerAppeasements, out string result); testStep.SetOutput(result); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Adding Reward Appeasement stepName = "Adding Reward Appeasement"; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(cSPortal_CustomerAppeasementsPage.AddRewardAppeasement(rewardCatalog[0].RewardName, out string message)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { stepstatus = false; testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA268_CSP_SearchPurchaseHistoryWithSpecificDate_Range() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepOutput = ""; string stepName = ""; bool stepstatus; try { #region Object Declaration Common common = new Common(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); var CSPMemberAccountActivityPage = new CSPortal_MemberAccountActivityPage(DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); var date = DateTime.Now.AddDays(-1); DateTime FromDate = new DateTime(date.Year, date.Month, 1); DateTime ToDate = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(2018, date.Month)); FromDate.ToString("MMddyyyy"); ToDate.ToString("MMddyyyy"); #endregion #region Precondtion: Adding Members through CDIS stepName = "Adding member through CDIS service"; testStep = TestStepHelper.StartTestStep(testStep); Member member = basePages.CreateMemberThroughCDIS(); testStep.SetOutput("Member Added with LoyaltyID " + basePages.GetLoyaltyNumber(member)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Search Based on Loyalty ID and Select member testStep = TestStepHelper.StartTestStep(testStep); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(basePages.GetLoyaltyNumber(member), out stepName); string FirstName = member.FirstName; CSPSearchPage.Select(FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Navigate to Account Activity Page stepName = "Navigate to Account Activity Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountActivity, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5A: Adding Transaction1 through CDIS stepName = "Adding Transaction1 through CDIS"; testStep = TestStepHelper.StartTestStep(testStep); string HeaderId = cdis_Service_Method.UpdateMember_AddTransactionRequiredDate(member, date); testStep.SetOutput("Updated Transaction for the member LoyaltyID " + basePages.GetLoyaltyNumber(member) + " with Transaction number " + HeaderId); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5B:Transaction1 Search and Verify Purchase History With Specific Date Range stepName = "Transaction1 : Search and Verify Purchase History "; testStep = TestStepHelper.StartTestStep(testStep); CSPMemberAccountActivityPage.SelectDate_RC(FromDate, ToDate); testStep.SetOutput(CSPMemberAccountActivityPage.VerifyPurchaseHistoryBasedonHeaderId(HeaderId)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6A: Adding Transaction2 through CDIS stepName = "Adding Transaction2 through CDIS"; testStep = TestStepHelper.StartTestStep(testStep); string HeaderId1 = cdis_Service_Method.UpdateMember_AddTransactionRequiredDate(member, date); testStep.SetOutput("Updated Transaction for the member LoyaltyID " + basePages.GetLoyaltyNumber(member) + " with Transaction number " + HeaderId1); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6B:Transaction2 Search and Verify Purchase History With Specific Date Range stepName = "Transaction2 : Search and Verify Purchase History "; testStep = TestStepHelper.StartTestStep(testStep); CSPMemberAccountActivityPage.SelectDate_RC(FromDate, ToDate); testStep.SetOutput(CSPMemberAccountActivityPage.VerifyPurchaseHistoryBasedonHeaderId(HeaderId1)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7A: Adding Transaction3 through CDIS stepName = "Adding Transaction3 through CDIS"; testStep = TestStepHelper.StartTestStep(testStep); string HeaderId2 = cdis_Service_Method.UpdateMember_AddTransactionRequiredDate(member, date); testStep.SetOutput("Updated Transaction for the member LoyaltyID " + basePages.GetLoyaltyNumber(member) + " with Transaction number " + HeaderId2); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7B:Transaction3 Search and Verify Purchase History With Specific Date Range stepName = "Transaction3 : Search and Verify Purchase History "; testStep = TestStepHelper.StartTestStep(testStep); CSPMemberAccountActivityPage.SelectDate_RC(FromDate, ToDate); testStep.SetOutput(CSPMemberAccountActivityPage.VerifyPurchaseHistoryBasedonHeaderId(HeaderId2)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); //CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA346_MPVerifyCouponsBasedOnDifferentDatesSearchOnMyWalletPage() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; try { #region Object Initialization var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); common = new Common(DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); var cSPortal_CustomerAppeasementsPage = new CSPortal_CustomerAppeasementsPage(DriverContext); var MPortal_LoginPage = new MemberPortal_LoginPage(DriverContext); ProjectBasePage basePages = new ProjectBasePage(driverContext); var memberPortal_MyWalletPage = new MemberPortal_MyWalletPage(DriverContext); var memberPortal_MyAccountPage = new MemberPortal_MyAccountPage(DriverContext); #endregion #region Precondtion:Create Member cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service and Adding Coupon to the Member"; Member output = basePages.CreateMemberThroughCDIS(); GetCouponDefinitionsOut def = cdis_Service_Method.GetCouponDefinitions(); long memberCouponId = cdis_Service_Method.AddMemberCoupon(basePages.GetLoyaltyNumber(output), def.CouponDefinition[0].Id); testStep.SetOutput("Member UserName: "******" Added Successfully with Coupon : " + def.CouponDefinition[0].Name); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step1:Launch Member Portal stepName = "Launch Member Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var MemberPortal_LoginPage = new MemberPortal_LoginPage(DriverContext); MemberPortal_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out string Output); testStep.SetOutput(Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As Member stepName = "Login As Member User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = output.Username; login.Password = "******"; string MemberLoyaltyNumber = DatabaseUtility.GetLoyaltyID(output.IpCode.ToString()); MemberPortal_LoginPage.LoginMemberPortal(login.UserName, login.Password, out string Message); testStep.SetOutput(Message); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to Mywallet page stepName = "Navigate to Mywallet page"; testStep = TestStepHelper.StartTestStep(testStep); memberPortal_MyAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyWallet, out string message); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Verify My Coupons section stepName = "Verify My Coupons section"; testStep = TestStepHelper.StartTestStep(testStep); memberPortal_MyWalletPage.VerifyMyCouponSection(def.CouponDefinition[0].Name, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Verify My Coupons VIEW,Send To My Wallet,PRINT,DONE and Share Button Options stepName = "Verify My Coupons VIEW,Send To My Wallet,PRINT,DONE and Share Button Options"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = memberPortal_MyWalletPage.VerifyMyCouponsButtonOptions(out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Logout from member portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); MemberPortal_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA121_CSP_LoginAsCsAdmins() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep);; var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Verify First Name and Last Name stepName = "Verify First Name and Last Name"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_HomePage = new CSPortal_HomePage(DriverContext); Step_Output = CSP_HomePage.VerifyFirstNameAndLastName("csadmin", "csadmin"); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout As csadmin is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA85_Navigator_Users_CreateAttributSets() { ProjectBasePage basePages = new ProjectBasePage(driverContext); var attributeSetData = new NonAdminUserData(driverContext); MethodBase method = MethodBase.GetCurrentMethod(); string methodName = method.Name; testCase = new TestCase(methodName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; try { #region Step1:Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As User Admin User stepName = "Login As User Admin User and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; NonAdminUserData Wesitedata = new NonAdminUserData(driverContext); navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigating Model and Navigate to Attribute Set page stepName = "Navigating Model and Navigate to Attribute Set page"; testStep = TestStepHelper.StartTestStep(testStep); var models_HomePage = new Navigator_ModelHomePage(DriverContext); models_HomePage.NavigateToModels_Page(out string Pageoutput); testStep.SetOutput(Pageoutput); models_HomePage.NavigatetoToAttributeSet_Page(out Pageoutput); testStep.SetOutput(Pageoutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Create Attributes set , Add Attribute sets and Generate Table var attributeSetPage = new Navigator_AttributeSetPage(DriverContext); attribute.MainAttributeSets = "Member"; string randomStr = RandomDataHelper.RandomString(4); attribute.AttributeSets = attributeSetData.AttributeSets; attribute.Attributes = attributeSetData.Attribute; stepName = "Create Attributes set" + attribute.MainAttributeSets + " Add Attributes to the attribute set:" + attribute.Attributes + " is Successful and Generate Table is successful"; testStep = TestStepHelper.StartTestStep(testStep); attributeSetPage.CreateAttributeSet(attribute.MainAttributeSets, attribute.AttributeSets); if (attributeSetPage.CreateAttributes(attribute.MainAttributeSets, attribute.AttributeSets, attribute.Attributes, attribute.Attributes, attribute.Attributes, "String", "1", "20").Contains("Attribute Element is Created Successfully")) { attributeSetPage.GenerateTable(attribute.MainAttributeSets, attribute.AttributeSets); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Navigate to Websites and Select Website as BTA_Dev_CS and Module Type as Member Profile stepName = "Navigate to Websites and Select Website as BTA_Dev_CS and Module Type as Member Profile"; testStep = TestStepHelper.StartTestStep(testStep); var Website = new Application_Nav_Util_Page(DriverContext); Website.OpenApplication(NavigatorEnums.ApplicationName.website); var websitePage = new Navigator_Users_WebsitePage(DriverContext); websitePage.NavigateToWebsiteTab(Navigator_Users_WebsitePage.WebsiteTabs.Modules, out string msg); var Website_Modules = new Navigator_Users_Website_ModulesPage(DriverContext); var webSiteName = Wesitedata.CSPortal_WebSiteName; var moduleType = EnumUtils.GetDescription(Navigator_Users_Website_ModulesPage.ModuleTypeList.MemberProfile); Website_Modules.Website_Select_WebsiteAndModuleType(webSiteName, moduleType); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Config Attribute set to CS portal stepName = "Select CSMemberRegConfig file and Drag Drap above created Attribute"; testStep = TestStepHelper.StartTestStep(testStep); Website_Modules.CSMemberRegConfigurebutton(); Website_Modules.DragandDropAttibuteSet(attribute.Attributes, "Country"); Website_Modules.SaveConfigSetting(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Bounce the CS portal App pool stepName = "Bounce the CS Portal App pool"; testStep = TestStepHelper.StartTestStep(testStep); var WebsiteManagement = new Navigator_Users_WebsiteManagementPage(DriverContext); WebsiteManagement.Navigator_Website_Select_WebsiteManagementTab(); WebsiteManagement.BounceAppPool("CSPortal"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Launch CS Portal and Login to CS Portal as csadmin stepName = "Launch CS Portal and Login to CS Portal as csadmin"; testStep = TestStepHelper.StartTestStep(testStep); var CSPortal_LoginPage = new CSPortal_LoginPage(DriverContext); CSPortal_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); string username = CsPortalData.csadmin; string password = CsPortalData.csadmin_password; CSPortal_LoginPage.LoginCSPortal(username, password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Navigate to Member Registration page and Verify Attribute stepName = "Navigate to Member Registration page and Verify Attribute:" + attribute.Attributes; testStep = TestStepHelper.StartTestStep(testStep); var CSPortal_HomePage = new CSPortal_HomePage(DriverContext); CSPortal_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, out string message); var CSPortal_MemberRegistration = new CSPortal_MemberRegistrationPage(DriverContext); CSPortal_MemberRegistration.VerifyAttributeSetonRegisterPage(attribute.Attributes); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Passed"); } catch (Exception e) { ProjectBasePage.UpdateTestcaseStatus(method.Name.ToString(), "Failed"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); if (!OrderTest_Status.Contains("true")) { Assert.Fail(); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); } } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA139_CSP_Member_Search() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; try { Common common = new Common(DriverContext); #region Precondtion:Create Members CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Adding member with CDIS service"; Member output = cdis_Service_Method.AddCDISMemberWithAllFields(); string LoyaltyNumber = DatabaseUtility.GetLoyaltyID(output.IpCode.ToString()); testStep.SetOutput("Generated :" + output.IpCode + ",Name:" + output.FirstName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(LoyaltyNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Select and Verify Loyalty ID stepName = "Select and Verify Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); CSPSearchPage.Select(output.FirstName); var CSPAccountSummaryPage = new CSPortal_MemberAccountSummaryPage(DriverContext); stepstatus = CSPAccountSummaryPage.VerifyLoyaltyId(LoyaltyNumber, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Search Based on Email ID stepName = "Search Based on Email ID"; var CSP_HomePage = new CSPortal_HomePage(DriverContext); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberSearch, out stepName); testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_EmailID(output.PrimaryEmailAddress, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Search Based on FirstName stepName = "Search Based on FirstName"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_FirstName(output.FirstName, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Search Based on Last Name stepName = "Search Based on Last Name"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_LastName(output.LastName, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Search With no Inputs stepName = "Search With no Inputs"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_WithBlankInputs(out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Logout As csadmin stepName = "Logout As csadmin"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA11_CSP_ForgotPasswordNegativeScenario() { #region TestData login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; AgentRegistration agent = new AgentRegistration(); agent.FistName = AgentValues.ForgotPasswordTestAgent; agent.LastName = AgentValues.ForgotPasswordTestAgent; agent.Role = RoleValue.Admin.ToString(); agent.UserName = AgentValues.ForgotPasswordTestAgent; agent.Status = AgentRegistration.AgentStatus.Active.ToString(); agent.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); string ResetCode = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(4); string ExpectedErrorMessage = "The reset code you entered is invalid."; #endregion #region Object Initialization ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPortal_UserAdministration = new CSPortal_UserAdministration(DriverContext); var CSPortal_UserAdministrationAgentPage = new CSPortal_UserAdministrationAgentPage(DriverContext); var CSP_ForgotPassword = new CSPortal_ForgotPassword(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); #endregion try { CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.LoginCSPortal(login, listOfTestSteps); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, listOfTestSteps); CSPortal_UserAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents, listOfTestSteps); CSPortal_UserAdministrationAgentPage.CreateAgent(agent, listOfTestSteps); CSP_HomePage.LogoutCSPortal(listOfTestSteps); CSP_LoginPage.LaunchCSPortal(login.Csp_url, listOfTestSteps); CSP_LoginPage.ClickForgotPassword(listOfTestSteps); CSP_ForgotPassword.EnterUserNameandClickOnSubmit(agent.UserName, listOfTestSteps); CSP_ForgotPassword.SelectEmailOption(listOfTestSteps); CSP_ForgotPassword.ClickSendResetCodeButton(listOfTestSteps); CSP_ForgotPassword.SelectAlreadyHaveResetCode(listOfTestSteps); CSP_ForgotPassword.ClickSendResetCodeButton(listOfTestSteps); CSP_ForgotPassword.EnterResetCodeAnd_ClickOnSubmit(ResetCode, listOfTestSteps); CSP_ForgotPassword.VerifyInvalidResetCodeError(ExpectedErrorMessage, listOfTestSteps); testCase.SetStatus(true); } catch (Exception e) { testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA267_CSP_Issue_Points_By_Admin_Agent() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); var ProjectBase = new ProjectBasePage(DriverContext); try { #region Objects var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var cSPortal_CustomerAppeasementsPage = new CSPortal_CustomerAppeasementsPage(DriverContext); #endregion #region Step1:Adding member with CDIS service stepName = "Adding member with CDIS service"; testStep = TestStepHelper.StartTestStep(testStep); Member user = ProjectBase.CreateMemberThroughCDIS(); testStep.SetOutput("Created Member With LoyaltyId " + ProjectBase.GetLoyaltyNumber(user)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); #endregion #region Step2:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Login As AdminAgent stepName = "Login As AdminAgent User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = AgentValues.AdminAgent; login.Password = AgentValues.Agentpassword; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Login As AdminAgent User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Search Based on Loyalty ID stepName = "Search Based on Loyalty ID"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPSearchPage.Search_BasedOnLoyaltyID(ProjectBase.GetLoyaltyNumber(user), out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Adding points to member beyond range stepName = "Adding points to member beyond range"; testStep = TestStepHelper.StartTestStep(testStep); var userName = user.FirstName; var maxPoints = 200; var points = new System.Random().Next(201, 500).ToString();; CSPSearchPage.Select(userName); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.CustomerAppeasements, out string result); testStep.SetOutput(cSPortal_CustomerAppeasementsPage.AddingPointsToMember(points, maxPoints)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Adding Points To Member stepName = "Adding Points To Member"; testStep = TestStepHelper.StartTestStep(testStep); userName = user.FirstName; points = new System.Random().Next(1, 200).ToString();; CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.CustomerAppeasements, out result); testStep.SetOutput(cSPortal_CustomerAppeasementsPage.AddingPointsToMember(points, maxPoints)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Verify Points in Accountactivity Page stepName = "Verify Points in Accountactivity Page"; testStep = TestStepHelper.StartTestStep(testStep); userName = user.FirstName; CSPSearchPage.Select(userName); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.AccountActivity, out result); cSPortal_CustomerAppeasementsPage.VerifyPointsInAccountActivityPage(points); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Logout As AdminAgent stepName = "Logout As AdminAgent"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep.SetOutput("Logout is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { stepstatus = false; testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA270_CSP_Change_Password() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; bool stepstatus; string StepOutput; try { var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPortal_UserAdministration = new CSPortal_UserAdministration(DriverContext); var CSPortal_UserAdministrationAgentPage = new CSPortal_UserAdministrationAgentPage(DriverContext); AgentRegistration agent = new AgentRegistration(); #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput("Login As csadmin User is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to User Administration stepName = "Navigate to UserAdministration Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Navigate to Agent Page stepName = "Navigate to Agent Page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSPortal_UserAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput("Navigate to Agent Page is Successful"); listOfTestSteps.Add(testStep); #endregion #region Step5:Create new TestAgent user as per config file,if not existed testStep = TestStepHelper.StartTestStep(testStep); agent.FistName = AgentValues.ChangePasswordTestAgent; agent.LastName = AgentValues.ChangePasswordTestAgent; agent.Role = RoleValue.Admin.ToString(); agent.Status = AgentRegistration.AgentStatus.Active.ToString(); agent.UserName = AgentValues.ChangePasswordTestAgent; stepName = "Create New Agent if user is not existed"; agent.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.CreateAgent(agent.FistName, agent.LastName, agent.Role, agent.UserName, agent.Password, agent.Status)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Change Password for Test Agent testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change Password for Test Agent"; stepstatus = CSPortal_UserAdministrationAgentPage.ChangeAgentPassword(agent.UserName, agent.Password, agent.Password, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Logout As Test User stepName = "Logout from CS Portal"; testStep = TestStepHelper.StartTestStep(testStep); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput("LogOut is Successful as csadmin"); listOfTestSteps.Add(testStep); #endregion #region Step8:Login As Test User stepName = "Login As User, User Name:" + agent.UserName; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LoginCSPortal(agent.UserName, agent.Password, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput(stepName); listOfTestSteps.Add(testStep); #endregion #region Step9:Verify First Name and Last Name stepName = "Verify First Name and Last Name"; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(CSP_HomePage.VerifyFirstNameAndLastName(agent.FistName, agent.LastName)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10:Navigate to Change Password testStep = TestStepHelper.StartTestStep(testStep); stepName = "Navigate to Change Password"; stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.ChangePassword, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Stept11: Change Password testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change Password for Test Agent"; var cSP_ChangePassword = new CSPortal_ChangePassword(DriverContext); string agen_OldPassword = agent.Password; agent.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); cSP_ChangePassword.EnterPasswordDetails(agen_OldPassword, agent.Password, agent.Password, out string ValidationMessage); cSP_ChangePassword.SavePassword(); stepstatus = cSP_ChangePassword.VerifySuccessMessage(agen_OldPassword, agent.Password, out StepOutput); testStep.SetOutput(StepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Logout As Test User stepName = "Logout from CS Portal User:"******"WEB")); testStep.SetOutput("LogOut is Successful as User:"******"Login As User, User Name:" + agent.UserName; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LoginCSPortal(agent.UserName, agent.Password, out StepOutput); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput(stepName); #endregion #region Step14:Verify First Name and Last Name stepName = "Verify First Name and Last Name"; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(CSP_HomePage.VerifyFirstNameAndLastName(agent.FistName, agent.LastName)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step15:Logout As Test User stepName = "Logout from CS Portal User:"******"WEB")); testStep.SetOutput("LogOut is Successful as User:"******"WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testStep.SetOutput(e.Message); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA123_CSPCreateDifferentAgent() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); bool stepstatus; string stepName = ""; #region Object Declaration var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSPortal_UserAdministration = new CSPortal_UserAdministration(DriverContext); var CSPortal_UserAdministrationAgentPage = new CSPortal_UserAdministrationAgentPage(DriverContext); AgentRegistration agent = new AgentRegistration(); #endregion try { #region Step1:Launch CSPortal Portal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); var CSP_LoginPage = new CSPortal_LoginPage(this.DriverContext); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Navigate to User Administration testStep = TestStepHelper.StartTestStep(testStep); stepstatus = CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out stepName); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Create AdminAgent if it does not exists testStep = TestStepHelper.StartTestStep(testStep); stepName = "Create AdminAgent if it does not exists"; stepstatus = CSPortal_UserAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); agent.FistName = "AdminFirstName"; agent.LastName = "AdminLastName"; agent.Role = RoleValue.Admin.ToString(); agent.UserName = AgentValues.AdminAgent; agent.Password = AgentValues.Agentpassword; agent.Status = AgentRegistration.AgentStatus.Active.ToString(); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.CreateAgent(agent.FistName, agent.LastName, agent.Role, agent.UserName, agent.Password, agent.Status)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5:Verify Login As Admin Agent Verify Dashboard Links and Logout testStep = TestStepHelper.StartTestStep(testStep); stepName = "Login As AdminAgent Verify Dashboard Links and Logout"; CSP_HomePage.LogoutCSPortal(); CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.VerifyDashboard_Links(agent.UserName)); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Create SrAdminAgent if it does not exists testStep = TestStepHelper.StartTestStep(testStep); agent.FistName = "SrFirstName"; agent.LastName = "SrLastName"; agent.Role = RoleValue.SrAdmin.ToString(); agent.UserName = AgentValues.SrAdminAgent; agent.Password = AgentValues.Agentpassword; agent.Status = AgentRegistration.AgentStatus.Active.ToString(); CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out stepName); stepName = "Create SrAdminAgent if it does not exists"; stepstatus = CSPortal_UserAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.CreateAgent(agent.FistName, agent.LastName, agent.Role, agent.UserName, agent.Password, agent.Status)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Verify Login As Sr.Admin Agent Verify Dashboard Links and Logout testStep = TestStepHelper.StartTestStep(testStep); stepName = "Login As SrAdmin Verify Dashboard Links and Logout"; CSP_HomePage.LogoutCSPortal(); CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.VerifyDashboard_Links(agent.UserName)); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Create JrAdminAgent if it does not exists testStep = TestStepHelper.StartTestStep(testStep); agent.FistName = "JrFirstName"; agent.LastName = "JrLastName"; agent.Role = RoleValue.JrAdmin.ToString(); agent.UserName = AgentValues.JrAdminAgent; agent.Password = AgentValues.Agentpassword; agent.Status = AgentRegistration.AgentStatus.Active.ToString(); CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.UserAdministration, out stepName); stepName = "Create JrAdminAgent if it does not exists"; stepstatus = CSPortal_UserAdministration.NavigateToSectionMenu(CSPortal_UserAdministration.Menu.Agents); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.CreateAgent(agent.FistName, agent.LastName, agent.Role, agent.UserName, agent.Password, agent.Status)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Verify Login As Jr Admin Agent Verify Dashboard Links and Logout testStep = TestStepHelper.StartTestStep(testStep); stepName = "Login As JrAdminAgent Verify Dashboard Links and Logout"; CSP_HomePage.LogoutCSPortal(); CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out Step_Output); testStep.SetOutput(Step_Output); testStep.SetOutput(CSPortal_UserAdministrationAgentPage.VerifyDashboard_Links(agent.UserName)); CSP_HomePage.LogoutCSPortal(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName + e, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_513_MP_ForgotPassword() { ProjectBasePage basePages = new ProjectBasePage(driverContext); testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); string stepName = ""; string stepOutput = ""; bool stepstatus = false; string BTA_DEV_MP_LogPath = MemberPortalData.BTA_DEV_MP_LogPath; try { var MP_ForgotPassword = new MemberPortal_ForgotPassword(DriverContext); var MPortal_LoginPage = new MemberPortal_LoginPage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSP_SearchPage = new CSPortal_SearchPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); var MP_Profile = new MemberProfile(DriverContext); var member = MP_Profile.GenerateMemberBasicInfo(); var details = MP_Profile.GenerateMemberDetails(); var myAccountPage = new MemberPortal_MyAccountPage(driverContext); var myProfilePage = new MemberPortal_MyProfilePage(driverContext); #region Step1:Launch CSPortal stepName = "Launch Customer Service Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); CSP_LoginPage.LaunchCSPortal(login.Csp_url, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2:Login As csadmin stepName = "Login As csadmin User"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = CsPortalData.csadmin; login.Password = CsPortalData.csadmin_password; CSP_LoginPage.LoginCSPortal(login.UserName, login.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3:Create new member user as per config file,if not existed stepName = "Create new member user as per config file,if not existed"; testStep = TestStepHelper.StartTestStep(testStep); member.FirstName = MemberPortalData.ForgotPasswordTestMember; member.LastName = MemberPortalData.ForgotPasswordTestMember; member.Username = MemberPortalData.ForgotPasswordTestMember; member.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); bool isMemberExists = CSP_SearchPage.VerifyMemberExists(member.Username, out stepOutput); testStep.SetOutput(stepOutput); if (!isMemberExists) { CSP_HomePage.NavigateToDashBoardMenu(CSPortal_HomePage.DashBoard.MemberRegistration, out stepOutput); stepstatus = CSP_RegistrationPage.EnterBasicInfo_Details(member.FirstName, member.LastName, member.MiddleName, details.Gender, out stepOutput); stepstatus = CSP_RegistrationPage.EnterContactInfo_Details(member.PrimaryEmailAddress, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, member.PrimaryPhoneNumber, out stepOutput); stepstatus = CSP_RegistrationPage.EnterLoginCredentials_Details(member.Username, member.Password, out stepOutput); stepstatus = CSP_RegistrationPage.EnterOptIn_Out_Details("DirectMailOptIn", "EmailOptIn", "SmsOptIn", out stepOutput); CSP_RegistrationPage.SaveRegistration(); testStep.SetOutput("Member created successfully with username: "******"WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4:Logout as Csadmin stepName = "Logout from CS Portal User:"******"WEB")); testStep.SetOutput("Logout is Successful as User: "******"Launch Member Portal URL"; testStep = TestStepHelper.StartTestStep(testStep); MPortal_LoginPage.LaunchMemberPortal(login.MemberPortal_url, out string Message); MP_ForgotPassword.GetInitialWordCountFromLogFile(BTA_DEV_MP_LogPath); testStep.SetOutput("Launch Member Portal URL is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6:Click on Forgot Password stepName = "Click on Forgot Password"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MPortal_LoginPage.ClickForgotPassword(); testStep.SetOutput("Clicked on Forgot Password Successfully"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7:Enter valid user name and click Submit button stepName = "Enter a valid user name and click Submit button"; testStep = TestStepHelper.StartTestStep(testStep); MP_ForgotPassword.EnterUserName(member.Username); MP_ForgotPassword.ClickSubmitButton(); testStep.SetOutput("Entered User name: " + member.Username + " and clicked on Submit button"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8:Select Email option to receive reset code stepName = "Select Email option to receive reset code"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MP_ForgotPassword.SelectEmailOption(); testStep.SetOutput("Selected Email Option to receive reset code"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9:Click on Send my reset code stepName = "Click on Send my reset code"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MP_ForgotPassword.ClickSendResetCodeButton(); testStep.SetOutput("Clicked on Send my reset code"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step10: Select I already have a reset code option stepName = "Select I already have a reset code option"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MP_ForgotPassword.SelectAlreadyHaveResetCode(); testStep.SetOutput("Selected I already have a reset code option"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step11:Click on Send my reset code stepName = "Click on Send my reset code"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MP_ForgotPassword.ClickSendResetCodeButton(); testStep.SetOutput("Clicked on Send my reset code"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step12:Enter the reset code received in the Log stepName = "Enter the reset code received in the Log"; testStep = TestStepHelper.StartTestStep(testStep); MP_ForgotPassword.EnterResetCodeFromLogFile(BTA_DEV_MP_LogPath, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step13:Click on Submit button stepName = "Click on Submit button"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MP_ForgotPassword.ClickSubmitButton(); testStep.SetOutput("Clicked on Submit button"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step14:Create new Password for Test User stepName = "Create new Passwod for Test User"; testStep = TestStepHelper.StartTestStep(testStep); member.Password = RandomDataHelper.RandomAlphanumericStringWithSpecialChars(8); stepstatus = MP_ForgotPassword.CreateNewPassword(member.Username, member.Password, member.Password, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step15:Return back to login page stepName = "Return back to login page"; testStep = TestStepHelper.StartTestStep(testStep); stepstatus = MP_ForgotPassword.ReturnToLoginPage(out stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); testStep.SetOutput(stepOutput); listOfTestSteps.Add(testStep); #endregion #region Step16:Login with the newly created Password stepName = "Login with User, User Name: " + member.FirstName + " with newly reset Password: "******"WEB")); testStep.SetOutput(stepName); listOfTestSteps.Add(testStep); #endregion #region Step17:Verify successful navigation to Member Portal home page stepName = "Verify successful navigation to Member Portal home page"; testStep = TestStepHelper.StartTestStep(testStep); testStep.SetOutput(MPortal_LoginPage.VerifyMemberPortalLoginSuccessfulForUser(member.FirstName, member.LastName)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step18:Navigate to My Profile page stepName = "Navigate to My Profile page"; testStep = TestStepHelper.StartTestStep(testStep); myAccountPage.NavigateToMPDashBoardMenu(MemberPortal_MyAccountPage.MPDashboard.MyProfile, out var Step_Output); var strStatus = Step_Output; testStep.SetStatus(myProfilePage.VerifyMyProfilePage(MemberPortal_MyProfilePage.Sections.MyProfile.ToString(), out Step_Output)); strStatus = strStatus + ". " + Step_Output; testStep.SetOutput(strStatus); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Stept19:Change Password for Test Member to default testStep = TestStepHelper.StartTestStep(testStep); stepName = "Change Password for Test Member to default"; string agen_OldPassword = member.Password; string agent_DefaultPassword = AgentValues.Agentpassword; myProfilePage.ChangePassword(agen_OldPassword, agent_DefaultPassword, agent_DefaultPassword); stepstatus = myProfilePage.VerifySuccessMessage(agen_OldPassword, agent_DefaultPassword, out stepOutput); testStep.SetOutput(stepOutput); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, stepstatus, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step20:Logout from Member portal stepName = "Logout from Member Portal"; testStep = TestStepHelper.StartTestStep(testStep); MPortal_LoginPage.LogoutMPPortal(); testStep.SetOutput("Logout from Member Portal is Successful"); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }
public void BTA_70_LN_ProductCount_AfterAppeasements() { #region Object Declaration testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); Common common = new Common(DriverContext); CategoryFields product = new CategoryFields(); ProjectBasePage basePages = new ProjectBasePage(driverContext); NonAdminUserData data = new NonAdminUserData(driverContext); var application_Nav_Util_Page = new Application_Nav_Util_Page(DriverContext); var rewardCatlog_productImagePage = new Navigator_Users_Program_RewardCatalog_ProductImagesPage(DriverContext); var navigator_Users_ProgramPage = new Navigator_Users_ProgramPage(DriverContext); var Program_ComponentsPage = new Navigator_Users_Program_ComponentsPage(DriverContext); var navigator_CreateProduct_Category = new Navigator_Users_Program_Components_CategoriesPage(DriverContext); var navigator_CreateBonus = new Navigator_Users_Program_eCollateral_BonusesPage(DriverContext); var RewardCatalog_ProductsPage = new Navigator_Users_Program_RewardCatalog_ProductsPage(DriverContext); var Program_RewardCatalogPage = new Navigator_Users_Program_RewardCatalogPage(DriverContext); var RewardCatalog_RewardsPage = new Navigator_Users_Program_RewardCatalog_RewardsPage(DriverContext); var RewardCatalog_ProductVariantsPage = new Navigator_Users_Program_RewardCatalog_ProductVariantsPage(DriverContext); var navigator_LoginPage = new Navigator_LoginPage(DriverContext); var CSP_LoginPage = new CSPortal_LoginPage(DriverContext); var CSPSearchPage = new CSPortal_SearchPage(DriverContext); var CSP_RegistrationPage = new CSPortal_MemberRegistrationPage(DriverContext); var CSP_HomePage = new CSPortal_HomePage(DriverContext); var cSPortal_CustomerAppeasementsPage = new CSPortal_CustomerAppeasementsPage(DriverContext); var MPortal_LoginPage = new MemberPortal_LoginPage(DriverContext); var MP_MyAccountPage = new MemberPortal_MyAccountPage(DriverContext); var myAccountPage = new MemberPortal_MyAccountPage(driverContext); var myWalletPage = new MemberPortal_MyWalletPage(driverContext); var Mp_LoginPage = new MemberPortal_LoginPage(DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); string stepName = ""; #endregion try { #region Object Initialization var attName = data.AttributeAllContentType; product.SetType = "Product Name"; Member output = cdis_Service_Method.GetCDISMemberGeneral(); IList <VirtualCard> vc = output.GetLoyaltyCards(); #endregion #region Step1: Launch Navigator Portal stepName = "Launch Navigator URL"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.LaunchNavigatorPortal(login.Url, out string LaunchMessage); testStep.SetOutput(LaunchMessage); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step2: Login As User Admin stepName = "Login As User Admin and Navigate to Home page by selecting Organization and Environment"; testStep = TestStepHelper.StartTestStep(testStep); login.UserName = NavigatorUsers.NonAdminUser; login.Password = NavigatorUsers.NavigatorPassword; navigator_LoginPage.Login(login, Users.AdminRole.USER.ToString(), out string stroutput); testStep.SetOutput(stroutput); var navigator_UsersHomePage = new Navigator_UsersHomePage(DriverContext); navigator_UsersHomePage.Navigator_Users_SelectOrganizationEnvironment(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step3: Verify the existence of category and create category if doesn't exist stepName = "Verify the existence of category and create category if doesn't exist"; product.CategoryTypeValue = CategoryFields.CategoryType.Product.ToString(); product.CategoryName = data.ProductCategoryName; testStep = TestStepHelper.StartTestStep(testStep); application_Nav_Util_Page.OpenApplication(NavigatorEnums.ApplicationName.program); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.Components); Program_ComponentsPage.NavigateToProgramComponentsTab(Navigator_Users_Program_ComponentsPage.ComponentsTabs.Categories); testStep.SetOutput(navigator_CreateProduct_Category.CreateCategory(product)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step4: Create a new Product with quantity as 3 and search the newly created product var contentType = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Product; product.Name = data.ProductName + RandomDataHelper.RandomString(4); product.AttributeName = attName + contentType.ToString(); product.ValueToSetInAttribute = "ValueGivenForAttributeSetProduct"; stepName = "Create New Product with Qunatity as " + product.Name + ""; testStep = TestStepHelper.StartTestStep(testStep); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog); Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Products); testStep.SetOutput(RewardCatalog_ProductsPage.CreateProductWithQuantity(product, product.ProductQuantity)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step5: Verify LW_product table to see if quantity is showing up as 3 stepName = "Verify LW_product table to see if quantity is showing up as 5"; List <string> TransactionList_Header = new List <string>(); testStep = TestStepHelper.StartTestStep(testStep); var Name = ProjectBasePage.GetProductDetailsFromProductTableFromDB(product.Name, product.Quantity, out string Step_Output); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step6: Create new reward and Verify CategoryFields reward = new CategoryFields(); reward.Name = data.RewardName + RandomDataHelper.RandomString(5); reward.BalanceNeeded = "0"; reward.CategoryTypeValue = product.Name; reward.SetType = "Reward Name"; var date = DateTime.Now; reward.StartDate = date.ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); reward.ExpiryDate = date.AddYears(10).ToString("MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US")); stepName = "Create new reward for product as " + reward.Name + ""; testStep = TestStepHelper.StartTestStep(testStep); reward.ValueToSetInAttribute = "ValueGivenForAttributeSetReward"; contentType = Navigator_Users_Program_Components_AttributesPage.ContentTypes.Reward; reward.AttributeName = attName + contentType.ToString(); navigator_Users_ProgramPage.NavigateToProgramTab(Navigator_Users_ProgramPage.ProgramTabs.RewardCatalog); Program_RewardCatalogPage.NavigateToProgramRewardCatalogTab(Navigator_Users_Program_RewardCatalogPage.RewardCatalogTabs.Rewards); testStep.SetOutput(RewardCatalog_RewardsPage.CreateReward_With_Product(reward)); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step7: Make Reward Customer Appeasement stepName = "Make Reward Customer Appeasement "; RewardCatalogSummaryStruct rewarddata = new RewardCatalogSummaryStruct(); rewarddata.RewardName = reward.Name; rewarddata.TypeCode = RandomDataHelper.RandomString(5); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Appease Rewards to Members using SOAP Services"; RewardCatalog_RewardsPage.RewardCustomerAppeasement(product.ProductQuantity, vc[0].LoyaltyIdNumber, rewarddata); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step8: Verify LW_product table to see if quantity is showing up as 3 stepName = "Verify LW_product table to see if quantity is showing up as 5"; testStep = TestStepHelper.StartTestStep(testStep); var result = RewardCatalog_RewardsPage.VerifyProductQuantityAfterRewardCustomerAppeasement(product); testStep.SetOutput(Step_Output); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, result, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion #region Step9: Logout stepName = "Logout from USER page"; testStep = TestStepHelper.StartTestStep(testStep); navigator_LoginPage.Logout(); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); #endregion testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); testCase.SetImageContent(DriverContext.TakeScreenshot().ToString()); Assert.Fail(); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }