public void ATC85893_AX7098EFTReceiptRecordEFTreceiptfrombankstatementitem() { //Create Bank Statement file with invalid reference string filelocation = Utils.BAI2FileCreator.bAI2InvalidRefFileCreator(); string paymentreference = filelocation.Substring(filelocation.Length - 12, 8); string initialContribution = "500.00"; Homepage homePage = new Homepage(); homePage.ClickCompanyButton(); SelectCompanyPage selectCompanyPage = new SelectCompanyPage(); Table table = new Table(selectCompanyPage.GetCompanyListTable()); table.ClickCellValue("Company", "RTB", "Company"); selectCompanyPage.ClickOkButton(); homePage.ClickHomeTab(); homePage.ClickCashandBankManagementTab(); homePage.ClickBankStatementsLink(); homePage.ClickImportStatementButton(); BAI2FileImportPage bai2FileImportPage = new BAI2FileImportPage(); bai2FileImportPage.SetStatmentFormatText("CBA BAI2"); bai2FileImportPage.SetImportFileFolderCheckBox(false); bai2FileImportPage.SetFileNamelocationText(filelocation); bai2FileImportPage.SetReconcileImportCheckBox(true); bai2FileImportPage.ClickOKButton(); InfoLogPage infoLogPage = new InfoLogPage(); string bvdTreeItem = infoLogPage.GetTreeItemName("Journal BDV", "Posting"); string BVD = bvdTreeItem.Substring(8, 9); Assert.IsTrue(infoLogPage.GetTreeItemExists("1 files have been imported in total.", "Posting")); infoLogPage.ClickClearButton(); infoLogPage.ClickCloseButton(); homePage.ClickBackNavButton(); homePage.ClickHomeTab(); homePage.ClickBondManagementTab(); homePage.ClickReceiptJournalsLink(); BondReceiptJournalPage bondReceiptJournalPage = new BondReceiptJournalPage(); bondReceiptJournalPage.SetShowAllText("All"); Keyboard.SendKeys("{ENTER}"); table = new Table(bondReceiptJournalPage.GetBondReceiptTable()); table.FilterCellValue("Bond journal"); bondReceiptJournalPage.ClickFilterMenuItem(); FilterPage filterPage = new FilterPage(); filterPage.SetFilterText("Bond journal",BVD); filterPage.ClickOkButton(); //StringAssert.Contains(table.GetCellValue("Bond journal", BVD, "Description"), RTB); table.ClickCellValue("Bond journal", BVD, "Bond journal"); bondReceiptJournalPage.ClickLinesMenuItem(); BondReceiptJournalLinesPage bondReceiptJournalLines = new BondReceiptJournalLinesPage(); table = new Table(bondReceiptJournalLines.GetBondReceiptJournalLinesTable()); StringAssert.Contains(table.GetCellValue("Payment reference", paymentreference, "Allocated amount"), "0.00"); StringAssert.Contains(table.GetCellValue("Payment reference", paymentreference, "Amount"), initialContribution); bondReceiptJournalLines.ClickInquiryButton(); bondReceiptJournalLines.ClickBondTransactionsMenuItem(); BondTransactionsPage bondTransactionsPage = new BondTransactionsPage(); table = new Table(bondTransactionsPage.GetBondTransactionTable()); StringAssert.Contains(table.GetCellContainsValue("Bond client", "[UNKNOWN]", "Amount"), initialContribution); StringAssert.Contains(table.GetCellValue("Type", "Receipt", "Amount"), initialContribution); StringAssert.Contains(table.GetCellValue("Type", "Receipt allocation", "Amount"), "-" + initialContribution); bondTransactionsPage.ClickCloseButton(); bondReceiptJournalLines.ClickCloseButton(); bondReceiptJournalPage.ClickCloseButton(); }
public void ATC85892d_AX7098EFTReceiptRecordEFTreceiptfrombankstatementitem() { #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 == 858923) { MyRow = i; break; } } #endregion string filelocation = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("OUTFILE")].Value.ToString(); string paymentreference = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAY_REF_NUMBER")].Value.ToString(); string batchRequestReference = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value.ToString(); string managingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); string initialContribution = Convert.ToDouble(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value).ToString("N2"); Homepage homePage = new Homepage(); homePage.ClickCompanyButton(); SelectCompanyPage selectCompanyPage = new SelectCompanyPage(); Table table = new Table(selectCompanyPage.GetCompanyListTable()); table.ClickCellValue("Company", "RTB", "Company"); selectCompanyPage.ClickOkButton(); homePage.ClickHomeTab(); homePage.ClickCashandBankManagementTab(); homePage.ClickBankStatementsLink(); homePage.ClickImportStatementButton(); BAI2FileImportPage bai2FileImportPage = new BAI2FileImportPage(); bai2FileImportPage.SetStatmentFormatText("CBA BAI2"); bai2FileImportPage.SetImportFileFolderCheckBox(false); bai2FileImportPage.SetFileNamelocationText(filelocation); bai2FileImportPage.SetReconcileImportCheckBox(true); bai2FileImportPage.ClickOKButton(); InfoLogPage infoLogPage = new InfoLogPage(); string bvdTreeItem = infoLogPage.GetTreeItemName("Journal BDV", "Posting"); string BVD = bvdTreeItem.Substring(8, 9); Assert.IsTrue(infoLogPage.GetTreeItemExists("1 files have been imported in total.", "Posting")); infoLogPage.ClickClearButton(); infoLogPage.ClickCloseButton(); homePage.ClickHomeTab(); homePage.ClickBondManagementTab(); homePage.ClickReceiptJournalsLink(); BondReceiptJournalPage bondReceiptJournalPage = new BondReceiptJournalPage(); bondReceiptJournalPage.SetShowAllText("All"); Keyboard.SendKeys("{ENTER}"); table = new Table(bondReceiptJournalPage.GetBondReceiptTable()); table.FilterCellValue("Bond journal"); bondReceiptJournalPage.ClickFilterMenuItem(); FilterPage filterPage = new FilterPage(); filterPage.SetFilterText("Bond journal", BVD); filterPage.ClickOkButton(); //StringAssert.Contains(table.GetCellValue("Bond journal", BVD, "Description"), RTB); table.ClickCellValue("Bond journal", BVD, "Bond journal"); bondReceiptJournalPage.ClickLinesMenuItem(); BondReceiptJournalLinesPage bondReceiptJournalLines = new BondReceiptJournalLinesPage(); table = new Table(bondReceiptJournalLines.GetBondReceiptJournalLinesTable()); StringAssert.Contains(table.GetCellValue("Payment reference", paymentreference, "Allocated amount"), initialContribution); bondReceiptJournalLines.ClickInquiryButton(); bondReceiptJournalLines.ClickBondTransactionsMenuItem(); BondTransactionsPage bondTransactionsPage = new BondTransactionsPage(); table = new Table(bondTransactionsPage.GetBondTransactionTable()); //Add tenancy requests //Get specific row for the data int TR1Row = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value == 858921) { TR1Row = i; break; } } string TR1reference = MyRange.Cells[TR1Row, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value.ToString(); string TR1managingParty = MyRange.Cells[TR1Row, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); string TR1initialContribution = Convert.ToDouble(MyRange.Cells[TR1Row, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value).ToString("N2"); //Get specific row for the data int TR2Row = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value == 858922) { TR2Row = i; break; } } string TR2reference = MyRange.Cells[TR2Row, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value.ToString(); string TR2managingParty = MyRange.Cells[TR2Row, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); string TR2initialContribution = Convert.ToDouble(MyRange.Cells[TR2Row, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value).ToString("N2"); StringAssert.Contains(table.GetCellContainsValue("Bond client", TR1managingParty, "Bond request"), TR1reference); StringAssert.Contains(table.GetCellContainsValue("Bond client", TR1managingParty, "Amount"), TR1initialContribution); StringAssert.Contains(table.GetCellContainsValue("Bond client", TR2managingParty, "Bond request"), TR2reference); StringAssert.Contains(table.GetCellContainsValue("Bond client", TR2managingParty, "Amount"), TR2initialContribution); StringAssert.Contains(table.GetCellValue("Type", "Receipt", "Amount"), initialContribution); bondTransactionsPage.ClickCloseButton(); bondReceiptJournalLines.ClickCloseButton(); bondReceiptJournalPage.ClickCloseButton(); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }