Search in sources :

Example 6 with ManageRolePage

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

the class ClientTest method checkPermissionToEditClientInPendingApprovalState.

@Test(enabled = true)
public void checkPermissionToEditClientInPendingApprovalState() {
    String firstName = "Edit";
    String lastName = "Permission";
    DefineHiddenMandatoryFieldsPage mandatoryFieldsPage = navigationHelper.navigateToAdminPage().navigateToDefineHiddenMandatoryFields();
    mandatoryFieldsPage.uncheckMandatoryCitizenShip();
    mandatoryFieldsPage.uncheckMandatoryEthnicity();
    mandatoryFieldsPage.uncheckMandatoryMaritalStatus();
    mandatoryFieldsPage.submit();
    CreateClientEnterPersonalDataPage.SubmitFormParameters clientParams = clientParams();
    clientParams.setFirstName(firstName);
    clientParams.setLastName(lastName);
    ClientViewDetailsPage clientPage = clientTestHelper.createNewClient("group1", clientParams);
    clientPage.editPersonalInformation().submitAndNavigateToViewDetailsPage(clientParams);
    CustomerChangeStatusPage changeStatusPage = clientPage.navigateToCustomerChangeStatusPage();
    EditCustomerStatusParameters parameters = new EditCustomerStatusParameters();
    parameters.setClientStatus(ClientStatus.PARTIAL);
    parameters.setNote("test");
    changeStatusPage.setChangeStatusParametersAndSubmit(parameters);
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("3");
    manageRolePage.enablePermission("3_0_0");
    manageRolePage.enablePermission("3_0_2");
    manageRolePage.enablePermission("3_0_3");
    manageRolePage.submitAndGotoViewRolesPage();
    HomePage homePage = navigationHelper.navigateToHomePage();
    SearchResultsPage searchResultsPage = homePage.search(firstName + " " + lastName);
    ClientViewDetailsPage viewDetailsPage = searchResultsPage.navigateToClientViewDetailsPage("link=" + firstName + " " + lastName + "*");
    Assert.assertTrue(viewDetailsPage.editPersonalInformation().isAccessDeniedDisplayed());
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("3");
    manageRolePage.submitAndGotoViewRolesPage();
}
Also used : ClientSearchResultsPage(org.mifos.test.acceptance.framework.client.ClientSearchResultsPage) SearchResultsPage(org.mifos.test.acceptance.framework.search.SearchResultsPage) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) HomePage(org.mifos.test.acceptance.framework.HomePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) Test(org.testng.annotations.Test)

Example 7 with ManageRolePage

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

the class RolesAndPermissionTest method setMaximumLoanAmountRestriction.

private void setMaximumLoanAmountRestriction(AdminPage adminPage, String amount, boolean enablePermissionAndRestriction) {
    ViewRolesPage viewRolesPage = adminPage.navigateToViewRolesPage();
    Assert.assertEquals("Role 'CanRunBatchJobs' does not exist!", selenium.isTextPresent("CanRunBatchJobs"), true);
    ManageRolePage manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.verifyPage();
    if (enablePermissionAndRestriction) {
        selenium.check("css=input#activityRestrictionCheckbox1");
    } else {
        selenium.uncheck("css=input#activityRestrictionCheckbox1");
    }
    selenium.type("css=input[name='restrictionValue(1)']", amount);
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    viewRolesPage.navigateToAdminPage();
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage)

Example 8 with ManageRolePage

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

the class CreateClientLoanAccountTest method approveLoanAmountByDifferentLoanAmountRangesTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//https://mifosforge.jira.com/browse/MIFOSTEST-1185
@Test(enabled = true)
public void approveLoanAmountByDifferentLoanAmountRangesTest() throws Exception {
    // When
    ManageRolePage manageRolePage = new ManageRolePage(selenium);
    //.
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("activityRestrictionCheckbox1");
    manageRolePage.typeText("restrictionValue(1)", "asdf");
    manageRolePage.verifyAmountTextField();
    manageRolePage.typeText("restrictionValue(1)", "5,000");
    manageRolePage.enablePermission("activityRestrictionCheckbox1");
    manageRolePage.submitAndGotoViewRolesPage();
    //Then
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    searchParameters.setSearchString("ClientWithLoan 20110221");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("6000");
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String loanAccountId = loanAccountPage.getAccountId();
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
    editAccountStatusParameters.setNote("Approve test");
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters);
    loanAccountPage.verifyLoanAmountPermissionError();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PARTIAL);
    searchParameters.setSearchString(loanAccountId);
    loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
    //When
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("activityRestrictionCheckbox1");
    manageRolePage.typeText("restrictionValue(1)", "");
    manageRolePage.submitAndGotoViewRolesPage();
    //Then
    loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PENDING_APPROVAL);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 9 with ManageRolePage

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

