Search in sources :

Example 11 with SubmitFormParameters

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

the class BatchJobPenaltyTest method createWeeklyLoanAccountWithPenalty.

private String createWeeklyLoanAccountWithPenalty(final String penaltyName) throws Exception {
    final SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    formParameters.addPenalty(penaltyName);
    formParameters.setDefaultLoanAmount("4500");
    formParameters.setInterestTypes(SubmitFormParameters.FLAT);
    formParameters.setMinInterestRate("0");
    formParameters.setMaxInterestRate("0");
    formParameters.setDefaultInterestRate("0");
    formParameters.setMaxInstallments("10");
    formParameters.setDefInstallments("10");
    LoanAccountPage loanAccountPage = penaltyHelper.createWeeklyLoanAccountWithPenalty(formParameters, "Client - Veronica Abisya", true);
    PaymentParameters formPayment = new PaymentParameters();
    formPayment.setTransactionDateDD("15");
    formPayment.setTransactionDateMM("2");
    formPayment.setTransactionDateYYYY("2012");
    formPayment.setAmount("450");
    formPayment.setPaymentType(PaymentParameters.CASH);
    loanAccountPage.navigateToApplyPayment().submitAndNavigateToApplyPaymentConfirmationPage(formPayment).submitAndNavigateToLoanAccountDetailsPage();
    penaltyHelper.verifyCalculatePenaltyWithPayment(loanAccountPage.getAccountId(), new String[] { "0", "0", "0" }, new String[][] { { "0", "450" }, null, /* Future Installments */
    { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" } }, new String[] { "0", "16/02/2012", "0" });
    return loanAccountPage.getAccountId();
}
Also used : SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 12 with SubmitFormParameters

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

the class DefineNewLoanProductTest method createWeeklyLoanProductWithQuestionGroups.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createWeeklyLoanProductWithQuestionGroups() throws Exception {
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "DT_" + random.nextInt(100);
    String question2 = "SS_" + random.nextInt(100);
    questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
    SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParametersWithQuestionGroups(questionGroupTitle);
    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 13 with SubmitFormParameters

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

the class DefineNewLoanProductTest method createMonthlyLoanProduct.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createMonthlyLoanProduct() throws Exception {
    SubmitFormParameters formParameters = FormParametersHelper.getMonthlyLoanProductParameters();
    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 14 with SubmitFormParameters

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

the class EditLoanProductTest method createMonthlyLoanProduct.

private String createMonthlyLoanProduct() {
    SubmitFormParameters formParameters = FormParametersHelper.getMonthlyLoanProductParameters();
    formParameters.setOfferingShortName(StringUtil.getRandomString(4));
    String loanName = formParameters.getOfferingName();
    loginAndNavigateToAdminPage().navigateToDefineLoanProduct().fillLoanParameters(formParameters).submitAndGotoNewLoanProductPreviewPage().submit();
    return loanName;
}
Also used : SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)

Example 15 with SubmitFormParameters

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

the class EditLoanProductTest method editExistingLoanAndSavingsProduct.

//http://mifosforge.jira.com/browse/MIFOSTEST-312
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void editExistingLoanAndSavingsProduct() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 2, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    EditLoanProductPage editLoanProductPage = createNewLoanProductAndNavigateToEditLoanPage();
    editLoanProductPage.verifyPage();
    SubmitFormParameters formParameters = new SubmitFormParameters();
    formParameters = cleanFormParameters(formParameters);
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitRequiredDescriptionAndInterestChanges(formParameters);
    String error = selenium.getText("EditLoanProduct.error.message");
    verifyError(error, "Please specify the Product instance name.", "Please specify the Short name.", "Please select the Product category.", "Please specify the Applicable for.", "Please select the Interest rate type.", "Please select the Status.", "Please specify the Min Interest rate.", "Please specify the Max Interest rate.", "Please select the Status.", "Please specify the Min Interest rate.", "Please specify the Default Interest rate.");
    //TODO js - missing error msg
    //Assert.assertEquals(error.contains("Please specify the Start date."), true);
    formParameters = setFormParameters(formParameters);
    editLoanProductPreviewPage = editLoanProductPage.submitRequiredDescriptionAndInterestChanges(formParameters);
    error = selenium.getText("EditLoanProduct.error.message");
    //TODO js - missing error msg
    //Assert.assertEquals(error.contains("The Start date cannot be changed because either the product is active or the date specified is invalid."), true);
    Assert.assertEquals(error.contains("Please specify a valid Max Interest rate. Max Interest rate should be greater than or equal to Min Interest rate."), true);
    Assert.assertEquals(error.contains("Please specify valid Default Interest rate. Default Interest rate should be between the Min and Max Interest rate, inclusive of the two."), true);
    formParameters = setCorrectFormParameters(formParameters);
    editLoanProductPreviewPage = editLoanProductPage.submitRequiredDescriptionAndInterestChanges(formParameters);
    LoanProductDetailsPage loanProductDetailsPage = editLoanProductPreviewPage.submit();
    loanProductDetailsPage.verifyPage();
    loanProductDetailsPage.editLoanProduct();
    editLoanProductPage.verifyPage();
    editLoanProductPage.verifyModifiedLoanProduct(formParameters);
    ///////////////////////SAVINGS////////////////////
    SavingsProductHelper savingsProductHelper = new SavingsProductHelper(selenium);
    SavingsProductParameters params = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2011, 2, 2, 12, 0, 0, 0), SavingsProductParameters.VOLUNTARY, SavingsProductParameters.CENTERS);
    DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
    EditSavingsProductPage editSavingsProductPage = confirmationPage.navigateToSavingsProductDetails().editSavingsProduct();
    DefineNewSavingsProductPage.SubmitSavingsFormParameters formSavingsParameters = new DefineNewSavingsProductPage.SubmitSavingsFormParameters();
    formSavingsParameters = cleanFormSavingsParameters(formSavingsParameters);
    EditSavingsProductPreviewPage editSavingsProductPreviewPage = editSavingsProductPage.submitRequiredDescriptionAndInterestChanges(formSavingsParameters);
    error = selenium.getText("error.messages");
    verifyError(error, "Please specify the Product instance name.", "Please specify the Short name.", "Please select the Product category.", "Please specify the Start date. Day must be in range (1-31).", "Please specify the Start date. Month must be in range (1-12).", "The Start date can be anything between current date and 1 year from the current date.", "Please select the Applicable for.", "Please select the Type of deposits.", "Please specify the Interest rate. Interest must be in range (0-100).", "Please select the Balance used for Interest calculation.", "Please specify the Time period for Interest calculation.", "Please specify the Frequency of Interest posting to accounts.");
    formSavingsParameters = setFormSavingsParameters(formSavingsParameters);
    editSavingsProductPreviewPage = editSavingsProductPage.submitRequiredDescriptionAndInterestChanges(formSavingsParameters);
    SavingsProductDetailsPage savingsProductDetailsPage = editSavingsProductPreviewPage.submit();
    savingsProductDetailsPage.editSavingsProduct();
    editSavingsProductPage.verifyModifiedSavingsProduct(formSavingsParameters);
}
Also used : EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) SavingsProductDetailsPage(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductDetailsPage) DateTime(org.joda.time.DateTime) EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) DefineNewSavingsProductConfirmationPage(org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) SavingsProductHelper(org.mifos.test.acceptance.framework.testhelpers.SavingsProductHelper) EditSavingsProductPage(org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DefineNewSavingsProductPage(org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductPage) EditSavingsProductPreviewPage(org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPreviewPage)

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