Search in sources :

Example 1 with PenaltyHelper

use of org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper in project head by mifos.

the class RemovePenaltiesTest method setUp.

@Override
@BeforeMethod
public void setUp() throws Exception {
    super.setUp();
    this.navigationHelper = new NavigationHelper(selenium);
    this.penaltyHelper = new PenaltyHelper(selenium);
    this.dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_001_dbunit.xml", dataSource, selenium);
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) PenaltyHelper(org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with PenaltyHelper

use of org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper in project head by mifos.

the class PenaltyTest method canRemoveAutomaticPenaltyAfterPaymentHasBeenMade.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void canRemoveAutomaticPenaltyAfterPaymentHasBeenMade() throws Exception {
    LoanAccountPage loanAccountPage = prepareLoanForPenaltyTest();
    String accountId = loanAccountPage.getAccountId();
    PenaltyHelper penaltyHelper = new PenaltyHelper(selenium);
    String penaltyName = "Penalty_" + StringUtil.getRandomString(6);
    penaltyHelper.createRatePenalty(penaltyName, PenaltyFormParameters.PERIOD_NONE, "", PenaltyFormParameters.FREQUENCY_MONTHLY, "33.3", PenaltyFormParameters.FORMULA_OVERDUE_AMOUNT, "0", "9999999");
    ChargeParameters chargeParams = new ChargeParameters();
    chargeParams.setType(penaltyName);
    chargeParams.setAmount("");
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    loanAccountPage = navigationHelper.navigateToLoanAccountPage(accountId);
    loanTestHelper.applyChargeUsingFeeLabel(accountId, chargeParams);
    new DateTimeUpdaterRemoteTestingService(selenium).setDateTime(new DateTime().plusYears(1));
    loanAccountPage = navigationHelper.navigateToLoanAccountPage(accountId);
    loanAccountPage = loanAccountPage.removePenalty(1);
    loanAccountPage.verifyNoPenaltyRemovalLinkExists(1);
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) PenaltyHelper(org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters) DateTime(org.joda.time.DateTime)

Example 3 with PenaltyHelper

use of org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper in project head by mifos.

the class BatchJobPenaltyTest method setUp.

@Override
@BeforeMethod
public void setUp() throws Exception {
    super.setUp();
    this.navigationHelper = new NavigationHelper(selenium);
    this.penaltyHelper = new PenaltyHelper(selenium);
    this.dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_001_dbunit.xml", dataSource, selenium);
}
Also used : NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) PenaltyHelper(org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with PenaltyHelper

use of org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper in project head by mifos.

the class MainPenaltyTest method checkPermissionsForPenalties.

@Test(enabled = true, dependsOnMethods = { "verifyCreateAndEditPenalty" })
public void checkPermissionsForPenalties() throws Exception {
    String penaltyName = "Penalty Permission";
    String accessDenied = "Access Denied";
    String youAreNotAllowedToAccessThisPage = "You are not allowed to access this page.";
    navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").disablePermission("0_6").submitAndGotoViewRolesPage();
    navigationHelper.navigateToAdminPage().navigateToDefineNewPenaltyPage();
    Assert.assertTrue(selenium.isTextPresent(accessDenied));
    Assert.assertTrue(selenium.isTextPresent(youAreNotAllowedToAccessThisPage));
    navigationHelper.navigateToAdminPage().navigateToViewPenaltiesPage().navigateToDefineNewPenaltyPage();
    Assert.assertTrue(selenium.isTextPresent(accessDenied));
    Assert.assertTrue(selenium.isTextPresent(youAreNotAllowedToAccessThisPage));
    navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").enablePermission("0_6_0").submitAndGotoViewRolesPage();
    new PenaltyHelper(selenium).createAmountPenalty(penaltyName, PERIOD_NONE, "", FREQUENCY_NONE, "1", "999", "5");
    navigationHelper.navigateToAdminPage().navigateToViewPenaltiesPage().navigateToViewPenaltyPage(penaltyName).navigateToEditPenaltyPage();
    Assert.assertTrue(selenium.isTextPresent(accessDenied));
    Assert.assertTrue(selenium.isTextPresent(youAreNotAllowedToAccessThisPage));
    navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").enablePermission("0_6_1").submitAndGotoViewRolesPage();
    new PenaltyHelper(selenium).editAmountPenalty(penaltyName, penaltyName, PERIOD_NONE, "", FREQUENCY_NONE, "1", "9999", "3");
}
Also used : PenaltyHelper(org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper) Test(org.testng.annotations.Test)

Aggregations

PenaltyHelper (org.mifos.test.acceptance.framework.testhelpers.PenaltyHelper)4 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)3 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)3 BeforeMethod (org.testng.annotations.BeforeMethod)2 DateTime (org.joda.time.DateTime)1 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)1 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)1 Test (org.testng.annotations.Test)1