Search in sources :

Example 1 with TransactionHistoryPage

use of org.mifos.test.acceptance.framework.loan.TransactionHistoryPage in project head by mifos.

the class LoanTestHelper method verifyTransactionHistory.

public void verifyTransactionHistory(String loanId, Double paymentAmount) {
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistory();
    transactionHistoryPage.verifyTransactionHistory(paymentAmount, 1, 6);
}
Also used : TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Example 2 with TransactionHistoryPage

use of org.mifos.test.acceptance.framework.loan.TransactionHistoryPage in project head by mifos.

the class RedoLoanDisbursalTest method verifyMultipleReversePayments.

private void verifyMultipleReversePayments(LoanAccountPage loanAccountPage, String payAmount, String reverseNote, int loanBalance) {
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistory();
    transactionHistoryPage.verifyTableForReversedValues(payAmount, 3, reverseNote);
    transactionHistoryPage.navigateBack();
    ViewNextInstallmentDetailsPage installmentPage = loanAccountPage.navigateToViewNextInstallmentDetails();
    installmentPage.verifyInstallmentAmount(6, 2, "0");
    installmentPage.verifyInstallmentAmount(12, 2, "0");
    installmentPage.navigateBack();
    ViewRepaymentSchedulePage repaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    repaymentSchedulePage.verifyRepaymentScheduleTableRow(51, 0, "Installments due");
    repaymentSchedulePage.verifyRepaymentScheduleTableRow(52, 8, "63");
    repaymentSchedulePage.verifyRepaymentScheduleTableRow(53, 8, "63");
    repaymentSchedulePage.verifyRepaymentScheduleTableRow(54, 8, "63");
    repaymentSchedulePage.verifyRepaymentScheduleTableRow(55, 0, "Future Installments");
    repaymentSchedulePage.navigateBack();
    loanAccountPage.verifyLoanTotalBalance(Integer.toString(loanBalance));
    loanAccountPage.verifyPerformanceHistory("48", "3");
    loanAccountPage.verifyStatus("Active in Good Standing");
}
Also used : TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ViewNextInstallmentDetailsPage(org.mifos.test.acceptance.framework.loan.ViewNextInstallmentDetailsPage)

Example 3 with TransactionHistoryPage

use of org.mifos.test.acceptance.framework.loan.TransactionHistoryPage in project head by mifos.

the class MpesaImportTest method importTransactionsFromFileWithNoErrors.

/**
     * 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");
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) 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)

Example 4 with TransactionHistoryPage

use of org.mifos.test.acceptance.framework.loan.TransactionHistoryPage in project head by mifos.

the class MpesaImportTest method failImportTransaction.

/**
     * MPESA - Import has expected errors due to invalid data
     * and overpayment amount and user is not able to continue
     * http://mifosforge.jira.com/browse/MIFOSTEST-692
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void failImportTransaction() throws Exception {
    //Given
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_OVERPAYMENT_AMOUNT).toString();
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    SavingsAccountHelper savingsAccountHelper = new SavingsAccountHelper(selenium);
    savingsAccountHelper.closeSavingsAccount("000100000000019", "Close account");
    //When
    ImportTransactionsPage importTransactionsPage = importTransaction(path);
    importTransactionsPage.checkErrors(new String[] { "Row <24> error - THY89933" + " - Last account is a loan account but the total paid in amount" + " is greater than the total due amount" });
    //Then
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountPage.verifyExactLoanAmount("2,000");
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistoryPage();
    transactionHistoryPage.verifyTransactionHistory(183, 1, 6);
}
Also used : SavingsAccountHelper(org.mifos.test.acceptance.framework.testhelpers.SavingsAccountHelper) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) Test(org.testng.annotations.Test)

Example 5 with TransactionHistoryPage

use of org.mifos.test.acceptance.framework.loan.TransactionHistoryPage in project head by mifos.

the class MpesaImportTest method importTheSameFiles.

/**
     * 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." });
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) 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

TransactionHistoryPage (org.mifos.test.acceptance.framework.loan.TransactionHistoryPage)8 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)6 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)3 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)3 Test (org.testng.annotations.Test)3 DateTime (org.joda.time.DateTime)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)2 ImportTransactionsConfirmationPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage)2 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)2 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)2 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)2 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 ViewRolesPage (org.mifos.test.acceptance.framework.admin.ViewRolesPage)1 RedoLoanDisbursalParameters (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters)1 ViewNextInstallmentDetailsPage (org.mifos.test.acceptance.framework.loan.ViewNextInstallmentDetailsPage)1 SavingsAccountHelper (org.mifos.test.acceptance.framework.testhelpers.SavingsAccountHelper)1