Search in sources :

Example 1 with ManageRolePage

use of org.mifos.test.acceptance.framework.admin.ManageRolePage 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)

Example 2 with ManageRolePage

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

the class MpesaImportTest method importTransactionsFromFileWithNoErrors.

/**
     * MPESA - Import transactions from file with no errors
     * http://mifosforge.jira.com/browse/MIFOSTEST-688
     * @throws Exception
     */
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
@Test(enabled = true)
public void importTransactionsFromFileWithNoErrors() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewRolesPage viewRolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("8_3");
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    adminPage = viewRolesPage.navigateToAdminPage();
    adminPage = adminPage.failNavigationToImportTransactionsPage();
    adminPage.verifyError("You do not have permissions to perform " + "this activity. Contact your system administrator " + "to grant you the required permissions and try again.");
    viewRolesPage = adminPage.navigateToViewRolesPage();
    manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("8_3");
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
    ImportTransactionsPage importTransactionsPage = importTransaction(path);
    checkIfOutputMatchesExpected(path);
    importTransactionsPage.cancelImportTransaction();
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountPage.verifyExactLoanAmount("2,000");
    SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("0");
    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);
    importTransactionsConfirmationPage.verifyImportSuccess("You have successfully imported transactions.");
    loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    loanAccountPage.verifyPerformanceHistory("11", "11");
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistoryPage();
    transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
    transactionHistoryPage.verifyPostedBy("mifos", 48);
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 3 with ManageRolePage

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

the class RolesAndPermissionTest method changePermission.

private void changePermission(AdminPage adminPage, String permissionValue, boolean enablePermission) {
    ViewRolesPage viewRolesPage;
    ManageRolePage manageRolePage;
    viewRolesPage = adminPage.navigateToViewRolesPage();
    manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.verifyPage();
    if (enablePermission) {
        manageRolePage.enablePermission(permissionValue);
    } else {
        manageRolePage.disablePermission(permissionValue);
    }
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    viewRolesPage.navigateToAdminPage();
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage)

Example 4 with ManageRolePage

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

the class SavingsImportTest method importSavingAccountsToClientTest.

@Test(enabled = true)
public void importSavingAccountsToClientTest() {
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    try {
        manageRolePage.enablePermission("8_8");
    } catch (AssertionError ex) {
        Logger.getAnonymousLogger().info("Permission is marked.");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    String succesNumber = "1";
    String errorNumber = "5";
    arrayOfErrors = buildArrayOfErrorsForImportSavingsTest();
    String importFile = this.getClass().getResource("/ImportSavingsAccountsTest.xls").toString();
    SavingsProductParameters parameters = savingsProductHelper.getGenericSavingsProductParameters(targetTime, SavingsProductParameters.VOLUNTARY, SavingsProductParameters.CLIENTS);
    parameters.setProductInstanceName("importSavings");
    parameters.setShortName("IMP");
    try {
        savingsProductHelper.createSavingsProduct(parameters);
    } catch (AssertionError e) {
        Logger.getAnonymousLogger().info("Product exists");
    }
    ImportSavingsReviewPage reviewPage = adminTestHelper.loadImportSavingsFileAndSubmitForReview(importFile);
    reviewPage.validateErrors(arrayOfErrors);
    reviewPage.validateSuccesText(succesNumber);
    ImportSavingsSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
    summaryPage.verifySuccesString(succesNumber);
    summaryPage.verifyErrorString(errorNumber);
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ImportSavingsSaveSummaryPage(org.mifos.test.acceptance.framework.admin.ImportSavingsSaveSummaryPage) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) ImportSavingsReviewPage(org.mifos.test.acceptance.framework.admin.ImportSavingsReviewPage) Test(org.testng.annotations.Test)

Example 5 with ManageRolePage

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

the class LoanImportTest method verifyImportLoanAccountsToClient.

/**
     * MIFOS-5662: Add the possibility to import new Loans data.
     * Test loads basic xls spreadsheet and test for rows parsed with errors. Then submits successfully parsed rows.
     * Accounts are imported to client.
     */
private void verifyImportLoanAccountsToClient(int loanRecurrenceTypeId, boolean enableLSIM, int[] skipErrorLineIndices) throws Exception {
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_dbunit.xml", dataSource, selenium);
    //changing date so dates in xls spreadsheet will be appropriate
    targetTime = new DateTime(2012, 6, 22, 12, 0, 0, 0);
    DateTimeUpdaterRemoteTestingService dtUpdate = new DateTimeUpdaterRemoteTestingService(selenium);
    dtUpdate.setDateTime(targetTime);
    applicationDatabaseOperation.updateLSIM((enableLSIM) ? 1 : 0);
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    try {
        manageRolePage.enablePermission("8_7");
    } catch (AssertionError ex) {
        Logger.getAnonymousLogger().info("Permission is marked.");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    if (!valuesDefined) {
        valuesDefined = defineValuesForProducts();
    }
    String succesNumber = "1";
    String errorNumber = Integer.toString(27 - skipErrorLineIndices.length);
    String testID = "TID1";
    arrayOfErrors = buildArrayOfErrorsForImportLoanTest(testID, skipErrorLineIndices);
    SubmitFormParameters parameters = loanProductTestHelper.defineLoanProductParameters(10, 100, 1, 1, loanRecurrenceTypeId);
    parameters.setOfferingName(productForClient);
    parameters.setMinLoanAmount("5");
    parameters.setMaxLoanAmount("1000");
    parameters.setMinInterestRate("1");
    parameters.setMaxInterestRate("50");
    parameters.setMinInstallemnts("2");
    parameters.setMaxInstallments("50");
    parameters.setGracePeriodType(SubmitFormParameters.GRACE_ON_ALL_REPAYMENTS);
    parameters.setGracePeriodDuration("10");
    try {
        loanProductTestHelper.defineNewLoanProduct(parameters);
    } catch (AssertionError ae) {
        Logger.getAnonymousLogger().info("Product exists");
    }
    String importFile = this.getClass().getResource("/ImportLoanAccountsTest.xls").toString();
    ImportLoansReviewPage reviewPage = adminTestHelper.loadImportLoansFileAndSubmitForReview(importFile);
    reviewPage.validateErrors(arrayOfErrors);
    reviewPage.validateSuccesText(succesNumber);
    ImportLoansSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
    summaryPage.verifySuccesString(succesNumber);
    summaryPage.verifyErrorStroing(errorNumber);
    valuesDefined = false;
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ImportLoansSaveSummaryPage(org.mifos.test.acceptance.framework.admin.ImportLoansSaveSummaryPage) ImportLoansReviewPage(org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Aggregations

ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)10 Test (org.testng.annotations.Test)6 ViewRolesPage (org.mifos.test.acceptance.framework.admin.ViewRolesPage)4 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)3 DateTime (org.joda.time.DateTime)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)2 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)2 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)2 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)2 HomePage (org.mifos.test.acceptance.framework.HomePage)1 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)1 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)1 ImportLoansReviewPage (org.mifos.test.acceptance.framework.admin.ImportLoansReviewPage)1 ImportLoansSaveSummaryPage (org.mifos.test.acceptance.framework.admin.ImportLoansSaveSummaryPage)1 ImportSavingsReviewPage (org.mifos.test.acceptance.framework.admin.ImportSavingsReviewPage)1 ImportSavingsSaveSummaryPage (org.mifos.test.acceptance.framework.admin.ImportSavingsSaveSummaryPage)1 ImportTransactionsConfirmationPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage)1 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)1 ClientSearchResultsPage (org.mifos.test.acceptance.framework.client.ClientSearchResultsPage)1 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)1