Search in sources :

Example 31 with LoanAccountPage

use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.

the class LoanAccountCycleTest method verifySecondLoanWithCycle.

/**
     * Verify redo Loan with cycle, when client has another Loan of the same product
     * http://mifosforge.jira.com/browse/MIFOSTEST-1184
     * 
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifySecondLoanWithCycle() throws Exception {
    loanTestHelper.setApplicationTime(new DateTime(2009, 02, 25, 0, 0, 0, 0)).navigateBack();
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product1184");
    productParams.setOfferingShortName("p1184");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] cycleLoanAmount = getAmountsByCycle();
    productParams.setCycleLoanAmount(cycleLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] calculateInstallments = getInstallmentsByCycle();
    productParams.setCycleInstallments(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product1184");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    loanTestHelper.setApplicationTime(new DateTime(2011, 02, 25, 0, 0, 0, 0)).navigateBack();
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "26", "52", "52" });
    loanAccountPage.disburseLoan(disburseParams);
    RedoLoanDisbursalParameters paramsPastDate = RedoLoanDisbursalParameters.createObjectWithClearedParameters();
    paramsPastDate.setDisbursalDateDD("18");
    paramsPastDate.setDisbursalDateMM("02");
    paramsPastDate.setDisbursalDateYYYY("2010");
    paramsPastDate.setLoanAmount("3000");
    paramsPastDate.setInterestRate("22");
    paramsPastDate.setNumberOfInstallments("20");
    loanTestHelper.redoLoanDisbursalWithoutNavigate("Stu1233171716380 Client1233171716380", "product1184", paramsPastDate).verifySecondLoanWithCycleError();
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) RedoLoanDisbursalParameters(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTime(org.joda.time.DateTime)

Example 32 with LoanAccountPage

use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.

the class LoanAccountCycleTest method verifyAmountsAndInstallmentsByLastAmount.

/**
     * Verify loan amount with number of installments by last loan amount can be used to create new loans.
     * http://mifosforge.jira.com/browse/MIFOSTEST-116
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountsAndInstallmentsByLastAmount() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product116");
    productParams.setOfferingShortName("p116");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
    String[][] lastLoanAmount = getAmountsFromLastAmount();
    productParams.setAmountsByLastLoanAmount(lastLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
    String[][] calculateInstallments = getInstallmentsFromLastAmount();
    productParams.setInstallmentsByLastLoanAmount(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product116");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
    loanProductDetailsPage.verifyAmountTableTypeFromLastAmount(lastLoanAmount);
    loanProductDetailsPage.verifyInstallmentTableTypeFromLastAmount(calculateInstallments);
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "5", "10", "5" });
    String loanFirstID = loanAccountPage.getAccountId();
    loanAccountPage.disburseLoan(disburseParams);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "5", "10", "5" });
    loanTestHelper.repayLoan(loanFirstID);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,500", "2,500", "2200.0" }, null, new String[] { "10", "20", "15" });
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 33 with LoanAccountPage

use of org.mifos.test.acceptance.framework.loan.LoanAccountPage 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)");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Example 34 with LoanAccountPage

use of org.mifos.test.acceptance.framework.loan.LoanAccountPage 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);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) Test(org.testng.annotations.Test)

Example 35 with LoanAccountPage

use of org.mifos.test.acceptance.framework.loan.LoanAccountPage 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);
    }
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountsSuccessPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateMultipleLoanAccountSelectParameters(org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Aggregations

LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)130 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)50 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)37 Test (org.testng.annotations.Test)36 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)29 DateTime (org.joda.time.DateTime)28 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)20 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)16 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)15 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)14 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)10 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)10 ArrayList (java.util.ArrayList)9 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)9 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)9 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)9 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)8 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8