Search in sources :

Example 51 with CreateLoanAccountSearchParameters

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

the class QuestionGroupLoanAccountTest method verifyResponsesDuringLoanAccountApproval.

/**
     * Capturing responses while approving Loan account
     * http://mifosforge.jira.com/browse/MIFOSTEST-684
     *
     * @throws Exception
     */
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringLoanAccountApproval() throws Exception {
    questionGroupTestHelper.markQuestionGroupAsActive("QGForApproveLoan1");
    questionGroupTestHelper.markQuestionGroupAsActive("QGForApproveLoan2");
    try {
        CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
        createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
        createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
        EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
        editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
        editAccountStatusParameters.setNote("note note");
        QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "free text1");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "07/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "20");
        questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].valuesAsArray", "three");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
        CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
        createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
        createQuestionParameters.setText("questionByVerifyResponsesDuringLoanAccountApproval");
        List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
        newQuestionList.add(createQuestionParameters);
        String[] questionsExist = { "Date", "FreeText", "SingleSelect", "questionByVerifyResponsesDuringLoanAccountApproval" };
        String[] questionsInactive = { "ToBeDisabled" };
        Map<String, String> questionsAndAnswers = new HashMap<String, String>();
        questionsAndAnswers.put("MultiSelect", "three");
        questionsAndAnswers.put("Number", "20");
        questionsAndAnswers.put("Date", "04/02/2011");
        LoanAccountPage loanAccountPage = loanTestHelper.createDefaultLoanAccount(createLoanAccountSearchParameters);
        String loanID1 = loanAccountPage.getAccountId();
        loanAccountPage = loanTestHelper.createDefaultLoanAccount(createLoanAccountSearchParameters);
        String loanID2 = loanAccountPage.getAccountId();
        QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID1, editAccountStatusParameters);
        questionResponsePage.populateAnswers(questionResponseParameters);
        questionResponsePage = questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().navigateToEditStatus().submitAndNavigateToQuestionResponsePage(editAccountStatusParameters);
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
        questionResponsePage.populateAnswers(questionResponseParameters);
        questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().submitAndNavigateToLoanAccountPage();
        questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForApproveLoan2");
        questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForApproveLoan1", newQuestionList);
        questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID2, editAccountStatusParameters);
        questionResponsePage.verifyQuestionsExists(questionsExist);
        questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
        verifyQuestionResponsesExistInDatabase(loanID1, "Approve Loan", questionsAndAnswers);
    } finally {
        questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForApproveLoan1");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForApproveLoan2");
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ArrayList(java.util.ArrayList) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 52 with CreateLoanAccountSearchParameters

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

the class QuestionGroupLoanAccountTest method verifyResponsesDuringLoanAccountClosing.

@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringLoanAccountClosing() throws Exception {
    questionGroupTestHelper.markQuestionGroupAsActive("QGForCloseLoan");
    try {
        DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
        CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
        searchParams.setSearchString("Stu12332659912419 Client12332659912419");
        searchParams.setLoanProduct(productParams.getOfferingName());
        DisburseLoanParameters disburseParams = new DisburseLoanParameters();
        disburseParams.setPaymentType(DisburseLoanParameters.CASH);
        disburseParams.setDisbursalDateDD("24");
        disburseParams.setDisbursalDateMM("02");
        disburseParams.setDisbursalDateYYYY("2011");
        loanProductTestHelper.defineNewLoanProduct(productParams);
        LoanAccountPage loanAccountPage = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
        String loanID1 = loanAccountPage.getAccountId();
        QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
        String[] questionsExist = { "Date", "FreeText" };
        Map<String, String> questionsAndAnswers = new HashMap<String, String>();
        questionsAndAnswers.put("Date", "04/02/2011");
        questionsAndAnswers.put("FreeText", "free text");
        EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
        editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_CLOSED_WRITTENOFF);
        editAccountStatusParameters.setNote("note note");
        QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID1, editAccountStatusParameters);
        questionResponsePage.verifyQuestionsExists(questionsExist);
        questionResponsePage.populateAnswers(questionResponseParameters);
        questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().submitAndNavigateToLoanAccountPage();
        verifyQuestionResponsesExistInDatabase(loanID1, "Close Loan", questionsAndAnswers);
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCloseLoan");
    }
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 53 with CreateLoanAccountSearchParameters

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

