Search in sources :

Example 1 with ViewOrganizationSettingsPage

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

the class MpesaImportTest method importMpesaTransactions.

@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
@Test(enabled = true)
public void importMpesaTransactions() throws Exception {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewOrganizationSettingsPage viewOrganizationSettingsPage = adminPage.navigateToViewOrganizationSettingsPage();
    viewOrganizationSettingsPage.verifyMiscellaneous(new String[] { "Max MPESA Disbursal Limit: 50000.0" });
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    for (String importFile : TEST_FILES) {
        String path = this.getClass().getResource("/mpesa/" + importFile).toString();
        importTransaction(path);
        checkIfOutputMatchesExpected(path);
    }
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewOrganizationSettingsPage(org.mifos.test.acceptance.framework.admin.ViewOrganizationSettingsPage) Test(org.testng.annotations.Test)

Example 2 with ViewOrganizationSettingsPage

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

the class ViewOrganizationSettingsTest method verifyViewOrganizationSettingsPage.

@Test
public //http://mifosforge.jira.com/browse/MIFOSTEST-259
void verifyViewOrganizationSettingsPage() {
    //When
    AdminPage adminPage = loginAndGoToAdminPage();
    ViewOrganizationSettingsPage viewOrganizationSettingsPage = adminPage.navigateToViewOrganizationSettingsPage();
    viewOrganizationSettingsPage.verifyPage();
    //Then
    viewOrganizationSettingsPage.verifyDefaultConfiguration();
    //When
    CustomPropertiesHelper customPropertiesHelper = new CustomPropertiesHelper(selenium);
    customPropertiesHelper.setDigitsAfterDecimal(3);
    customPropertiesHelper.setGroupCanApplyLoans("false");
    adminPage = loginAndGoToAdminPage();
    viewOrganizationSettingsPage = adminPage.navigateToViewOrganizationSettingsPage();
    //Then
    viewOrganizationSettingsPage.verifyClientRules(new String[] { "Groups allowed to apply for loans: No" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Number of digits after decimal: 3" });
    customPropertiesHelper.setDigitsAfterDecimal(1);
    customPropertiesHelper.setGroupCanApplyLoans("true");
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewOrganizationSettingsPage(org.mifos.test.acceptance.framework.admin.ViewOrganizationSettingsPage) CustomPropertiesHelper(org.mifos.test.acceptance.framework.testhelpers.CustomPropertiesHelper) Test(org.testng.annotations.Test)

Example 3 with ViewOrganizationSettingsPage

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

the class LoanProcessWithDifferentCurrencyTest method createLoanProductThenAccount.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test
public // http://mifosforge.jira.com/browse/MIFOSTEST-657
void createLoanProductThenAccount() throws Exception {
    //Given
    propertiesHelper.setAdditionalCurrenciesCode("EUR,USD");
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 17, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "LoanProcessWithDifferentCurrencyTest_001_dbunit.xml", dataSource, selenium);
    //When
    propertiesHelper.setDigitsAfterDecimal(2);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewOrganizationSettingsPage viewOrganizationSettingsPage = adminPage.navigateToViewOrganizationSettingsPage();
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Currency: USD" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Currency: EUR" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Number of digits after decimal: 2" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Final Round Off Multiple: 1" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Initial Round Off Multiple: 1" });
    //Then
    FeesCreatePage.SubmitFormParameters formParameters = FormParametersHelper.getOneTimeLoanMultiCurrencyFeesParameters();
    adminPage = navigationHelper.navigateToAdminPage();
    formParameters.setFeeName("USDfee");
    adminPage.defineNewFees(formParameters);
    formParameters = FormParametersHelper.getOneTimeLoanMultiCurrencyFeesParameters();
    adminPage = navigationHelper.navigateToAdminPage();
    formParameters.setFeeName("USDfeeAdditional");
    formParameters.setAmount(20.0);
    adminPage.defineNewFees(formParameters);
    createWeeklyLoanProduct();
    String loanAccountId = createLoanAccountOfDifferentCurrency("Client-1-USD");
    pendingApprovalToApplicationApproved(loanAccountId);
    disburseLoan(loanAccountId);
    applyPayment(loanAccountId);
    navigationHelper.navigateToLoanAccountPage(loanAccountId);
    //veryfy "USDfee"(10) and "USDfeeAdditional"(20)
    Assert.assertEquals(selenium.getTable("loanSummaryTable.3.1"), "30");
    //restore parameters
    propertiesHelper.setDigitsAfterDecimal(1);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewOrganizationSettingsPage(org.mifos.test.acceptance.framework.admin.ViewOrganizationSettingsPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) FeesCreatePage(org.mifos.test.acceptance.framework.admin.FeesCreatePage) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Aggregations

AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)3 ViewOrganizationSettingsPage (org.mifos.test.acceptance.framework.admin.ViewOrganizationSettingsPage)3 Test (org.testng.annotations.Test)3 DateTime (org.joda.time.DateTime)1 FeesCreatePage (org.mifos.test.acceptance.framework.admin.FeesCreatePage)1 CustomPropertiesHelper (org.mifos.test.acceptance.framework.testhelpers.CustomPropertiesHelper)1 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)1