use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class MpesaImportTest method importTransactionsFromFileWithNoErrors.
/**
* MPESA - Import transactions from file with no errors
* http://mifosforge.jira.com/browse/MIFOSTEST-688
* @throws Exception
*/
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
@Test(enabled = true)
public void importTransactionsFromFileWithNoErrors() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
AdminPage adminPage = navigationHelper.navigateToAdminPage();
ViewRolesPage viewRolesPage = adminPage.navigateToViewRolesPage();
ManageRolePage manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
manageRolePage.disablePermission("8_3");
viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
adminPage = viewRolesPage.navigateToAdminPage();
adminPage = adminPage.failNavigationToImportTransactionsPage();
adminPage.verifyError("You do not have permissions to perform " + "this activity. Contact your system administrator " + "to grant you the required permissions and try again.");
viewRolesPage = adminPage.navigateToViewRolesPage();
manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
manageRolePage.enablePermission("8_3");
viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
propertiesHelper.setImportTransactionOrder("AL3,AL5");
String dataset = "mpesa_export_dbunit.xml";
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
ImportTransactionsPage importTransactionsPage = importTransaction(path);
checkIfOutputMatchesExpected(path);
importTransactionsPage.cancelImportTransaction();
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
loanAccountPage.verifyExactLoanAmount("2,000");
SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
savingsAccountDetailPage.verifySavingsAmount("0");
adminPage = navigationHelper.navigateToAdminPage();
importTransactionsPage = adminPage.navigateToImportTransactionsPage();
ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);
importTransactionsConfirmationPage.verifyImportSuccess("You have successfully imported transactions.");
loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
loanAccountPage.verifyPerformanceHistory("11", "11");
TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistoryPage();
transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
transactionHistoryPage.verifyPostedBy("mifos", 48);
savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
savingsAccountDetailPage.verifySavingsAmount("3170.0");
savingsAccountDetailPage.verifyDate("28/01/2011");
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class CreateGroupLoanAccountTest method newWeeklyGroupLoanAccount.
//http://mifosforge.jira.com/browse/MIFOSTEST-303
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyGroupLoanAccount() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 25, 1, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setSearchString("groupWithoutLoan");
formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.setAmount("3000.0");
createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 2, 25, 15, 0, 0, 0));
selectAdditionalFees();
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyFirstInstallmentDateAndDisbursalDateOnReviewPage();
verifyAdditionalFeesOnReviewPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
verifyFirstInstallmentDateAndDisbursalDateOnPreviewPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("4");
loanAccountPage.verifyDisbursalDate("25/02/2011");
loanAccountPage.verifyPrincipalOriginal("3,000");
loanAccountPage.verifyLoanTotalBalance("3,466");
loanAccountPage.verifyFeesOriginal("410");
loanAccountPage.verifyInterestOriginal("56");
verifyFees();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "04-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "11-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "18-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "25-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "749.4");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100");
viewRepaymentSchedulePage.navigateToLoanAccountPage();
EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
editLoanAccountStatusParameters.setNote("test");
loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
disburseParameters.setDisbursalDateDD("25");
disburseParameters.setDisbursalDateMM("02");
disburseParameters.setDisbursalDateYYYY("2011");
loanTestHelper.disburseLoan(loanId, disburseParameters);
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class LoanAccountOverdueInterestTest method verifyPayOverdueInstalment.
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyPayOverdueInstalment() throws Exception {
SubmitFormParameters loanParameters = FormParametersHelper.getWeeklyLoanProductParameters();
loanParameters.setOfferingName("OverdueLoan");
loanProductTestHelper.defineNewLoanProduct(loanParameters);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Stu");
searchParameters.setLoanProduct("OverdueLoan");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012.0");
LoanAccountPage loanPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
String loanId = loanPage.getAccountId();
loanPage.changeAccountStatusToAccepted();
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setDisbursalDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
disburseParameters.setDisbursalDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
disburseParameters.setDisbursalDateYYYY(Integer.toString(systemDateTime.getYear()));
disburseParameters.setPaymentType(PaymentParameters.CASH);
loanTestHelper.disburseLoan(loanId, disburseParameters);
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
systemDateTime = systemDateTime.plusDays(20);
dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
ViewRepaymentSchedulePage repaymentPage = loanPage.navigateToRepaymentSchedulePage();
repaymentPage.verifyRepaymentScheduleTablePrincipal(3, "17.3");
repaymentPage.verifyRepaymentScheduleTableInterest(3, "3.7 (0)");
repaymentPage.verifyRepaymentScheduleTablePrincipal(4, "17.4");
repaymentPage.verifyRepaymentScheduleTableInterest(4, "3.6 (0)");
PaymentParameters params = new PaymentParameters();
params.setTransactionDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
params.setTransactionDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
params.setTransactionDateYYYY(Integer.toString(systemDateTime.getYear()));
params.setPaymentType(PaymentParameters.CASH);
params.setAmount("4.2");
loanPage = repaymentPage.navigateToApplyPaymentPage().submitAndNavigateToApplyPaymentConfirmationPage(params).submitAndNavigateToLoanAccountDetailsPage();
loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
repaymentPage = loanPage.navigateToRepaymentSchedulePage();
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(3, "0");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(3, "3.7");
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(5, "17.3");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(5, "0 (3.7)");
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(6, "17.4");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(6, "3.1 (0.5)");
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class CreateClientLoanAccountTest method createDecliningBalanceIRLoanWithFees.
public void createDecliningBalanceIRLoanWithFees() throws SQLException {
int interestRate = 25;
int loanAmount = 120;
int numberOfInstallments = 6;
feeTestHelper.createNoRateFee("fixedFee5629", FeesCreatePage.SubmitFormParameters.LOAN, "Upfront", 5);
feeTestHelper.createPeriodicRateFee("periodicFee5629", FeesCreatePage.SubmitFormParameters.LOAN, FeesCreatePage.SubmitFormParameters.WEEKLY_FEE_RECURRENCE, 1, 4, FeesCreatePage.SubmitFormParameters.LOAN_AMOUNT_INTEREST);
SubmitFormParameters dbIrLoanProductParams = loanProductTestHelper.defineLoanProductParameters(numberOfInstallments, loanAmount, interestRate, DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION, WEEKLY_RECURRENCE_TYPE_ID);
dbIrLoanProductParams.setOfferingName("DbIrProduct5629");
loanProductTestHelper.defineNewLoanProduct(dbIrLoanProductParams);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client1233266063395");
searchParameters.setLoanProduct("DbIrProduct5629");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAdditionalFee1("periodicFee5629");
submitAccountParameters.setAdditionalFee2("fixedFee5629");
ViewRepaymentSchedulePage schedulePage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
String[] expectedInterestAmounts = { "0.6", "0.5", "0.4", "0.3", "0.2", "0.7" };
String[] expectedFeeAmounts = { "9.9", "4.9", "4.9", "4.9", "4.9", "4.8" };
for (int i = 0; i < numberOfInstallments; i++) {
schedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW + i, ViewRepaymentSchedulePage.INTEREST_COLUMN, expectedInterestAmounts[i]);
schedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW + i, ViewRepaymentSchedulePage.FEE_COLUMN, expectedFeeAmounts[i]);
}
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class CreateGLIMLoanAccountTest method verifyProRatedGLIMPayments.
private void verifyProRatedGLIMPayments(LoanAccountPage loanAccountPage, int count, String[] expectedPrincipalAmounts, String[] expectedInterestAmounts, String[] expectedFeeAmounts) {
for (int i = 0; i < count; i++) {
ViewRepaymentSchedulePage repaymentSchedulePage = loanAccountPage.navigateToIndividualRepaymentSchedulePage(i);
repaymentSchedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW, ViewRepaymentSchedulePage.PRINCIPAL_COLUMN, expectedPrincipalAmounts[i]);
repaymentSchedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW, ViewRepaymentSchedulePage.INTEREST_COLUMN, expectedInterestAmounts[i]);
repaymentSchedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW, ViewRepaymentSchedulePage.FEE_COLUMN, expectedFeeAmounts[i]);
loanAccountPage = repaymentSchedulePage.navigateToLoanAccountPage();
}
}
Aggregations