the class QuestionGroupLoanAccountTest method verifyCapturingResponsesDuringLoanDisburse.

/**
     * Capturing responses during the Loan disburse
     * http://mifosforge.jira.com/browse/MIFOSTEST-668
     *
     * @throws Exception
     */
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyCapturingResponsesDuringLoanDisburse() throws Exception {
    questionGroupTestHelper.markQuestionGroupAsActive("QGForDisburseLoan1");
    questionGroupTestHelper.markQuestionGroupAsActive("QGForDisburseLoan2");
    try {
        CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
        createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
        createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
        DisburseLoanParameters disburseLoanParameters = new DisburseLoanParameters();
        disburseLoanParameters.setPaymentType(DisburseLoanParameters.CASH);
        disburseLoanParameters.setDisbursalDateDD("24");
        disburseLoanParameters.setDisbursalDateMM("02");
        disburseLoanParameters.setDisbursalDateYYYY("2011");
        QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "free text1");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "07/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "20");
        questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].valuesAsArray", "three");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
        LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(createLoanAccountSearchParameters);
        String loan1ID = loanAccountPage.getAccountId();
        loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(createLoanAccountSearchParameters);
        String loan2ID = loanAccountPage.getAccountId();
        QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanDisbursal(loan1ID, disburseLoanParameters);
        questionResponsePage.populateAnswers(questionResponseParameters);
        questionResponsePage = questionResponsePage.continueAndNavigateToDisburseLoanConfirmationPage().navigateToEditAdditionalInformation();
        questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
        questionResponsePage.populateAnswers(questionResponseParameters);
        questionResponsePage.continueAndNavigateToDisburseLoanConfirmationPage().submitAndNavigateToLoanAccountPage();
        CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
        createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
        createQuestionParameters.setText("createdByverifyCapturingResponsesDuringLoanDisburse");
        List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
        newQuestionList.add(createQuestionParameters);
        String[] questionsExist = { "Date", "FreeText", "SingleSelect", "createdByverifyCapturingResponsesDuringLoanDisburse" };
        String[] questionsInactive = { "ToBeDisabled" };
        Map<String, String> questionsAndAnswers = new HashMap<String, String>();
        questionsAndAnswers.put("MultiSelect", "three");
        questionsAndAnswers.put("Number", "20");
        questionsAndAnswers.put("Date", "04/02/2011");
        questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForDisburseLoan2");
        questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForDisburseLoan1", newQuestionList);
        questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanDisbursal(loan2ID, disburseLoanParameters);
        questionResponsePage.verifyQuestionsExists(questionsExist);
        questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
        verifyQuestionResponsesExistInDatabase(loan1ID, "Disburse Loan", questionsAndAnswers);
    } finally {
        questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForDisburseLoan1");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForDisburseLoan2");
    }
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ArrayList(java.util.ArrayList) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) Test(org.testng.annotations.Test)

Example 54 with CreateLoanAccountSearchParameters

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

the class DefineNewLoanProductTest method verifyWaiveInterestForLoanAccount.

/*
     * passing locally but not on hudson. 
     */
