示例#1
0
 @SuppressWarnings("PMD.SignatureDeclareThrowsException")
 public void createDailyLoanProduct() throws Exception {
   SubmitFormParameters formParameters = FormParametersHelper.getDailyLoanProductParameters();
   new NavigationHelper(selenium)
       .navigateToAdminPage()
       .verifyPage()
       .defineLoanProduct(formParameters);
 }
 public CreateClientEnterPersonalDataPage.SubmitFormParameters createClient(
     String loanOfficer, String officeName) {
   CreateClientEnterPersonalDataPage clientPersonalDataPage =
       navigateToPersonalDataPage(officeName);
   CreateClientEnterPersonalDataPage.SubmitFormParameters formParameters =
       FormParametersHelper.getClientEnterPersonalDataPageFormParameters();
   clientPersonalDataPage = clientPersonalDataPage.create(formParameters);
   clientPersonalDataPage.submitAndGotoCreateClientEnterMfiDataPage();
   navigateToConfirmationPage(loanOfficer);
   return formParameters;
 }
 private String createMonthlyLoanProduct() {
   SubmitFormParameters formParameters = FormParametersHelper.getMonthlyLoanProductParameters();
   formParameters.setOfferingShortName(StringUtil.getRandomString(4));
   String loanName = formParameters.getOfferingName();
   loginAndNavigateToAdminPage()
       .navigateToDefineLoanProduct()
       .fillLoanParameters(formParameters)
       .submitAndGotoNewLoanProductPreviewPage()
       .submit();
   return loanName;
 }
 @SuppressWarnings("PMD.SignatureDeclareThrowsException")
 @Test(enabled = true)
 public void changeDigitsAfterDecimalForInterestToThree() throws Exception {
   propertiesHelper.setDigitsAfterDecimalForInterest(3);
   SubmitFormParameters submitFormParameters =
       FormParametersHelper.getWeeklyLoanProductParameters();
   submitFormParameters.setMaxInterestRate("6.33333"); // invalid value
   submitFormParameters.setMinInterestRate("1");
   submitFormParameters.setDefaultInterestRate("3");
   verifyInvalidInterestInLoanProduct(submitFormParameters, false);
   propertiesHelper.setDigitsAfterDecimalForInterest(5);
 }
 @SuppressWarnings("PMD.SignatureDeclareThrowsException")
 @Test(enabled = true)
 public void changeMaxInterestRateToFive() throws Exception {
   propertiesHelper.setMaxInterest(5);
   SubmitFormParameters submitFormParameters =
       FormParametersHelper.getWeeklyLoanProductParameters();
   submitFormParameters.setMaxInterestRate("12"); // invalid value
   submitFormParameters.setMinInterestRate("1");
   submitFormParameters.setDefaultInterestRate("3");
   verifyInvalidInterestInLoanProduct(submitFormParameters, true);
   propertiesHelper.setMaxInterest(999);
 }
 public ClientViewDetailsPage createClientWithQuestionGroups(
     String loanOfficer, String officeName, Map<String, String> choiceTags, String answer) {
   CreateClientEnterPersonalDataPage clientPersonalDataPage =
       navigateToPersonalDataPage(officeName);
   CreateClientEnterPersonalDataPage.SubmitFormParameters formParameters =
       FormParametersHelper.getClientEnterPersonalDataPageFormParameters();
   clientPersonalDataPage = clientPersonalDataPage.create(formParameters);
   QuestionResponsePage questionResponsePage =
       clientPersonalDataPage.submitAndGotoCaptureQuestionResponsePage();
   questionResponsePage.populateTextAnswer(
       "name=questionGroups[0].sectionDetails[0].questions[0].value", answer);
   questionResponsePage.populateSmartSelect("txtListSearch", choiceTags);
   questionResponsePage.navigateToNextPage();
   navigateToConfirmationPage(loanOfficer);
   return navigateToClientViewDetails(formParameters);
 }
示例#7
0
  @SuppressWarnings(
      "PMD.SignatureDeclareThrowsException") // one of the dependent methods throws Exception
  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);
  }
示例#8
0
  // http://mifosforge.jira.com/browse/MIFOSTEST-710
  @Test(enabled = true)
  @SuppressWarnings("PMD.SignatureDeclareThrowsException")
  public void verifyWaiveInterestForLoanAccount() throws Exception {
    // Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService =
        new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime systemDateTime = new DateTime(2011, 3, 7, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
    // When
    DefineNewLoanProductPage.SubmitFormParameters formParameters =
        FormParametersHelper.getWeeklyLoanProductParameters();
    formParameters.setInterestWaiver(true);
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineNewLoanProductPage newLoanProductPage = adminPage.navigateToDefineLoanProduct();
    newLoanProductPage.fillLoanParameters(formParameters);
    DefineNewLoanProductPreviewPage previewPage =
        newLoanProductPage.submitAndGotoNewLoanProductPreviewPage();
    // Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    Assert.assertTrue(selenium.isTextPresent("Interest: 31102"));
    Assert.assertTrue(selenium.isTextPresent("Principal: 1506"));
    // When
    LoanProductDetailsPage loanProductDetailsPage =
        previewPage.submit().navigateToViewLoanDetailsPage();
    // Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    // When
    EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
    // Then
    Assert.assertTrue(selenium.isChecked("EditLoanProduct.input.includeInterestWaiver"));
    // When
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.editSubmit();
    // Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    // When
    loanProductDetailsPage = editLoanProductPreviewPage.submit();
    // Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));

    // When
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("WeeklyClient Monday");
    searchParameters.setLoanProduct(formParameters.getOfferingName());

    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    LoanAccountPage loanAccountPage =
        loanTestHelper.createAndActivateDefaultLoanAccount(searchParameters);

    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);

    loanAccountPage
        .navigateToDisburseLoan()
        .submitAndNavigateToDisburseLoanConfirmationPage(disburseParameters)
        .submitAndNavigateToLoanAccountPage();

    RepayLoanPage repayLoanPage = loanAccountPage.navigateToRepayLoan();
    // Then
    Assert.assertTrue(selenium.isChecked("waiverInterestChckBox"));
    Assert.assertEquals(
        "Note: Interest due will be waived off.", selenium.getText("waiverInterestWarning"));
    Assert.assertFalse(repayLoanPage.isTotalRepaymentAmountVisible());
    Assert.assertTrue(repayLoanPage.isWaivedRepaymentAmoutVisible());
    Assert.assertEquals(repayLoanPage.waivedRepaymentAmount(), "2,500");
    // When
    repayLoanPage.interestWaiver(false);
    // Then
    Assert.assertTrue(repayLoanPage.isTotalRepaymentAmountVisible());
    Assert.assertFalse(repayLoanPage.isWaivedRepaymentAmoutVisible());
    Assert.assertFalse(selenium.isTextPresent("Note: Interest due will be waived off."));
    Assert.assertEquals(repayLoanPage.totalRepaymentAmount(), "2,509.1");
    // When
    RepayLoanParameters params = new RepayLoanParameters();
    params.setModeOfRepayment("Cash");
    loanAccountPage =
        repayLoanPage
            .submitAndNavigateToRepayLoanConfirmationPage(params)
            .submitAndNavigateToLoanAccountDetailsPage();
    // Then
    loanAccountPage.verifyStatus("Closed- Obligation met");
    String[][] accountSummaryTable = {
      {"", "Original Loan", "Amount paid", "Loan balance"},
      {"Principal", "2,500", "2,500", "0"},
      {"Interest", "9.1", "9.1", "0"},
      {"Fees", "0", "0", "0"},
      {"Penalty", "0", "0", "0"},
      {"Total", "2,509.1", "2,509.1", "0"}
    };
    loanAccountPage.verifyAccountSummary(accountSummaryTable);
    loanAccountPage.navigateToAccountActivityPage();
    Assert.assertEquals("Loan Repayment", selenium.getTable("accountActivityTable.2.1").trim());
    Assert.assertEquals("2,500", selenium.getTable("accountActivityTable.2.2").trim());
    Assert.assertEquals("0", selenium.getTable("accountActivityTable.2.10").trim());
  }