the class SavingsPaymentTest method testPermissionForPaymentFromSavings.

public void testPermissionForPaymentFromSavings() {
    String loanGlobalNum = setUpLoanAccount();
    String savingsGlobalNum = setUpSavingsAccount();
    String errorMessage = "You do not have permission to make payment to the account using Savings Account Transfer";
    //first uncheck permission and see if access denied page is displayed
    //while trying transfer from savings
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    if (manageRolePage.isPermissionEnable("5_1_11")) {
        manageRolePage.disablePermission("5_1_11");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
    loanSearchParams.setSearchString(loanGlobalNum);
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanGlobalNum);
    ApplyPaymentPage applyPaymentPage = loanAccountPage.navigateToApplyPayment();
    PaymentParameters paymentParams = new PaymentParameters();
    paymentParams.setAmount(String.valueOf(TRANSFER_AMOUNT));
    paymentParams.setPaymentType(PaymentParameters.TRANSFER);
    paymentParams.setSavingsAccountGlobalNum(savingsGlobalNum);
    paymentParams.setTransactionDateDD("13");
    paymentParams.setTransactionDateMM("03");
    paymentParams.setTransactionDateYYYY("2011");
    paymentParams.setSavingsAccountBalance(String.valueOf(SAVINGS_START_BALANCE));
    paymentParams.setSavingsAccountMaxWithdrawalAmount(String.valueOf(0));
    paymentParams.setSavingsAccountType("Voluntary");
    paymentParams.setSavingsAccountName("MonthlyClientSavingsAccount");
    try {
        applyPaymentPage.submitAndNavigateToApplyPaymentConfirmationPage(paymentParams);
    } catch (AssertionError e) {
        Assert.assertTrue(selenium.isTextPresent(errorMessage));
    }
    //now enable permission and validate transfer success
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    if (!manageRolePage.isPermissionEnable("5_1_11")) {
        manageRolePage.enablePermission("5_1_11");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    navigationHelper.navigateToLoanAccountPage(loanGlobalNum).navigateToApplyPayment().submitAndNavigateToApplyPaymentConfirmationPage(paymentParams).submitAndNavigateToLoanAccountDetailsPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ApplyPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 10 with ManageRolePage

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

the class QuestionGroupTest method checkQuestionGroupPermission.

@Test(enabled = true)
public void checkQuestionGroupPermission() {
    AdminPage adminPage = getAdminPage();
    CreateQuestionGroupPage createQuestionGroupPage = getCreateQuestionGroupPage(adminPage);
    CreateQuestionGroupParameters parameters = new CreateQuestionGroupParameters();
    parameters.setTitle(qgTitle4);
    parameters.setAppliesTo(APPLIES_TO_CREATE_CLIENT);
    parameters.setAnswerEditable(true);
    for (String question : asList(qTitle1, qTitle2)) {
        parameters.addExistingQuestion(SECTION_DEFAULT, question);
    }
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.submit(parameters);
    ViewRolesPage rolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = rolesPage.navigateToManageRolePage(ADMIN_ROLE);
    manageRolePage.verifyPermissionText(QUESTION_PERMISSION_ID, QUESTION_PERMISSION_HEADER + qgTitle4);
    manageRolePage.disablePermission(QUESTION_PERMISSION_ID);
    manageRolePage.submitAndGotoViewRolesPage();
    adminPage = getAdminPage();
    Assert.assertTrue(adminPage.navigateToViewAllQuestionGroups().navigateToQuestionGroupDetailPage(qgTitle4).isAccessDeniedDisplayed());
    //set question group on inactive
    adminPage.navigateBack();
    adminPage.navigateToAdminPageUsingHeaderTab();
    manageRolePage = adminPage.navigateToViewRolesPage().navigateToManageRolePage(ADMIN_ROLE);
    manageRolePage.verifyPermissionText(QUESTION_PERMISSION_ID, QUESTION_PERMISSION_HEADER + qgTitle4);
    manageRolePage.enablePermission(QUESTION_PERMISSION_ID);
    manageRolePage.submitAndGotoViewRolesPage().navigateToAdminPage().navigateToViewAllQuestionGroups().navigateToQuestionGroupDetailPage(qgTitle4);
    questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle4);
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage) Test(org.testng.annotations.Test)

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