Search in sources :

Example 1 with ImportTransactionsPage

use of org.mifos.test.acceptance.framework.admin.ImportTransactionsPage in project head by mifos.

the class MpesaImportTest method importTransaction.

private ImportTransactionsPage importTransaction(String importFile) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage.verifyPage();
    importTransactionsPage.reviewTransactions(importFile, EXCEL_IMPORT_TYPE);
    return importTransactionsPage;
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)

Example 2 with ImportTransactionsPage

use of org.mifos.test.acceptance.framework.admin.ImportTransactionsPage in project head by mifos.

the class MpesaImportTest method validateImport.

/**
     * Digits after decimal validate occurs for disbursal and payment import
     * http://mifosforge.jira.com/browse/MIFOSTEST-278
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void validateImport() throws Exception {
    //Given
    String path = this.getClass().getResource("/mpesa/" + DISBURSAL_IMPORT).toString();
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    propertiesHelper.setDigitsAfterDecimal(0);
    //When
    ImportTransactionsPage importTransactionsPage = importTransaction(path);
    //Then
    importTransactionsPage.checkErrors(new String[] { "Row <24> error - " + "C94ZH942 - Number of fraction digits in the \"Withdrawn\"" + " column - 3 - is greater than configured for the currency - 0" });
    //When
    path = this.getClass().getResource("/mpesa/" + PAYMENT_IMPORT).toString();
    importTransactionsPage = importTransaction(path);
    //Then
    importTransactionsPage.checkErrors(new String[] { "Row <24> error - THY89933" + " - Number of fraction digits in the \"Paid In\" column - 3 - " + "is greater than configured for the currency - 0" });
    propertiesHelper.setDigitsAfterDecimal(1);
}
Also used : ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) Test(org.testng.annotations.Test)

Example 3 with ImportTransactionsPage

use of org.mifos.test.acceptance.framework.admin.ImportTransactionsPage 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 ImportTransactionsPage

use of org.mifos.test.acceptance.framework.admin.ImportTransactionsPage in project head by mifos.

the class ImportTransactionsTest method importTransaction.

private void importTransaction(String importFile, String importType) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage.verifyPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importAudiTransactions(importFile, importType);
    importTransactionsConfirmationPage.verifyPage();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)

Example 5 with ImportTransactionsPage

use of org.mifos.test.acceptance.framework.admin.ImportTransactionsPage in project head by mifos.

the class ImportTransactionsTest method importTransactionPageLoad.

//  Test the import transaction page loads with no plugins available  - regression test for MIFOS-2683
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true, groups = "no_db_unit")
public void importTransactionPageLoad() throws Exception {
    navigationHelper = new NavigationHelper(selenium);
    String tempFileName = pluginsUtil.movePluginToTemp();
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage.verifyPage();
    pluginsUtil.movePluginFromTemp(tempFileName);
    (new MifosPage(selenium)).logout();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) MifosPage(org.mifos.test.acceptance.framework.MifosPage) Test(org.testng.annotations.Test)

Aggregations

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