//http://mifosforge.jira.com/browse/MIFOSTEST-710
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyWaiveInterestForLoanAccount() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime systemDateTime = new DateTime(2011, 3, 7, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
    //When
    DefineNewLoanProductPage.SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    formParameters.setInterestWaiver(true);
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineNewLoanProductPage newLoanProductPage = adminPage.navigateToDefineLoanProduct();
    newLoanProductPage.fillLoanParameters(formParameters);
    DefineNewLoanProductPreviewPage previewPage = newLoanProductPage.submitAndGotoNewLoanProductPreviewPage();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    Assert.assertTrue(selenium.isTextPresent("Interest: 31102"));
    Assert.assertTrue(selenium.isTextPresent("Principal: 1506"));
    //When
    LoanProductDetailsPage loanProductDetailsPage = previewPage.submit().navigateToViewLoanDetailsPage();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    //When
    EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
    //Then
    Assert.assertTrue(selenium.isChecked("EditLoanProduct.input.includeInterestWaiver"));
    //When
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.editSubmit();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    //When
    loanProductDetailsPage = editLoanProductPreviewPage.submit();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    //When
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("WeeklyClient Monday");
    searchParameters.setLoanProduct(formParameters.getOfferingName());
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParameters);
    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);
    loanAccountPage.navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseParameters).submitAndNavigateToLoanAccountPage();
    RepayLoanPage repayLoanPage = loanAccountPage.navigateToRepayLoan();
    //Then
    Assert.assertTrue(selenium.isChecked("waiverInterestChckBox"));
    Assert.assertEquals("Note: Interest due will be waived off.", selenium.getText("waiverInterestWarning"));
    Assert.assertFalse(repayLoanPage.isTotalRepaymentAmountVisible());
    Assert.assertTrue(repayLoanPage.isWaivedRepaymentAmoutVisible());
    Assert.assertEquals(repayLoanPage.waivedRepaymentAmount(), "2,500");
    //When
    repayLoanPage.interestWaiver(false);
    //Then
    Assert.assertTrue(repayLoanPage.isTotalRepaymentAmountVisible());
    Assert.assertFalse(repayLoanPage.isWaivedRepaymentAmoutVisible());
    Assert.assertFalse(selenium.isTextPresent("Note: Interest due will be waived off."));
    Assert.assertEquals(repayLoanPage.totalRepaymentAmount(), "2,509.1");
    //When
    RepayLoanParameters params = new RepayLoanParameters();
    params.setModeOfRepayment("Cash");
    loanAccountPage = repayLoanPage.submitAndNavigateToRepayLoanConfirmationPage(params).submitAndNavigateToLoanAccountDetailsPage();
    //Then
    loanAccountPage.verifyStatus("Closed- Obligation met");
    String[][] accountSummaryTable = { { "", "Original Loan", "Amount paid", "Loan balance" }, { "Principal", "2,500", "2,500", "0" }, { "Interest", "9.1", "9.1", "0" }, { "Fees", "0", "0", "0" }, { "Penalty", "0", "0", "0" }, { "Total", "2,509.1", "2,509.1", "0" } };
    loanAccountPage.verifyAccountSummary(accountSummaryTable);
    loanAccountPage.navigateToAccountActivityPage();
    Assert.assertEquals("Loan Repayment", selenium.getTable("accountActivityTable.2.1").trim());
    Assert.assertEquals("2,500", selenium.getTable("accountActivityTable.2.2").trim());
    Assert.assertEquals("0", selenium.getTable("accountActivityTable.2.10").trim());
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) DateTime(org.joda.time.DateTime) DefineNewLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPreviewPage) EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) RepayLoanPage(org.mifos.test.acceptance.framework.loan.RepayLoanPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) RepayLoanParameters(org.mifos.test.acceptance.framework.loan.RepayLoanParameters) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) Test(org.testng.annotations.Test)

Example 55 with CreateLoanAccountSearchParameters

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

the class CashFlowTest method verifyCashFlowPageInLoanAccountCreationFlow.

