@SuppressWarnings("PMD.SignatureDeclareThrowsException")
  // http://mifosforge.jira.com/browse/MIFOSTEST-216
  @Test(enabled = true)
  public void verifyPropertySavingsPendingApprovalStateEnabled() throws Exception {
    // Given
    propertiesHelper.setSavingsPendingApprovalStateEnabled("false");
    // When
    CreateSavingsAccountSearchParameters searchParameters =
        new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("UpdateCustomProperties TestClient");
    searchParameters.setSavingsProduct("MandatorySavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters =
        new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    SavingsAccountDetailPage savingsAccountPage =
        savingsAccountHelper.createSavingsAccountWithoutPendingApprovalState(
            searchParameters, submitAccountParameters);
    savingsAccountPage.verifyPage();
    // Then
    savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
    savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
    savingsAccountPage.verifyStatus("Active");

    propertiesHelper.setSavingsPendingApprovalStateEnabled("true");
  }
 private void verifySavingsAccountCreation(
     CreateSavingsAccountSearchParameters searchParameters,
     CreateSavingsAccountSubmitParameters submitAccountParameters) {
   SavingsAccountDetailPage savingsAccountPage =
       savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
   savingsAccountPage.verifyPage();
   savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
   savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
 }
Example #3
0
  /**
   * MPESA - Import has errors and user chooses to import a different file with some valid and
   * invalid data. http://mifosforge.jira.com/browse/MIFOSTEST-695
   *
   * @throws Exception
   */
  @SuppressWarnings("PMD.SignatureDeclareThrowsException")
  @Test(enabled = true)
  public void importTheSameFiles() throws Exception {
    // Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService =
        new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
    String dataset = "mpesa_export_dbunit.xml";

    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);

    propertiesHelper.setImportTransactionOrder("AL3,AL5");

    // When
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage =
        importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);

    // Then
    importTransactionsConfirmationPage.verifyImportSuccess(
        "You have successfully imported transactions.");
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);

    ViewRepaymentSchedulePage viewRepaymentSchedulePage =
        loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");

    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();

    loanAccountPage.verifyPerformanceHistory("11", "11");

    TransactionHistoryPage transactionHistoryPage =
        loanAccountPage.navigateToTransactionHistoryPage();

    transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
    transactionHistoryPage.verifyPostedBy("mifos", 48);

    SavingsAccountDetailPage savingsAccountDetailPage =
        navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");

    // When
    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage = importTransactionsPage.failImportTransaction(path, EXCEL_IMPORT_TYPE);

    // Then
    importTransactionsPage.checkErrors(
        new String[] {"Same file has been already imported. Please import a different file."});
  }
  private SavingsAccountDetailPage createSavingAccountWithCreatedProduct(
      String client, String productName, String amount) {
    CreateSavingsAccountSearchParameters searchParameters =
        new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString(client);
    searchParameters.setSavingsProduct(productName);

    CreateSavingsAccountSubmitParameters submitAccountParameters =
        new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount(amount);
    SavingsAccountDetailPage savingsAccountPage =
        savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
    savingsAccountPage.verifyPage();
    savingsAccountPage.verifySavingsAmount(amount);
    savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
    return savingsAccountPage;
  }
  /*
   * 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");
  }
Example #6
0
  /**
   * MPESA - Import transactions from file with no errors
   * http://mifosforge.jira.com/browse/MIFOSTEST-688
   *
   * @throws Exception
   */
  @SuppressWarnings({"PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln"})
  @Test(enabled = true)
  public void importTransactionsFromFileWithNoErrors() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService =
        new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);

    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewRolesPage viewRolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");

    manageRolePage.disablePermission("8_3");

    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    adminPage = viewRolesPage.navigateToAdminPage();
    adminPage = adminPage.failNavigationToImportTransactionsPage();

    adminPage.verifyError(
        "You do not have permissions to perform "
            + "this activity. Contact your system administrator "
            + "to grant you the required permissions and try again.");

    viewRolesPage = adminPage.navigateToViewRolesPage();
    manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");

    manageRolePage.enablePermission("8_3");

    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();

    propertiesHelper.setImportTransactionOrder("AL3,AL5");

    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);

    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();

    ImportTransactionsPage importTransactionsPage = importTransaction(path);
    checkIfOutputMatchesExpected(path);
    importTransactionsPage.cancelImportTransaction();

    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountPage.verifyExactLoanAmount("2,000");

    SavingsAccountDetailPage savingsAccountDetailPage =
        navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("0");

    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage =
        importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);

    importTransactionsConfirmationPage.verifyImportSuccess(
        "You have successfully imported transactions.");

    loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);

    ViewRepaymentSchedulePage viewRepaymentSchedulePage =
        loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");

    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();

    loanAccountPage.verifyPerformanceHistory("11", "11");

    TransactionHistoryPage transactionHistoryPage =
        loanAccountPage.navigateToTransactionHistoryPage();

    transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
    transactionHistoryPage.verifyPostedBy("mifos", 48);

    savingsAccountDetailPage =
        navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");
  }