public void ATC6629a_CRMTESTINGEndtoEndSingleFormBPayCRM() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString()== "6629") { MyRow = i; break; } } #endregion User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //read excel file and get test data for this test // store test data in a class so that it can be used later HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestValidationSuccessful( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); string tenancyrequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Equals(tenancyrequest, "TR-BL-"); //Add a new request party //tenancyRequestPage.ClickRequestPartyAssociated(); string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); //Enter Request Party details driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.SetClientNameValue( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString()); tenancyRequestPartyPage.SetAmountValue("500.00"); tenancyRequestPartyPage.ClickSaveCloseButton(); string amountOtherParty = (MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value + 500).ToString(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation successful"); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.SetTenancyRequestSearchText(tenancyrequest); Assert.IsTrue(tenancyRequestsSearchPage.GetPaymentRefernceRefreshTable(tenancyrequest)); Table table = new Table(tenancyRequestsSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyrequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); table = new Table(tenancyRequestPage.GetPaymentSummaryResultTable()); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Tenancy Request"), tenancyrequest); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Request Batch"), ""); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Payment Type"), "BPay"); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Amount"), "$2,000.00"); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Client"), "BLAIR TEST"); string referencenumber = table.GetCellValue("Tenancy Request", tenancyrequest, "Reference Number"); StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Pending Financials"); StringAssert.Contains(tenancyRequestPage.GetFundedStatus(), "Payment pending"); string dateValue = DateTime.Today.AddDays(-1).ToString("yyyyMMdd"); string fileLocation = Utils.BPayFileCreator.bPayFileCreator(referencenumber, dateValue, tenancyrequest, "200000"); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("OUTFILE")].Value = fileLocation; MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value = tenancyrequest; MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAY_REF_NUMBER")].Value = referencenumber; #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC4422_CRMTenancyRequestWithNoContributor() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "TR_TestData") { MyRow = i; break; } } #endregion string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); string initialContribution = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(); string rentalPremises = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(); //Login as RBS user User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //As a RBS Officer, navigate to an Address Detail HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaAddressDetailRibbonButton(); AddressDetailSearchPage addressDetailSearchPage = new AddressDetailSearchPage(driver); addressDetailSearchPage.SetAddressDetailSearchText("MITCHELTON"); Table addressSearchTable = new Table(addressDetailSearchPage.GetSearchResultTable()); addressSearchTable.ClickCellContainsValue("Name", rentalPremises, "Name"); AddressDetailPage addressDetailPage = new AddressDetailPage(driver); //Click on the Tenancy Requests Associated View in the dropdown ribbon menu homePage.HoverAddressDetailRibbonTab(rentalPremises); homePage.ClickTRAddressDetailViewRibbonButton(); addressDetailPage = new AddressDetailPage(driver); string BaseWindow = driver.CurrentWindowHandle; addressDetailPage.ClickAddNewTenancyRequestButton(); addressDetailPage.SwitchNewBrowser(driver, BaseWindow); //Fill in all mandatory details and Click Save&close TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Bond Lodgement. tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); tenancyRequestPage.PopulateTenancyRequestWithoutRentalPremisesFromAddressDetailAssociatedView( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), initialRequestParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), initialContribution, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetDwellingTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("DWELLING_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyRequest, "TR-BL-", "Validating the Tenancy Request saved with the correct TR no fromat"); tenancyRequestPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); //Open the Tenancy Request which was just created addressDetailPage = new AddressDetailPage(driver); addressDetailPage.SetTenancyRequestSearchText(tenancyRequest); Table tenancyRequestSearchTable = new Table(addressDetailPage.GetTenancyRequestSearchResultTable()); tenancyRequestSearchTable.ClickCellContainsValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); Table requestPartyTable = new Table(tenancyRequestPage.GetRequestPartyTable()); //Confirm the tenancy request has only one contributor i.e initial Request Party Assert.AreEqual(requestPartyTable.GetCellContainsValue("Request Amount",initialContribution,"Client"), initialRequestParty); Assert.AreEqual(1, requestPartyTable.GetRowCount()-1,"Validating only one contributor is avaialble"); UICommon.DoubleClickElement(requestPartyTable.GetCellElementContainsValue("Client", initialRequestParty, "Client"), driver); Thread.Sleep(1000); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); //Try to deactivate the contributor. Fails with an error dialog tenancyRequestPartyPage.ClickDeactivateButton(); WarningDialogueFramePage warningPage = new WarningDialogueFramePage(driver); warningPage.ClickProcessBeginButton(); tenancyRequestPartyPage.ClickSaveCloseButton(); //Go back to tenancy request form. The Delete button should not be available for RBS user tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); requestPartyTable = new Table(tenancyRequestPage.GetRequestPartyTable()); Assert.AreEqual(requestPartyTable.GetCellContainsValue("Request Amount", initialContribution, "Client"), initialRequestParty); Assert.AreEqual(1, requestPartyTable.GetRowCount() - 1, "Validating the initial contributor is still avaialble after trying to deactivate"); IWebElement element = requestPartyTable.GetCellElementContainsValue("Client", initialRequestParty, "Request Amount"); Assert.IsFalse(tenancyRequestPage.ClickDeleteButtonIfDisplayed(element),"Validating that delete button not displyed to click"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC7081a_CRMEFTreceiptforSingleBond() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "7081") { MyRow = i; break; } } #endregion string managepingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); string tenancyrequest; User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); string amountPaidLodgement = ((double)Int32.Parse(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString())).ToString("C"); tenancyRequestPage.PopulateTenancyRequestValidationSuccessful( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), managepingParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); tenancyrequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyrequest, "TR-BL-"); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value = tenancyrequest; //Add a new request party //tenancyRequestPage.ClickRequestPartyAssociated(); string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); //Enter Request Party details driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.SetClientNameValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString()); tenancyRequestPartyPage.SetAmountValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC2")].Value.ToString()); tenancyRequestPartyPage.ClickSaveCloseButton(); string amountOtherParty = (MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value + MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC2")].Value).ToString(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); Thread.Sleep(2000); tenancyRequestPage.CheckForErrors(); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation successful"); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.SetTenancyRequestSearchText(tenancyrequest); Assert.IsTrue(tenancyRequestsSearchPage.GetPaymentRefernceRefreshTable(tenancyrequest)); Table table = new Table(tenancyRequestsSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyrequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); table = new Table(tenancyRequestPage.GetPaymentSummaryResultTable()); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Tenancy Request"), tenancyrequest); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Payment Type"), "EFT"); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Amount"), amountPaidLodgement); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Client"), managepingParty); string referencenumber = table.GetCellValue("Tenancy Request", tenancyrequest, "Reference Number"); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAY_REF_NUMBER")].Value = referencenumber; StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Pending Financials"); StringAssert.Contains(tenancyRequestPage.GetFundedStatus(), "Payment pending"); //Create EFT file with new reference number //string fileLocation = Utils.EFTFileCreator.eFTFileCreator(tenancyrequest, referencenumber); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("OUTFILE")].Value = Utils.BAI2FileCreator.bAI2FileCreator(referencenumber, amountOtherParty); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6708_CRMDistributeAmountForContributors() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "6708") { MyRow = i; break; } } #endregion string secondContributor = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString(); string thridContributor = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC2")].Value.ToString(); //Login as RBS Operations Standard user role. User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //Create new Tenancy Request with mandatory fields populated TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); string initialContribution = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(); tenancyRequestPage.PopulateMandatoryFieldValues( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), initialRequestParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), initialContribution, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); //Save Tenancy Record tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); //Inspect Screen for Warnings "Warning displays that {Amount Paid with Lodgement} field <> sum of contributors." string warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating the warning appears"); //Click the ribbon button Distribute and Save the record. Warnings should disappear string alertMessage = tenancyRequestPage.ClickDistributeButton(); StringAssert.Contains(alertMessage, "Distribution process has been initiated"); //TODO:This is an issue an extra save dialog pops up and clicking OK button on this. string saveMessage = tenancyRequestPage.GetAlertMessage(); StringAssert.Contains(saveMessage, "Your changes have not been saved"); warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "","Validating that warning message disappeared"); //Add another contributor and populate amount field with > $1. Save Record. Warning should appear. string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); Thread.Sleep(2000); driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); tenancyRequestPartyPage.SetClientNameValue(secondContributor); tenancyRequestPartyPage.SetAmountValue("100"); tenancyRequestPartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickSaveButton(); //TODO:Issue the waning does not appear without refreshing the record.This is a workaround. homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); Table table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Inspect warning appears warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appears"); //Add another contributor and populate amount field with > $1. Save Record. Warning should appear. BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); Thread.Sleep(2000); driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); tenancyRequestPartyPage.SetClientNameValue(thridContributor); tenancyRequestPartyPage.SetAmountValue("100"); tenancyRequestPartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickSaveButton(); //Inspect warning appears warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appears"); //Click the ribbon button Distribute and Save the record. Warning should disappear. alertMessage = tenancyRequestPage.ClickDistributeButton(); StringAssert.Contains(alertMessage, "Distribution process has been initiated"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickSaveButton(); //Issue the waning does disappear not appear without refreshing the record.This is a workaround. homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Warning disappears warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "", "Validating that warning message disappeared"); //Modify amount paid with lodgemnt to $1500 and inspect warning appears tenancyRequestPage.SetAmountPaidWithLodgement("1500"); tenancyRequestPage.ClickSaveButton(); warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appears"); //TODO:Modify Contibutor amount to be different but still adds up to amount. Inspect warning disappears Table requestPartyTable = new Table(tenancyRequestPage.GetRequestPartyTable()); StringAssert.Contains(requestPartyTable.GetCellContainsValue("Client", secondContributor, "Request Amount"), "400"); BaseWindow = driver.CurrentWindowHandle; UICommon.DoubleClickElement(requestPartyTable.GetCellElementContainsValue("Client", secondContributor, "Client"), driver); Thread.Sleep(1000); driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); tenancyRequestPartyPage.SetAmountValue("700"); tenancyRequestPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickSaveButton(); //TODO.WArnings does not disappear without refreshing the record. This is a workaround. homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Warning disappears warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "", "Validating that warning message disappeared"); //Modify amount paid with lodgement to be $900 tenancyRequestPage.SetAmountPaidWithLodgement("900"); tenancyRequestPage.ClickSaveButton(); //Warning appears warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appesrs"); //Click Distribute and save the record. Warning should disappear tenancyRequestPage.ClickDistributeButton(); tenancyRequestPage.ClickSaveButton(); warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "", "Validating that warning message disappeared"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6911c_TenancytopupvalidationSameaddresssamemanagingparty() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "6911") { MyRow = i; break; } } #endregion string managepingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestValidationSuccessful( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), managepingParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), (MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value + 50).ToString(), "25", "50", "Top up", MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetTenancyValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("BOND_REF")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); string tenancyrequest = tenancyRequestPage.GetRequestNumber(); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value = tenancyrequest; tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); Thread.Sleep(5000); tenancyRequestPage.ClickSaveButton(); Table table = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(table.GetCellContainsValue("Reason", "Invalid list of Parties", "Tenancy Request"), tenancyrequest); table.ClickCellContainsValueEnterRow("Reason", "Invalid list of Parties", "Status Reason"); TenancyRequestQueueReasonPage tenancyRequestQueueReasonPage = new TenancyRequestQueueReasonPage(driver); tenancyRequestQueueReasonPage.SetStatusReasonValue("Resolved", driver); tenancyRequestQueueReasonPage.ClickSaveCloseButton(); tenancyRequestPage = new TenancyRequestPage(driver); table = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Status Reason"), "Resolved"); //Add a new request party string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); //Enter Request Party details driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.SetClientNameValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString()); tenancyRequestPartyPage.SetAmountValue("25"); tenancyRequestPartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); Assert.AreEqual(tenancyRequestPage.GetValidationStatusReason(), "Validation successful"); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.SetTenancyRequestSearchText(tenancyrequest); Assert.IsTrue(tenancyRequestsSearchPage.GetPaymentRefernceRefreshTable(tenancyrequest)); table = new Table(tenancyRequestsSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyrequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); table = new Table(tenancyRequestPage.GetPaymentSummaryResultTable()); string referencenumber = table.GetCellValue("Tenancy Request", tenancyrequest, "Reference Number"); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAY_REF_NUMBER")].Value = referencenumber; StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Pending Financials"); StringAssert.Contains(tenancyRequestPage.GetFundedStatus(), "Payment pending"); ////Create EFT file with new reference number //MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("OUTFILE")].Value = Utils.BAI2FileCreator.bAI2FileCreator(referencenumber, amountOtherParty); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }