Search in sources :

Example 1 with SavingFundTransferEnterDetailsPage

use of org.mifos.test.acceptance.framework.savings.SavingFundTransferEnterDetailsPage in project head by mifos.

the class SavingsPaymentTest method verifyAbilityToTransferFundsFromOneSavingAccountToAnotherSavingAccount.

@Test(enabled = true)
public //https://mifosforge.jira.com/browse/MIFOSTEST-1189
void verifyAbilityToTransferFundsFromOneSavingAccountToAnotherSavingAccount() {
    // Given
    String TRANSFER_AMOUNT = "50";
    String senderSavingsAccountId = savingsTestHelper.createAndActivateSavingAccountWithDefaultAmountOfDeposit("Stu12332659912419 Client12332659912419").getAccountId();
    String receiverSavingsAccountId = savingsTestHelper.createAndActivateSavingAccountWithDefaultAmountOfDeposit("Stu1233266299995 Client1233266299995").getAccountId();
    ManageRolePage manageRolePage = new ManageRolePage(selenium);
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    // When
    if (manageRolePage.isPermissionEnable("6_15")) {
        manageRolePage.disablePermission("6_15").submitAndGotoViewRolesPage();
    }
    //Then
    SavingsAccountDetailPage savingAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(senderSavingsAccountId);
    savingAccountDetailPage.navigateToApplyTransferPage().verifyIsAccessDeniedMessageDisplayed();
    //When
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    if (!manageRolePage.isPermissionEnable("6_15")) {
        manageRolePage.enablePermission("6_15").submitAndGotoViewRolesPage();
    }
    //Then
    savingAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(senderSavingsAccountId);
    SavingFundTransferEnterDetailsPage savingFundTransferEnterDetailPage = savingAccountDetailPage.navigateToApplyTransferPaymentPage("Stu1233266299995 Client1233266299995", receiverSavingsAccountId);
    FundsParameters params = new FundsParameters();
    params.setTransactionDateDD("1c");
    params.setTransactionDateMM("03");
    params.setTransactionDateYYYY("2011");
    savingFundTransferEnterDetailPage.submitWithWrongParams(params, "Date of transaction was invalid. Please enter a valid date.");
    params.setTransactionDateDD("13");
    savingFundTransferEnterDetailPage.submitWithWrongParams(params, "Please specify Amount.");
    params.setAmount(TRANSFER_AMOUNT);
    savingFundTransferEnterDetailPage.submitAndNavigateToSavingFundPreviewPage(params).submitAndNavigateToSavingDetailPage();
    //Then
    Assert.assertEquals("50", savingAccountDetailPage.getAccountBallance());
    savingAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(receiverSavingsAccountId);
    Assert.assertEquals("150", savingAccountDetailPage.getAccountBallance());
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) SavingFundTransferEnterDetailsPage(org.mifos.test.acceptance.framework.savings.SavingFundTransferEnterDetailsPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) FundsParameters(org.mifos.test.acceptance.framework.savings.FundsParameters) Test(org.testng.annotations.Test)

Aggregations

ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 FundsParameters (org.mifos.test.acceptance.framework.savings.FundsParameters)1 SavingFundTransferEnterDetailsPage (org.mifos.test.acceptance.framework.savings.SavingFundTransferEnterDetailsPage)1 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)1 Test (org.testng.annotations.Test)1