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());
}
Aggregations