Search in sources :

Example 16 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class LoanAccountOverdueInterestTest method setUp.

@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod
public void setUp() throws Exception {
    super.setUp();
    propertiesHelper = new CustomPropertiesHelper(selenium);
    propertiesHelper.setOverdueInterestPaidFirst("true");
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    systemDateTime = new DateTime(2011, 3, 4, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
    loanTestHelper = new LoanTestHelper(selenium);
    navigationHelper = new NavigationHelper(selenium);
    loanProductTestHelper = new LoanProductTestHelper(selenium);
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) LoanProductTestHelper(org.mifos.test.acceptance.loanproduct.LoanProductTestHelper) CustomPropertiesHelper(org.mifos.test.acceptance.framework.testhelpers.CustomPropertiesHelper) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 17 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class LoanAccountOverdueInterestTest method verifyPayOverdueInstalment.

@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyPayOverdueInstalment() throws Exception {
    SubmitFormParameters loanParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    loanParameters.setOfferingName("OverdueLoan");
    loanProductTestHelper.defineNewLoanProduct(loanParameters);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Stu");
    searchParameters.setLoanProduct("OverdueLoan");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    LoanAccountPage loanPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String loanId = loanPage.getAccountId();
    loanPage.changeAccountStatusToAccepted();
    DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
    disburseParameters.setDisbursalDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
    disburseParameters.setDisbursalDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
    disburseParameters.setDisbursalDateYYYY(Integer.toString(systemDateTime.getYear()));
    disburseParameters.setPaymentType(PaymentParameters.CASH);
    loanTestHelper.disburseLoan(loanId, disburseParameters);
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    systemDateTime = systemDateTime.plusDays(20);
    dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
    loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
    ViewRepaymentSchedulePage repaymentPage = loanPage.navigateToRepaymentSchedulePage();
    repaymentPage.verifyRepaymentScheduleTablePrincipal(3, "17.3");
    repaymentPage.verifyRepaymentScheduleTableInterest(3, "3.7 (0)");
    repaymentPage.verifyRepaymentScheduleTablePrincipal(4, "17.4");
    repaymentPage.verifyRepaymentScheduleTableInterest(4, "3.6 (0)");
    PaymentParameters params = new PaymentParameters();
    params.setTransactionDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
    params.setTransactionDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
    params.setTransactionDateYYYY(Integer.toString(systemDateTime.getYear()));
    params.setPaymentType(PaymentParameters.CASH);
    params.setAmount("4.2");
    loanPage = repaymentPage.navigateToApplyPaymentPage().submitAndNavigateToApplyPaymentConfirmationPage(params).submitAndNavigateToLoanAccountDetailsPage();
    loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
    repaymentPage = loanPage.navigateToRepaymentSchedulePage();
    repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(3, "0");
    repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(3, "3.7");
    repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(5, "17.3");
    repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(5, "0 (3.7)");
    repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(6, "17.4");
    repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(6, "3.1 (0.5)");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Example 18 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithQuestionGroups.

@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui", "smoke", "no_db_unit" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithQuestionGroups() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "DT_" + random.nextInt(100);
    String question2 = "SS_" + random.nextInt(100);
    String answer = "01/01/2010";
    String choiceAnswer = "Choice2";
    questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
    loanProductTestHelper.editLoanProductIncludeQuestionsGroups("Flat Interest Loan Product With Fee", questionGroupTitle);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("client1 lastname");
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    QuestionResponseParameters parameters = new QuestionResponseParameters();
    parameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", answer);
    parameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", choiceAnswer);
    LoanAccountPage loanAccountPage = createLoanAccount(searchParameters, submitAccountParameters, parameters);
    ViewQuestionResponseDetailPage questionResponseDetailPage = loanAccountPage.navigateToAdditionalInformationPage();
    questionResponseDetailPage.verifyPage();
    questionResponseDetailPage.verifyQuestionPresent(question1, answer);
    questionResponseDetailPage.verifyQuestionPresent(question2, choiceAnswer);
    questionResponseDetailPage.navigateToDetailsPage();
    questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) 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) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) Test(org.testng.annotations.Test)

