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 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 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); } }