Search in sources :

Example 21 with SavingsAccountDetailPage

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

the class CreateSavingsAccountTest method verifyPaymentTypesForWithdrawalsAndDeposits.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(singleThreaded = true, groups = { "savings", "acceptance", "ui", "no_db_unit" })
public void verifyPaymentTypesForWithdrawalsAndDeposits() throws Exception {
    //When
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.VOUCHER);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.createSavingsAccountWithQG(searchParameters, submitAccountParameters);
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("test");
    savingsAccountDetailPage = savingsAccountHelper.changeStatus(savingsAccountDetailPage.getAccountId(), editAccountStatusParameters);
    SavingsDepositWithdrawalPage savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
    //When
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
    //When
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000002");
    savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
    savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
    //Then
    savingsDepositWithdrawalPage.verifyModeOfPayments();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DefineAcceptedPaymentTypesPage(org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) SavingsDepositWithdrawalPage(org.mifos.test.acceptance.framework.savings.SavingsDepositWithdrawalPage) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 22 with SavingsAccountDetailPage

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

the class CreateSavingsAccountTest method verifySavingsAccountCreationWithQG.

private void verifySavingsAccountCreationWithQG(CreateSavingsAccountSearchParameters searchParameters, CreateSavingsAccountSubmitParameters submitAccountParameters) {
    SavingsAccountDetailPage savingsAccountPage = savingsAccountHelper.createSavingsAccountWithQG(searchParameters, submitAccountParameters);
    savingsAccountPage.verifyPage();
    savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
    savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
}
Also used : SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)

Example 23 with SavingsAccountDetailPage

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

the class SavingsDepositTest method makeDepositToClientSavingsAccount.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void makeDepositToClientSavingsAccount() throws Exception {
    initData();
    DepositWithdrawalSavingsParameters params = new DepositWithdrawalSavingsParameters();
    params.setTrxnDateMM("09");
    params.setTrxnDateDD("09");
    params.setTrxnDateYYYY("2009");
    params.setAmount("543.2");
    params.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
    params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
    params.setReceiptDateDD("09");
    params.setReceiptDateMM("09");
    params.setReceiptDateYYYY("2009");
    SavingsAccountDetailPage accountDetailPage = savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000036", params);
    String[] tablesToRetrieve = { "SAVINGS_ACTIVITY_DETAILS", "SAVINGS_ACCOUNT", "SAVINGS_PERFORMANCE", "SAVINGS_TRXN_DETAIL" };
    String[] tablesToValidate = { "SAVINGS_ACTIVITY_DETAILS", "SAVINGS_ACCOUNT", "SAVINGS_PERFORMANCE" };
    IDataSet expectedDataSet = dbUnitUtilities.getDataSetFromDataSetDirectoryFile("SavingsDeposit_001_result_dbunit.xml");
    IDataSet databaseDataSet = dbUnitUtilities.getDataSetForTables(dataSource, tablesToRetrieve);
    dbUnitUtilities.verifyTables(tablesToValidate, databaseDataSet, expectedDataSet);
    // verify savings transaction table with sorting
    String[] orderSavingsTrxnByColumns = new String[] { "deposit_amount" };
    dbUnitUtilities.verifyTableWithSort(orderSavingsTrxnByColumns, SavingsDepositTest.SAVINGS_TRXN_DETAIL, expectedDataSet, databaseDataSet);
    // verify transaction history table
    TransactionHistoryPage historyPage = accountDetailPage.navigateToTransactionHistoryPage();
    historyPage.verifyTableTypeAfterDeposit(2);
}
Also used : TransactionHistoryPage(org.mifos.test.acceptance.framework.savings.TransactionHistoryPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) IDataSet(org.dbunit.dataset.IDataSet) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Example 24 with SavingsAccountDetailPage

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

the class AdditionalSavingsAccountTest method createSavingAccountWithCreatedProduct.

private SavingsAccountDetailPage createSavingAccountWithCreatedProduct(String client, String productName, String amount) {
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString(client);
    searchParameters.setSavingsProduct(productName);
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount(amount);
    SavingsAccountDetailPage savingsAccountPage = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
    savingsAccountPage.verifyPage();
    savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
    savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
    return savingsAccountPage;
}
Also used : CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters)

Example 25 with SavingsAccountDetailPage

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

the class AdditionalSavingsAccountTest method createSavingsAccount.

private String createSavingsAccount(SavingsProductParameters params) {
    DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
    confirmationPage.navigateToSavingsProductDetails();
    SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233266299995 Client1233266299995", params.getProductInstanceName(), "100000.0");
    String savingsId = savingsAccountDetailPage.getAccountId();
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("change status to active");
    savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
    return savingsId;
}
Also used : DefineNewSavingsProductConfirmationPage(org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)

Aggregations

SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)36 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)10 Test (org.testng.annotations.Test)10 DateTime (org.joda.time.DateTime)9 CreateSavingsAccountSearchParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters)9 CreateSavingsAccountSubmitParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters)9 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)9 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)8 DefineNewSavingsProductConfirmationPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage)5 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)5 CreateSavingsAccountConfirmationPage (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountConfirmationPage)4 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)3 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)3 CreateSavingsAccountEntryPage (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountEntryPage)3 CreateSavingsAccountSearchPage (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchPage)3 ImportTransactionsConfirmationPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage)2 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)2 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)2 TransactionHistoryPage (org.mifos.test.acceptance.framework.loan.TransactionHistoryPage)2 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)2