Search in sources :

Example 1 with GLIMClient

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

the class ModifyingGroupLoanTest method editAccountInfoTest.

public void editAccountInfoTest() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 02, 9, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
    glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null));
    glimClients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "37", null));
    glimClients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
    editLoanAccountInformationPage.setInterestRate("33");
    editLoanAccountInformationPage.setNumberOfInstallments("8");
    EditLoanAccountInformationParameters editAccountParameters = new EditLoanAccountInformationParameters();
    editAccountParameters.setCollateralNotes("Test Edit new GLIM Loan");
    editAccountParameters.setExternalID("1234");
    editLoanAccountInformationPage.editAccountParams(new CreateLoanAccountSubmitParameters(), editAccountParameters);
    loanAccountPage = editLoanAccountInformationPage.submitAndNavigateToAccountInformationPreviewPage().submitAndNavigateToLoanAccountPage();
    verifyEditedAccountParameters(loanAccountPage);
    verifyModifiedAccountParametersFromIndividualMemberAccount(loanAccountPage);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) EditLoanAccountInformationParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters) 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)

Example 2 with GLIMClient

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

the class LoanTestHelper method createLoanAccountForMultipleClientsInGroup.

/**
     * Creates a loan account.
     * @param loanSaveType : True - submit for approval, False - save for later
     * @return LoanAccountPage
     */
public LoanAccountPage createLoanAccountForMultipleClientsInGroup(boolean loanSaveType) {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage loanAccountEntryPage = this.navigateToCreateLoanAccountEntryPage(searchParameters);
    List<GLIMClient> clients = new ArrayList<GLIMClient>();
    clients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 \n Client Id: 0002-000000012", "9999.9", "0009-Horse"));
    clients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 \n Client Id: 0002-000000013", "99999.9", "0001-Cow Purchase"));
    clients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 \n Client Id: 0002-000000014", "99999.9", "0003-Goat Purchase"));
    List<GLIMClient> clients2 = new ArrayList<GLIMClient>();
    clients2.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999.9", "0009-Horse"));
    clients2.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999.9", "0001-Cow Purchase"));
    clients2.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999.9", "0003-Goat Purchase"));
    for (GLIMClient glimClient : clients2) {
        loanAccountEntryPage.selectGLIMClients(glimClient.getClientNumber(), glimClient.getClientName(), glimClient.getLoanAmount(), glimClient.getLoanPurpose());
    }
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage;
    if (loanSaveType) {
        createLoanAccountConfirmationPage = loanAccountEntryPage.submitAndNavigateToGLIMLoanAccountConfirmationPage();
    } else {
        createLoanAccountConfirmationPage = loanAccountEntryPage.submitAndNavigateToGLIMLoanAccountConfirmationPageSaveForLaterButton();
    }
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
    if (loanSaveType) {
        loanAccountPage.verifyLoanIsPendingApproval();
    } else {
        loanAccountPage.verifyLoanIsInPartialApplication();
    }
    EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
    for (GLIMClient glimClient : clients) {
        editLoanAccountInformationPage.verifyGLIMClient(glimClient.getClientNumber(), glimClient.getClientName(), glimClient.getLoanAmount(), glimClient.getLoanPurpose());
    }
    editLoanAccountInformationPage.navigateBack();
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
    return loanAccountPage;
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 3 with GLIMClient

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

the class LoanTestHelper method createGroupLoanAccount.

public LoanAccountPage createGroupLoanAccount(CreateLoanAccountSearchParameters searchParameters, List<GLIMClient> glimClients) {
    CreateLoanAccountEntryPage loanAccountEntryPage = navigateToCreateLoanAccountEntryPage(searchParameters);
    for (GLIMClient client : glimClients) {
        loanAccountEntryPage.selectGLIMClients(client.getClientNumber(), client.getClientName(), client.getLoanAmount());
    }
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanAccountEntryPage.navigateToReviewInstallmentsPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    return createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
}
Also used : GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 4 with GLIMClient

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

the class GuarantyCoreTest method createAndDisburseGroupLoan.

public void createAndDisburseGroupLoan() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 04, 9, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
    glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1000", null));
    glimClients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "100", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    String loanId = loanAccountPage.getAccountId();
    EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
    statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    statusParameters.setNote("Test apply Guaranty");
    loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("09");
    disburseParams.setDisbursalDateMM("04");
    disburseParams.setDisbursalDateYYYY("2013");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    verifyGuarantyGroupIndividualLoan(loanAccountPage);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 5 with GLIMClient

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

the class ApplyChargeGroupLoanTest method applyMiscPenalty.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void applyMiscPenalty() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
    glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null));
    glimClients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    String loanId = loanAccountPage.getAccountId();
    String penaltyAmount = "100";
    List<String> individualPenaltyAmounts = new ArrayList<String>();
    individualPenaltyAmounts.add("20");
    individualPenaltyAmounts.add("80");
    ChargeParameters params = new ChargeParameters();
    params.setType(ChargeParameters.MISC_PENALTY);
    params.setAmount(penaltyAmount);
    params.setGroupLoanIndividualAmounts(individualPenaltyAmounts);
    loanAccountPage = loanTestHelper.applyChargeToGroupLoan(loanId, params);
    verifyPenaltySummaryAndActivity(loanAccountPage, penaltyAmount, "Misc penalty applied", 2);
    verifyRepaymentSchedulePage(loanAccountPage, penaltyAmount);
    for (int i = 0; i < glimClients.size(); i++) {
        LoanAccountPage individualLoanAccountPage = loanAccountPage.navigateToIndividualLoanAccountPageFromPendingApprovalGroupLoan(i);
        verifyPenaltySummaryAndActivity(individualLoanAccountPage, individualPenaltyAmounts.get(i), "Misc penalty applied", 2);
        verifyRepaymentSchedulePage(individualLoanAccountPage, individualPenaltyAmounts.get(i));
        individualLoanAccountPage.navigateToGroupLoanPageFromIndividualLoanPage();
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Aggregations

GLIMClient (org.mifos.test.acceptance.framework.loan.GLIMClient)5 ArrayList (java.util.ArrayList)4 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)4 DateTime (org.joda.time.DateTime)3 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)3 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)2 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)2 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)2 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)1 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)1 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)1 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 EditLoanAccountInformationParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters)1 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1