Search in sources :

Example 11 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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 12 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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 13 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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)

Example 14 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.

the class CreateSavingsAccountTest method verifyPaymentTypesForWithdrawalsAndDeposits.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(singleThreaded = true, groups = { "savings", "acceptance", "ui", "no_db_unit" })
public void verifyPaymentTypesForWithdrawalsAndDeposits() throws Exception {
    //When
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.VOUCHER);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.createSavingsAccountWithQG(searchParameters, submitAccountParameters);
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("test");
    savingsAccountDetailPage = savingsAccountHelper.changeStatus(savingsAccountDetailPage.getAccountId(), editAccountStatusParameters);
    SavingsDepositWithdrawalPage savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
    //When
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
    //When
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000002");
    savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DefineAcceptedPaymentTypesPage(org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) SavingsDepositWithdrawalPage(org.mifos.test.acceptance.framework.savings.SavingsDepositWithdrawalPage) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 15 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.

the class AdditionalSavingsAccountTest method createSavingsAccount.

private String createSavingsAccount(SavingsProductParameters params) {
    DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
    confirmationPage.navigateToSavingsProductDetails();
    SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233266299995 Client1233266299995", params.getProductInstanceName(), "100000.0");
    String savingsId = savingsAccountDetailPage.getAccountId();
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("change status to active");
    savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
    return savingsId;
}
Also used : DefineNewSavingsProductConfirmationPage(org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)

Aggregations

EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)17 Test (org.testng.annotations.Test)11 DateTime (org.joda.time.DateTime)9 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)8 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)7 CreateSavingsAccountSearchParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters)6 CreateSavingsAccountSubmitParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters)6 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)6 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)6 DefineNewSavingsProductConfirmationPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage)5 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)4 HashMap (java.util.HashMap)3 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)3 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)2 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)2 ArrayList (java.util.ArrayList)1 LocalDate (org.joda.time.LocalDate)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)1