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