Search in sources :

Example 1 with ImportLoansReviewPage

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

the class AdminTestHelper method loadImportLoansFileAndSubmitForReview.

/**
     * Navigates to import loan accounts page, loads file for parser and displays parser's result.
     * @param importFile path to file/resource
     * @return
     */
public ImportLoansReviewPage loadImportLoansFileAndSubmitForReview(String importFile) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportLoansPage selectFilePage = adminPage.navigateToImportLoansPage();
    selectFilePage.verifyPage();
    ImportLoansReviewPage reviewPage = selectFilePage.submitToReview(importFile);
    reviewPage.verifyPage();
    return reviewPage;
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ImportLoansPage(org.mifos.test.acceptance.framework.admin.ImportLoansPage) ImportLoansReviewPage(org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage)

Example 2 with ImportLoansReviewPage

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

the class LoanImportTest method verifyImportLoanAccountsToClient.

/**
     * MIFOS-5662: Add the possibility to import new Loans data.
     * Test loads basic xls spreadsheet and test for rows parsed with errors. Then submits successfully parsed rows.
     * Accounts are imported to client.
     */
private void verifyImportLoanAccountsToClient(int loanRecurrenceTypeId, boolean enableLSIM, int[] skipErrorLineIndices) throws Exception {
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_dbunit.xml", dataSource, selenium);
    //changing date so dates in xls spreadsheet will be appropriate
    targetTime = new DateTime(2012, 6, 22, 12, 0, 0, 0);
    DateTimeUpdaterRemoteTestingService dtUpdate = new DateTimeUpdaterRemoteTestingService(selenium);
    dtUpdate.setDateTime(targetTime);
    applicationDatabaseOperation.updateLSIM((enableLSIM) ? 1 : 0);
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    try {
        manageRolePage.enablePermission("8_7");
    } catch (AssertionError ex) {
        Logger.getAnonymousLogger().info("Permission is marked.");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    if (!valuesDefined) {
        valuesDefined = defineValuesForProducts();
    }
    String succesNumber = "1";
    String errorNumber = Integer.toString(27 - skipErrorLineIndices.length);
    String testID = "TID1";
    arrayOfErrors = buildArrayOfErrorsForImportLoanTest(testID, skipErrorLineIndices);
    SubmitFormParameters parameters = loanProductTestHelper.defineLoanProductParameters(10, 100, 1, 1, loanRecurrenceTypeId);
    parameters.setOfferingName(productForClient);
    parameters.setMinLoanAmount("5");
    parameters.setMaxLoanAmount("1000");
    parameters.setMinInterestRate("1");
    parameters.setMaxInterestRate("50");
    parameters.setMinInstallemnts("2");
    parameters.setMaxInstallments("50");
    parameters.setGracePeriodType(SubmitFormParameters.GRACE_ON_ALL_REPAYMENTS);
    parameters.setGracePeriodDuration("10");
    try {
        loanProductTestHelper.defineNewLoanProduct(parameters);
    } catch (AssertionError ae) {
        Logger.getAnonymousLogger().info("Product exists");
    }
    String importFile = this.getClass().getResource("/ImportLoanAccountsTest.xls").toString();
    ImportLoansReviewPage reviewPage = adminTestHelper.loadImportLoansFileAndSubmitForReview(importFile);
    reviewPage.validateErrors(arrayOfErrors);
    reviewPage.validateSuccesText(succesNumber);
    ImportLoansSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
    summaryPage.verifySuccesString(succesNumber);
    summaryPage.verifyErrorStroing(errorNumber);
    valuesDefined = false;
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ImportLoansSaveSummaryPage(org.mifos.test.acceptance.framework.admin.ImportLoansSaveSummaryPage) ImportLoansReviewPage(org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Aggregations

ImportLoansReviewPage (org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage)2 DateTime (org.joda.time.DateTime)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 ImportLoansPage (org.mifos.test.acceptance.framework.admin.ImportLoansPage)1 ImportLoansSaveSummaryPage (org.mifos.test.acceptance.framework.admin.ImportLoansSaveSummaryPage)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)1 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)1