Example 19 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class CreateClientLoanAccountTest method tryClientLoanAccountWithAdditionalFees.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void tryClientLoanAccountWithAdditionalFees() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setLoanProduct("EmergencyLoanWithZeroInterest");
    CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    loanAccountEntryPage.selectAdditionalFees();
    // there should be an error
    loanAccountEntryPage.submitAndWaitForPage();
    loanAccountEntryPage.verifyError("Multiple instances of the same fee are not allowed.");
    // after unselect everything should pass
    loanAccountEntryPage.unselectAdditionalFee();
    loanAccountEntryPage.clickContinue();
    HomePage homePage = loanAccountEntryPage.navigateToHomePage();
    homePage.verifyPage();
    loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(searchParameters);
    loanAccountEntryPage.verifyAdditionalFeesAreEmpty();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) HomePage(org.mifos.test.acceptance.framework.HomePage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 20 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class CreateClientLoanAccountTest method createMultipleLoanAccountsWithRestrictedProductsMix.

/**
     * Verify a user is prevented from creating a second loan account
     * (for two or more clients using the bulk loan creation pipeline)
     * with a loan product restricted with the first loan.
     * http://mifosforge.jira.com/browse/MIFOSTEST-95
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createMultipleLoanAccountsWithRestrictedProductsMix() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 3, 18, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product95");
    productParams.setOfferingShortName("p95");
    productParams.setDefaultInterestRate("15.3");
    productParams.setMaxInterestRate("50");
    productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE);
    productParams.setDefaultLoanAmount("13333");
    productParams.setDefInstallments("13");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    productParams.setOfferingName("product95B");
    productParams.setOfferingShortName("p95b");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    CreateMultipleLoanAccountSelectParameters multipleAccParameters1 = new CreateMultipleLoanAccountSelectParameters();
    multipleAccParameters1.setBranch("MyOfficeDHMFT");
    multipleAccParameters1.setLoanOfficer("loan officer");
    multipleAccParameters1.setCenter("WeeklyMeetingCenter");
    multipleAccParameters1.setLoanProduct("product95");
    CreateMultipleLoanAccountSelectParameters multipleAccParameters2 = new CreateMultipleLoanAccountSelectParameters();
    multipleAccParameters2.setBranch("MyOfficeDHMFT");
    multipleAccParameters2.setLoanOfficer("loan officer");
    multipleAccParameters2.setCenter("WeeklyMeetingCenter");
    multipleAccParameters2.setLoanProduct("product95B");
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    disburseParams.setDisbursalDateDD("18");
    disburseParams.setDisbursalDateMM("03");
    disburseParams.setDisbursalDateYYYY("2011");
    String error = "The loan could not be disbursed as " + multipleAccParameters1.getLoanProduct() + " and " + multipleAccParameters2.getLoanProduct() + " are not allowed to co-exist";
    String[] clients = new String[1];
    clients[0] = "MemberWeekly Group";
    String firstRepaymentDate = "21-Mar-2011";
    CreateLoanAccountsSuccessPage createLoanAccountsSuccessPage = loanTestHelper.createMultipleLoanAccountsWithMixedRestricedPoducts(multipleAccParameters1, multipleAccParameters2, disburseParams, clients, firstRepaymentDate);
    List<String> accountNumbers = createLoanAccountsSuccessPage.verifyAndGetLoanAccountNumbers(clients.length);
    LoanAccountPage loanAccountPage = createLoanAccountsSuccessPage.selectLoansAndNavigateToLoanAccountPage(0);
    for (int i = 0; i < accountNumbers.size(); i++) {
        if (i > 0) {
            loanAccountPage = loanAccountPage.navigateToClientsAndAccountsUsingHeaderTab().searchForClient(accountNumbers.get(i)).navigateToLoanAccountSearchResult("Account # " + accountNumbers.get(i));
        }
        loanAccountPage.changeAccountStatusToAccepted();
        loanAccountPage.tryNavigatingToDisburseLoanWithError();
        loanAccountPage.verifyError(error);
    }
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountsSuccessPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateMultipleLoanAccountSelectParameters(org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Aggregations

DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)103 DateTime (org.joda.time.DateTime)81 BeforeMethod (org.testng.annotations.BeforeMethod)41 Test (org.testng.annotations.Test)22 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)21 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)20 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)19 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)16 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)10 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)9 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)9 MifosPage (org.mifos.test.acceptance.framework.MifosPage)8 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)8 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)8 AfterMethod (org.testng.annotations.AfterMethod)8 CustomPropertiesHelper (org.mifos.test.acceptance.framework.testhelpers.CustomPropertiesHelper)7 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)6 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)6 SavingsAccountHelper (org.mifos.test.acceptance.framework.testhelpers.SavingsAccountHelper)6 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)5