use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class LoanAccountOverdueInterestTest method setUp.
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
propertiesHelper = new CustomPropertiesHelper(selenium);
propertiesHelper.setOverdueInterestPaidFirst("true");
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
systemDateTime = new DateTime(2011, 3, 4, 12, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
loanTestHelper = new LoanTestHelper(selenium);
navigationHelper = new NavigationHelper(selenium);
loanProductTestHelper = new LoanProductTestHelper(selenium);
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService 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.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithQuestionGroups.
@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui", "smoke", "no_db_unit" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithQuestionGroups() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
String questionGroupTitle = "QG1" + random.nextInt(100);
String question1 = "DT_" + random.nextInt(100);
String question2 = "SS_" + random.nextInt(100);
String answer = "01/01/2010";
String choiceAnswer = "Choice2";
questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
loanProductTestHelper.editLoanProductIncludeQuestionsGroups("Flat Interest Loan Product With Fee", questionGroupTitle);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("client1 lastname");
searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012.0");
QuestionResponseParameters parameters = new QuestionResponseParameters();
parameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", answer);
parameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", choiceAnswer);
LoanAccountPage loanAccountPage = createLoanAccount(searchParameters, submitAccountParameters, parameters);
ViewQuestionResponseDetailPage questionResponseDetailPage = loanAccountPage.navigateToAdditionalInformationPage();
questionResponseDetailPage.verifyPage();
questionResponseDetailPage.verifyQuestionPresent(question1, answer);
questionResponseDetailPage.verifyQuestionPresent(question2, choiceAnswer);
questionResponseDetailPage.navigateToDetailsPage();
questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class CreateClientLoanAccountTest method tryClientLoanAccountWithAdditionalFees.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void tryClientLoanAccountWithAdditionalFees() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client - Mary Monthly");
searchParameters.setLoanProduct("EmergencyLoanWithZeroInterest");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.selectAdditionalFees();
// there should be an error
loanAccountEntryPage.submitAndWaitForPage();
loanAccountEntryPage.verifyError("Multiple instances of the same fee are not allowed.");
// after unselect everything should pass
loanAccountEntryPage.unselectAdditionalFee();
loanAccountEntryPage.clickContinue();
HomePage homePage = loanAccountEntryPage.navigateToHomePage();
homePage.verifyPage();
loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(searchParameters);
loanAccountEntryPage.verifyAdditionalFeesAreEmpty();
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class CreateClientLoanAccountTest method createMultipleLoanAccountsWithRestrictedProductsMix.
/**
* Verify a user is prevented from creating a second loan account
* (for two or more clients using the bulk loan creation pipeline)
* with a loan product restricted with the first loan.
* http://mifosforge.jira.com/browse/MIFOSTEST-95
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createMultipleLoanAccountsWithRestrictedProductsMix() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 3, 18, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product95");
productParams.setOfferingShortName("p95");
productParams.setDefaultInterestRate("15.3");
productParams.setMaxInterestRate("50");
productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE);
productParams.setDefaultLoanAmount("13333");
productParams.setDefInstallments("13");
loanProductTestHelper.defineNewLoanProduct(productParams);
productParams.setOfferingName("product95B");
productParams.setOfferingShortName("p95b");
loanProductTestHelper.defineNewLoanProduct(productParams);
CreateMultipleLoanAccountSelectParameters multipleAccParameters1 = new CreateMultipleLoanAccountSelectParameters();
multipleAccParameters1.setBranch("MyOfficeDHMFT");
multipleAccParameters1.setLoanOfficer("loan officer");
multipleAccParameters1.setCenter("WeeklyMeetingCenter");
multipleAccParameters1.setLoanProduct("product95");
CreateMultipleLoanAccountSelectParameters multipleAccParameters2 = new CreateMultipleLoanAccountSelectParameters();
multipleAccParameters2.setBranch("MyOfficeDHMFT");
multipleAccParameters2.setLoanOfficer("loan officer");
multipleAccParameters2.setCenter("WeeklyMeetingCenter");
multipleAccParameters2.setLoanProduct("product95B");
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
disburseParams.setDisbursalDateDD("18");
disburseParams.setDisbursalDateMM("03");
disburseParams.setDisbursalDateYYYY("2011");
String error = "The loan could not be disbursed as " + multipleAccParameters1.getLoanProduct() + " and " + multipleAccParameters2.getLoanProduct() + " are not allowed to co-exist";
String[] clients = new String[1];
clients[0] = "MemberWeekly Group";
String firstRepaymentDate = "21-Mar-2011";
CreateLoanAccountsSuccessPage createLoanAccountsSuccessPage = loanTestHelper.createMultipleLoanAccountsWithMixedRestricedPoducts(multipleAccParameters1, multipleAccParameters2, disburseParams, clients, firstRepaymentDate);
List<String> accountNumbers = createLoanAccountsSuccessPage.verifyAndGetLoanAccountNumbers(clients.length);
LoanAccountPage loanAccountPage = createLoanAccountsSuccessPage.selectLoansAndNavigateToLoanAccountPage(0);
for (int i = 0; i < accountNumbers.size(); i++) {
if (i > 0) {
loanAccountPage = loanAccountPage.navigateToClientsAndAccountsUsingHeaderTab().searchForClient(accountNumbers.get(i)).navigateToLoanAccountSearchResult("Account # " + accountNumbers.get(i));
}
loanAccountPage.changeAccountStatusToAccepted();
loanAccountPage.tryNavigatingToDisburseLoanWithError();
loanAccountPage.verifyError(error);
}
}
Aggregations