Search in sources :

Example 1 with SubmitFormParameters

use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.

the class DefineNewLoanProductTest method createDailyLoanProduct.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createDailyLoanProduct() throws Exception {
    SubmitFormParameters formParameters = FormParametersHelper.getDailyLoanProductParameters();
    new NavigationHelper(selenium).navigateToAdminPage().verifyPage().defineLoanProduct(formParameters);
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)

Example 2 with SubmitFormParameters

use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.

the class DefineNewLoanProductTest method createWeeklyLoanProduct.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createWeeklyLoanProduct() throws Exception {
    SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    new NavigationHelper(selenium).navigateToAdminPage().verifyPage().defineLoanProduct(formParameters);
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)

Example 3 with SubmitFormParameters

use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.

the class EditLoanProductTest method editExistingLoanProduct.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // one of the dependent methods throws Exception
void editExistingLoanProduct() throws Exception {
    EditLoanProductPage editLoanProductPage = createNewLoanProductAndNavigateToEditLoanPage();
    editLoanProductPage.verifyPage();
    SubmitFormParameters formParameters = new SubmitFormParameters();
    formParameters.setDescription("Modified Description");
    formParameters.setMaxInterestRate("44");
    formParameters.setMinInterestRate("3");
    formParameters.setDefaultInterestRate("18");
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitDescriptionAndInterestChanges(formParameters);
    LoanProductDetailsPage loanProductDetailsPage = editLoanProductPreviewPage.submit();
    loanProductDetailsPage.verifyPage();
    loanProductDetailsPage.editLoanProduct();
    editLoanProductPage.verifyPage();
    editLoanProductPage.verifyModifiedDescriptionAndInterest(formParameters);
}
Also used : EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)

Example 4 with SubmitFormParameters

use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.

the class LoanImportTest method verifyImportLoanAccountsToClient.

/**
     * MIFOS-5662: Add the possibility to import new Loans data.
     * Test loads basic xls spreadsheet and test for rows parsed with errors. Then submits successfully parsed rows.
     * Accounts are imported to client.
     */
private void verifyImportLoanAccountsToClient(int loanRecurrenceTypeId, boolean enableLSIM, int[] skipErrorLineIndices) throws Exception {
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_dbunit.xml", dataSource, selenium);
    //changing date so dates in xls spreadsheet will be appropriate
    targetTime = new DateTime(2012, 6, 22, 12, 0, 0, 0);
    DateTimeUpdaterRemoteTestingService dtUpdate = new DateTimeUpdaterRemoteTestingService(selenium);
    dtUpdate.setDateTime(targetTime);
    applicationDatabaseOperation.updateLSIM((enableLSIM) ? 1 : 0);
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    try {
        manageRolePage.enablePermission("8_7");
    } catch (AssertionError ex) {
        Logger.getAnonymousLogger().info("Permission is marked.");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    if (!valuesDefined) {
        valuesDefined = defineValuesForProducts();
    }
    String succesNumber = "1";
    String errorNumber = Integer.toString(27 - skipErrorLineIndices.length);
    String testID = "TID1";
    arrayOfErrors = buildArrayOfErrorsForImportLoanTest(testID, skipErrorLineIndices);
    SubmitFormParameters parameters = loanProductTestHelper.defineLoanProductParameters(10, 100, 1, 1, loanRecurrenceTypeId);
    parameters.setOfferingName(productForClient);
    parameters.setMinLoanAmount("5");
    parameters.setMaxLoanAmount("1000");
    parameters.setMinInterestRate("1");
    parameters.setMaxInterestRate("50");
    parameters.setMinInstallemnts("2");
    parameters.setMaxInstallments("50");
    parameters.setGracePeriodType(SubmitFormParameters.GRACE_ON_ALL_REPAYMENTS);
    parameters.setGracePeriodDuration("10");
    try {
        loanProductTestHelper.defineNewLoanProduct(parameters);
    } catch (AssertionError ae) {
        Logger.getAnonymousLogger().info("Product exists");
    }
    String importFile = this.getClass().getResource("/ImportLoanAccountsTest.xls").toString();
    ImportLoansReviewPage reviewPage = adminTestHelper.loadImportLoansFileAndSubmitForReview(importFile);
    reviewPage.validateErrors(arrayOfErrors);
    reviewPage.validateSuccesText(succesNumber);
    ImportLoansSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
    summaryPage.verifySuccesString(succesNumber);
    summaryPage.verifyErrorStroing(errorNumber);
    valuesDefined = false;
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ImportLoansSaveSummaryPage(org.mifos.test.acceptance.framework.admin.ImportLoansSaveSummaryPage) ImportLoansReviewPage(org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 5 with SubmitFormParameters

use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters 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)

Aggregations

SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)16 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)5 Test (org.testng.annotations.Test)4 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)3 DateTime (org.joda.time.DateTime)2 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)2 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)2 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)2 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)2 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)2 EditLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage)2 EditLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage)2 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 ImportLoansReviewPage (org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage)1 ImportLoansSaveSummaryPage (org.mifos.test.acceptance.framework.admin.ImportLoansSaveSummaryPage)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)1 DefineNewSavingsProductConfirmationPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage)1