/**
     * Disabled after work on daily interest calculation for variable installments. - keithw-
     * 
     * Verify Cash Flow Page in Loan Account creation flow	
     * http://mifosforge.jira.com/browse/MIFOSTEST-672
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void verifyCashFlowPageInLoanAccountCreationFlow() throws Exception {
    applicationDatabaseOperation.updateLSIM(1);
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setDefInstallments("12");
    productParams.setDefaultLoanAmount("2000");
    CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
    loanSearchParams.setSearchString(clientName);
    loanSearchParams.setLoanProduct(productParams.getOfferingName());
    DateTime disbursalDate = systemDateTime.plusDays(1);
    loanProductTestHelper.navigateToDefineNewLoanPageAndFillMandatoryFields(productParams).fillCashFlow("", "49", "400").fillVariableInstalmentOption("", "1", "").submitAndGotoNewLoanProductPreviewPage().submit();
    CreateLoanAccountCashFlowPage cashFlowPage = loanTestHelper.navigateToCreateLoanAccountCashFlowPage(loanSearchParams);
    cashFlowPage.verifyTableExist();
    cashFlowPage.validateCashFlowMonths(disbursalDate, 12, DefineNewLoanProductPage.SubmitFormParameters.WEEKS);
    cashFlowPage.cancel();
    loanTestHelper.navigateToCreateLoanAccountCashFlowPage(loanSearchParams);
    cashFlowPage.submitWithErrors();
    cashFlowPage.verifyInvalidTextTyped();
    cashFlowPage.verifyErrorsOnPage();
    cashFlowPage.verifyMonths();
    cashFlowPage.verifyErrorsOnFields();
    cashFlowPage.enterValidData("1000", 1000, 100, "4000", "5000");
    cashFlowPage = cashFlowPage.submitWithErrors();
    cashFlowPage.verifyErrorsOnPage("Indebtedness rate of the client is 175 % which is greater than allowed value of 49 %.");
    cashFlowPage.enterValidData("1000", 1000, 100, "5000", "400");
    CreateLoanAccountReviewInstallmentPage reviewPage = cashFlowPage.clickContinue();
    reviewPage.verifyCashFlow(100, 2000, new String[] { "100", "1858", "1445", "1716", "2334.7", "2600" }, new String[] { "0", "15.5", "37.2", "28.5", "6.6", "0" });
    reviewPage = reviewPage.clickPreview();
    reviewPage.verifyErrorsOnPage("Repayment Capacity of the client is 127.06 % which should be greater than the required value of 400.0 %");
    cashFlowPage = reviewPage.editCashFlow();
    cashFlowPage.enterValidData("1000", 1000, 1100, "5000", "400");
    reviewPage = cashFlowPage.clickContinue();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = reviewPage.clickPreviewAndNavigateToPreviewPage();
    createLoanAccountPreviewPage.verifyLoanAmount("2,000");
    createLoanAccountPreviewPage.verifyInterestTypeInLoanPreview("Declining Balance");
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submit();
    createLoanAccountConfirmationPage.isTextPresentInPage("View loan account details now");
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyDisbursalDate("12/10/2010");
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    String[][] tableAfterLastInstallment = { { "Future Installments", "", "", "", "", "", "" }, { "1", "19-Oct-2010", "-", "163.7", "7.3", "0", "0", "0", "171" }, { "2", "26-Oct-2010", "-", "164.3", "6.7", "0", "0", "0", "171" }, { "3", "02-Nov-2010", "-", "165", "6", "0", "0", "0", "171" }, { "4", "09-Nov-2010", "-", "165.6", "5.4", "0", "0", "0", "171" }, { "5", "16-Nov-2010", "-", "166.2", "4.8", "0", "0", "0", "171" }, { "6", "23-Nov-2010", "-", "166.8", "4.2", "0", "0", "0", "171" }, { "7", "30-Nov-2010", "-", "167.5", "3.5", "0", "0", "0", "171" }, { "8", "07-Dec-2010", "-", "168.1", "2.9", "0", "0", "0", "171" }, { "9", "14-Dec-2010", "-", "168.7", "2.3", "0", "0", "0", "171" }, { "10", "21-Dec-2010", "-", "169.3", "1.7", "0", "0", "0", "171" }, { "11", "28-Dec-2010", "-", "169.9", "1.1", "0", "0", "0", "171" }, { "12", "04-Jan-2011", "-", "164.9", "0.4", "0", "0", "0", "165.3" } };
    viewRepaymentSchedulePage.verifyScheduleTable(tableAfterLastInstallment);
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
    editLoanAccountInformationPage.verifyInstallments("12");
    editLoanAccountInformationPage.verifyInterestRate("19");
    editLoanAccountInformationPage.verifyDisbursalDate("12", "10", "2010");
    editLoanAccountInformationPage.verifyLoanAmount("2000.0");
    applicationDatabaseOperation.updateLSIM(0);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateLoanAccountCashFlowPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountCashFlowPage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTime(org.joda.time.DateTime) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) Test(org.testng.annotations.Test)

Aggregations

CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)95 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)50 Test (org.testng.annotations.Test)46 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)36 DateTime (org.joda.time.DateTime)35 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)26 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)22 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)19 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)19 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)13 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)12 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)12 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)11 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)11 ArrayList (java.util.ArrayList)9 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)8 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)7