Search in sources :

Example 36 with CreateLoanAccountSearchParameters

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

the class QuestionGroupLoanAccountTest method verifyKeyFinderInQuestionary.

@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyKeyFinderInQuestionary() {
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    QuestionGroupHelper questionGroupHelper = new QuestionGroupHelper(navigationHelper);
    Random random = new Random();
    boolean keyUnpressed = true;
    boolean keyPressed = false;
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "DT_6245";
    String choiceAnswer1 = "choiceTest13242";
    String choiceAnswer2 = "choiceTest34003";
    List<String> tag1 = new ArrayList<String>();
    List<String> tag2 = new ArrayList<String>();
    tag1.add("tag");
    tag2.add("tag1");
    questionGroupHelper.createQuestionGroupSmart(questionGroupTitle, "Create Loan", question1, choiceAnswer1, choiceAnswer2, tag1, tag2);
    loanProductTestHelper.editLoanProductIncludeQuestionsGroups("ClientEmergencyLoan", questionGroupTitle);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("ClientWithLoan 20110221");
    searchParameters.setLoanProduct("ClientEmergencyLoan");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    CreateLoanAccountEntryPage createLoanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    createLoanAccountEntryPage.submitAndNavigateToQuestionResponsePage();
    searchParameters.setSearchString("ClientWithLoan 20110221");
    Assert.assertEquals((boolean) createLoanAccountEntryPage.isAnswerExist(keyUnpressed), true);
    Assert.assertEquals((boolean) createLoanAccountEntryPage.isAnswerExist(keyPressed), false);
    createLoanAccountEntryPage.setInputFilterChoices("2");
    Assert.assertEquals((boolean) createLoanAccountEntryPage.isAnswerExist(keyPressed), true);
    navigationHelper.navigateToAdminPage().navigateToViewAllQuestions().navigateToQuestionDetail(question1).navigateToEditQuestionPage().deactivate();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) Random(java.util.Random) ArrayList(java.util.ArrayList) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) QuestionGroupHelper(org.mifos.test.acceptance.loan.QuestionGroupHelper) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) Test(org.testng.annotations.Test)

Example 37 with CreateLoanAccountSearchParameters

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

the class ApplyPaymentOnGLIMLoanAccountTest method createNewLoan.

private LoanAccountPage createNewLoan() {
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
    formParameters.setSearchString("Default Group");
    formParameters.setLoanProduct("GroupEmergencyLoan");
    CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
    createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 3, 4, 15, 0, 0, 0));
    createLoanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "250", "0009-Horse");
    createLoanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "500", "0001-Cow Purchase");
    createLoanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1000", "0003-Goat Purchase");
    createLoanAccountEntryPage.setInstallments("10");
    createLoanAccountEntryPage.setInterestRate("0");
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    return createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSearchPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) ClientsAndAccountsHomepage(org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) DateTime(org.joda.time.DateTime) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 38 with CreateLoanAccountSearchParameters

use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters 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 39 with CreateLoanAccountSearchParameters

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

the class UpdateCustomPropertiesTest method verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts.

/*
     * FIXME - keithw - test passes when run individually but not as part of ci build. it appears that question groups data is not
     *                  cleaned up right as instead of stepping to review installments, the questionnaire page is presented.
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//http://mifosforge.jira.com/browse/MIFOSTEST-215
@Test(enabled = true)
public void verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts() throws Exception {
    //Given
    propertiesHelper.setSavingsPendingApprovalStateEnabled("true");
    propertiesHelper.setLoanPendingApprovalStateEnabled("true");
    propertiesHelper.setGroupPendingApprovalStateEnabled("true");
    //When
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("UpdateCustomProperties TestClient");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    SavingsAccountDetailPage savingsAccountPage = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
    savingsAccountPage.verifyPage();
    //Then
    savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
    savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
    savingsAccountPage.verifyStatus("Application Pending Approval");
    //when
    CreateLoanAccountSearchParameters searchParameters2 = new CreateLoanAccountSearchParameters();
    searchParameters2.setSearchString("UpdateCustomProperties TestClient");
    searchParameters2.setLoanProduct("ClientEmergencyLoan");
    CreateLoanAccountSubmitParameters submitAccountParameters2 = new CreateLoanAccountSubmitParameters();
    submitAccountParameters2.setAmount("2765.0");
    submitAccountParameters2.setGracePeriodTypeNone(true);
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters2, submitAccountParameters2);
    loanAccountPage.verifyStatus("Application Pending Approval");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 40 with CreateLoanAccountSearchParameters

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

the class ClientTest method addLoanToCustomer.

private LoanAccountPage addLoanToCustomer(String searchString, boolean active, String loanProduct, DateTime date) throws UnsupportedEncodingException {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    CreateLoanAccountSubmitParameters submitParameters = new CreateLoanAccountSubmitParameters();
    submitParameters.setAmount("1000");
    submitParameters.setDd(String.valueOf(date.getDayOfMonth()));
    submitParameters.setMm(String.valueOf(date.getMonthOfYear()));
    submitParameters.setYy(String.valueOf(date.getYear()));
    searchParameters.setLoanProduct(loanProduct);
    searchParameters.setSearchString(searchString);
    LoanAccountPage lap = loanTestHelper.createLoanAccount(searchParameters, submitParameters);
    if (active) {
        loanTestHelper.activateLoanAccount(lap.getAccountId());
        loanTestHelper.disburseLoan(date);
    }
    return lap;
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

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