Search in sources :

Example 26 with CreateLoanAccountSubmitParameters

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

the class QuestionGroupLoanAccountTest method verifyResponsesDuringCreationOfLoanAccount.

/**
     * Capturing responses during the creation of Loan account
     * http://mifosforge.jira.com/browse/MIFOSTEST-683
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringCreationOfLoanAccount() throws Exception {
    CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
    createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
    createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
    CreateLoanAccountSubmitParameters formParameters = new CreateLoanAccountSubmitParameters();
    formParameters.setAdditionalFee1("oneTimeFee");
    formParameters.setAdditionalFee2("loanWeeklyFee");
    verifyQGNotDisplayed(createLoanAccountSearchParameters);
    questionGroupTestHelper.markQuestionGroupAsActive("QGForCreateLoan1");
    questionGroupTestHelper.markQuestionGroupAsActive("QGForCreateLoan2");
    try {
        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].values", "three");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
        CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
        createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
        createQuestionParameters.setText("questionByVerifyResponsesDuringCreationOfLoanAccount");
        List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
        newQuestionList.add(createQuestionParameters);
        String[] questionsExist = { "Date", "FreeText", "SingleSelect", "questionByVerifyResponsesDuringCreationOfLoanAccount" };
        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");
        QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanCreation(createLoanAccountSearchParameters, formParameters);
        questionResponsePage.populateAnswers(questionResponseParameters);
        CreateLoanAccountPreviewPage createLoanAccountPreviewPage = questionResponsePage.continueAndNavigateToCreateLoanAccountReviewInstallmentPage().clickPreviewAndGoToReviewLoanAccountPage();
        verifyCreateLoanAccountPreviewPage();
        questionResponsePage = createLoanAccountPreviewPage.navigateToQuestionResponsePage();
        questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
        questionResponsePage.populateAnswers(questionResponseParameters);
        LoanAccountPage loanAccountPage = questionResponsePage.continueAndNavigateToCreateLoanAccountReviewInstallmentPage().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
        String loanID = loanAccountPage.getAccountId();
        verifyFees();
        ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = questionGroupTestHelper.navigateToLoanViewQuestionResponseDetailPage(loanID);
        viewQuestionResponseDetailPage.verifyQuestionPresent("Date", "04/02/2011");
        viewQuestionResponseDetailPage.verifyQuestionPresent("ToBeDisabled", "free text");
        viewQuestionResponseDetailPage.verifyQuestionPresent("FreeText", "free text1");
        viewQuestionResponseDetailPage.verifyQuestionPresent("SingleSelect", "blue");
        viewQuestionResponseDetailPage.verifyQuestionPresent("DateQuestion", "07/02/2011");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Number", "20");
        viewQuestionResponseDetailPage.verifyQuestionPresent("MultiSelect", "three");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Text", "free text2");
        questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan2");
        questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForCreateLoan1", newQuestionList);
        questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanCreation(createLoanAccountSearchParameters, null);
        questionResponsePage.verifyQuestionsExists(questionsExist);
        questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
        viewQuestionResponseDetailPage = questionGroupTestHelper.navigateToLoanViewQuestionResponseDetailPage(loanID);
        viewQuestionResponseDetailPage.verifyQuestionPresent("MultiSelect", "three");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Number", "20");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Date", "04/02/2011");
        verifyQuestionResponsesExistInDatabase(loanID, "Create Loan", questionsAndAnswers);
    } finally {
        questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan1");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan2");
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ArrayList(java.util.ArrayList) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 27 with CreateLoanAccountSubmitParameters

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

the class CreateLSIMClientLoanAccountTest method createWeeklyLoanAccountWithNonMeetingDatesForDisburseAndRepay.

// http://mifosforge.jira.com/browse/MIFOSTEST-121
@Test(enabled = true)
public void createWeeklyLoanAccountWithNonMeetingDatesForDisburseAndRepay() throws Exception {
    //Given
    setTime(2011, 02, 23);
    //When
    DefineNewLoanProductPage.SubmitFormParameters defineNewLoanProductformParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Stu1233171716380 Client1233171716380");
    searchParameters.setLoanProduct(defineNewLoanProductformParameters.getOfferingName());
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters = createSearchParameters("23", "02", "2011");
    submitAccountParameters.setLoanPurpose("0008-Animal Trading");
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(AccountStatus.LOAN_APPROVED.getStatusText());
    editLoanAccountStatusParameters.setNote("activate account");
    DisburseLoanParameters disburseLoanParameters = new DisburseLoanParameters();
    disburseLoanParameters = createDisubreseLoanParameters("24", "02", "2011");
    loanProductTestHelper.defineNewLoanProduct(defineNewLoanProductformParameters);
    String loanId = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).getAccountId();
    loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
    //Then
    loanTestHelper.disburseLoanWithWrongParams(loanId, disburseLoanParameters, "Date of transaction can not be a future date.");
    disburseLoanParameters.setDisbursalDateDD("23");
    loanTestHelper.disburseLoan(loanId, disburseLoanParameters);
    //loanTestHelper.disburseLoan(loanId, disburseLoanParameters);
    loanTestHelper.repayLoan(loanId);
}
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) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 28 with CreateLoanAccountSubmitParameters

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

the class CreateLSIMClientLoanAccountTest method newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// one of the dependent methods throws Exception
@Test(enabled = true)
public void newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth() throws Exception {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly1");
    searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
    expectedDate = "05-Feb-2010";
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1234.0");
    submitAccountParameters.setLoanPurpose("0008-Animal Trading");
    // create LSIM loan that has repayments on 5th of every month
    submitAccountParameters.setLsimFrequencyMonths("on");
    submitAccountParameters.setLsimMonthTypeDayOfMonth("on");
    submitAccountParameters.setLsimDayOfMonth("5");
    submitAccountParameters.setLoanPurpose("0010-Camel");
    createLSIMLoanAndCheckAmountAndInstallmentDate(searchParameters, submitAccountParameters, expectedDate);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 29 with CreateLoanAccountSubmitParameters

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

the class CreateLSIMClientLoanAccountTest method newWeeklyLSIMClientLoanAccount.

@Test(enabled = true, groups = { "loan", "acceptance", "ui" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-127
void newWeeklyLSIMClientLoanAccount() throws Exception {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Stu1233171716380 Client1233171716380");
    searchParameters.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
    expectedDate = "29-Jan-2010";
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("9012.0");
    submitAccountParameters.setLsimFrequencyWeeks("on");
    submitAccountParameters.setLsimWeekFrequency("1");
    submitAccountParameters.setLsimWeekDay("Friday");
    submitAccountParameters.setLoanPurpose("0008-Animal Trading");
    createLSIMLoanAndCheckAmountAndInstallmentDate(searchParameters, submitAccountParameters, expectedDate);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 30 with CreateLoanAccountSubmitParameters

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

the class CreateClientLoanAccountTest method approveLoanAmountByDifferentLoanAmountRangesTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//https://mifosforge.jira.com/browse/MIFOSTEST-1185
@Test(enabled = true)
public void approveLoanAmountByDifferentLoanAmountRangesTest() throws Exception {
    // When
    ManageRolePage manageRolePage = new ManageRolePage(selenium);
    //.
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("activityRestrictionCheckbox1");
    manageRolePage.typeText("restrictionValue(1)", "asdf");
    manageRolePage.verifyAmountTextField();
    manageRolePage.typeText("restrictionValue(1)", "5,000");
    manageRolePage.enablePermission("activityRestrictionCheckbox1");
    manageRolePage.submitAndGotoViewRolesPage();
    //Then
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    searchParameters.setSearchString("ClientWithLoan 20110221");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("6000");
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String loanAccountId = loanAccountPage.getAccountId();
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
    editAccountStatusParameters.setNote("Approve test");
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters);
    loanAccountPage.verifyLoanAmountPermissionError();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PARTIAL);
    searchParameters.setSearchString(loanAccountId);
    loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
    //When
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("activityRestrictionCheckbox1");
    manageRolePage.typeText("restrictionValue(1)", "");
    manageRolePage.submitAndGotoViewRolesPage();
    //Then
    loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PENDING_APPROVAL);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Aggregations

CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)39 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)36 Test (org.testng.annotations.Test)31 DateTime (org.joda.time.DateTime)18 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)14 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)9 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)5 EditLoanAccountInformationParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters)5 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)5 ArrayList (java.util.ArrayList)4 CreateHolidaySubmitParameters (org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)4 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)4 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)4 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)4 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)4 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)4 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)4 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)3 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)3 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)3