Search in sources :

Example 1 with AccountChangeStatusPage

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

the class ClientLoanStatusChangeTest method testBackDatedApprovals.

public void testBackDatedApprovals() {
    customPropertiesHelper.setAllowBackdatedApproval(true);
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount("Stu1233171716380 Client1233171716380", "WeeklyFlatLoanWithOneTimeFees");
    loanAccountPage.verifyStatus("Application Pending Approval");
    AccountChangeStatusPage changeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    LocalDate approvalDate = new LocalDate(2009, 6, 1);
    EditAccountStatusParameters editAccountStatusParams = new EditAccountStatusParameters();
    editAccountStatusParams.setNote("test note");
    editAccountStatusParams.setAccountStatus(AccountStatus.LOAN_APPROVED);
    editAccountStatusParams.setTrxnDate(approvalDate);
    loanAccountPage = changeStatusPage.setChangeStatusParametersAndSubmit(editAccountStatusParams).submitAndNavigateToLoanAccountPage();
    loanAccountPage.verifyStatus("Application Approved");
    loanAccountPage.verifyLastNoteDate(approvalDate);
}
Also used : AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) LocalDate(org.joda.time.LocalDate) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)

Example 2 with AccountChangeStatusPage

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

the class CustomizeTextTest method verifyCustomizedTextChangeLoanStatusPage.

/*
     * http://mifosforge.jira.com/browse/MIFOSTEST-1170
     * Verify customized text on 'Change Loan status' page
     */
@Test
public void verifyCustomizedTextChangeLoanStatusPage() {
    String errorMessage;
    List<String> originalTextVector = new ArrayList<String>(Arrays.asList("Select from the status options below", "Then click Continue", "information", "Status", "Change status", "Other", "explanation", "Cancel", "note", "current status"));
    List<String> customTextVector = new ArrayList<String>(Arrays.asList("Choose options", "搜索工具", "عر", "State", "Set different state", "Different", "answer", "Abort", "ربية ر", "Actual state"));
    for (int i = 0; i < originalTextVector.size(); i++) {
        adminTestHelper.addCustomizedText(originalTextVector.get(i), customTextVector.get(i));
    }
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000050");
    AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    for (int i = 0; i < customTextVector.size() - 2; i++) {
        errorMessage = "No text <" + customTextVector.get(i) + "> present on the page";
        accountChangeStatusPage.verifyTextPresent(customTextVector.get(i), errorMessage);
    }
    for (int i = customTextVector.size() - 2; i < customTextVector.size(); i++) {
        errorMessage = "The Text <" + customTextVector.get(i) + "> presents on the page";
        accountChangeStatusPage.verifyNotTextPresent(customTextVector.get(i), errorMessage);
    }
    for (int i = 0; i < 3; i++) {
        adminTestHelper.removeCustomizedText(originalTextVector.get(i));
    }
    loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000050");
    accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    for (int i = 0; i < 3; i++) {
        errorMessage = "No text <" + originalTextVector.get(i) + "> present on the page";
        accountChangeStatusPage.verifyTextPresent(originalTextVector.get(i), errorMessage);
    }
    for (int i = 3; i < originalTextVector.size(); i++) {
        adminTestHelper.removeCustomizedText(originalTextVector.get(i));
    }
}
Also used : AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) ArrayList(java.util.ArrayList) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) Test(org.testng.annotations.Test)

Example 3 with AccountChangeStatusPage

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

the class SavingsAccountHelper method changeStatus.

public SavingsAccountDetailPage changeStatus(String savingsId, EditAccountStatusParameters editAccountStatusParameters) {
    SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    AccountChangeStatusPage accountChangeStatusPage = savingsAccountDetailPage.navigateToEditAccountStatus();
    EditAccountStatusConfirmationPage editAccountStatusConfirmationPage = accountChangeStatusPage.setChangeStatusParametersAndSubmit(editAccountStatusParameters);
    savingsAccountDetailPage = editAccountStatusConfirmationPage.submitAndNavigateToSavingAccountPage();
    savingsAccountDetailPage.verifyStatus(editAccountStatusParameters.getAccountStatus().getStatusText());
    return savingsAccountDetailPage;
}
Also used : EditAccountStatusConfirmationPage(org.mifos.test.acceptance.framework.loan.EditAccountStatusConfirmationPage) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)

Example 4 with AccountChangeStatusPage

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

the class LoanTestHelper method changeLoanAccountStatusProvidingQuestionGroupResponses.

public void changeLoanAccountStatusProvidingQuestionGroupResponses(String loanId, EditLoanAccountStatusParameters params, QuestionResponseParameters responseParameters) {
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    EditAccountStatusConfirmationPage editAccountStatusConfirmationPage = accountChangeStatusPage.submitAndNavigateToNextPage(params);
    if (responseParameters != null) {
        populateQuestionGroupResponses(responseParameters);
    }
    loanAccountPage = editAccountStatusConfirmationPage.submitAndNavigateToLoanAccountPage();
    loanAccountPage.verifyStatus(params.getStatus(), params.getCancelReason());
}
Also used : EditAccountStatusConfirmationPage(org.mifos.test.acceptance.framework.loan.EditAccountStatusConfirmationPage) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Example 5 with AccountChangeStatusPage

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

the class ApplyPaymentOnGLIMLoanAccountTest method checkApplyPaymentOnGLIMLoanAccount.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkApplyPaymentOnGLIMLoanAccount() throws Exception {
    LoanAccountPage loanAccountPage = createNewLoan();
    AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
    params.setNote("asd");
    params.setStatus(EditLoanAccountStatusParameters.APPROVED);
    loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("04");
    disburseParams.setDisbursalDateMM("03");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.setAmount("140");
    applyGroupPaymentPage.verifyIndividualAmount(0, "20.0");
    applyGroupPaymentPage.verifyIndividualAmount(1, "40.0");
    applyGroupPaymentPage.verifyIndividualAmount(2, "80.0");
    //principal 25, less
    applyGroupPaymentPage.setIndividualAmount(0, "20");
    //principal 50, equal
    applyGroupPaymentPage.setIndividualAmount(1, "50");
    //principal 100, more
    applyGroupPaymentPage.setIndividualAmount(2, "120");
    applyGroupPaymentPage.verifyAmount("190");
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentPage.setDate("04", "03", "2011");
    ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, EXPECTED_PAID_INSTALLMENTS);
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    for (int i = 0; i <= 2; i += 1) {
        viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualRepaymentSchedulePage(i);
        verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, INDIVIDUAL_EXPECTED_PAID_INSTALLMENTS[i]);
        loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    }
    // Test applying payment for last installment
    applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentPage.setAmount("1500");
    applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    // Last installment left to payoff whole account
    applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.verifyAmount("60.0");
    applyGroupPaymentPage.verifyIndividualAmount(0, "15.7");
    applyGroupPaymentPage.verifyIndividualAmount(1, "21.4");
    applyGroupPaymentPage.verifyIndividualAmount(2, "22.9");
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ApplyGroupPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) ApplyGroupPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage) Test(org.testng.annotations.Test)

Aggregations

AccountChangeStatusPage (org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage)6 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)5 Test (org.testng.annotations.Test)3 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)2 EditAccountStatusConfirmationPage (org.mifos.test.acceptance.framework.loan.EditAccountStatusConfirmationPage)2 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)2 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)2 ArrayList (java.util.ArrayList)1 LocalDate (org.joda.time.LocalDate)1 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)1 ApplyGroupPaymentConfirmationPage (org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage)1 ApplyGroupPaymentPage (org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)1