use of org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage 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.DefineHiddenMandatoryFieldsPage in project head by mifos.
the class DefineHiddenMandatoryFieldsTest method verifyChangesMadeOnDefineMandatoryHiddenFileds.
@Test(enabled = true)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public //http://mifosforge.jira.com/browse/MIFOSTEST-219
void verifyChangesMadeOnDefineMandatoryHiddenFileds() {
//When
AdminPage adminPage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").disablePermission("9_1").verifyPermissionText("9_1", "Can define hidden/mandatory fields").submitAndGotoViewRolesPage().navigateToAdminPage();
DefineHiddenMandatoryFieldsPage defineHiddenMandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
//Then
defineHiddenMandatoryFieldsPage.verifyAccessDenied();
//When
adminPage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").enablePermission("9_1").verifyPermissionText("9_1", "Can define hidden/mandatory fields").submitAndGotoViewRolesPage().navigateToAdminPage();
defineHiddenMandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.checkHideRelativeSecondLastName();
defineHiddenMandatoryFieldsPage.checkMandatoryEthnicity();
adminPage = defineHiddenMandatoryFieldsPage.submit();
adminPage.navigateToClientsAndAccountsPageUsingHeaderTab().navigateToCreateNewClientPage().navigateToCreateClientWithoutGroupPage().chooseOffice("MyOfficeDHMFT");
//Then
Assert.assertTrue(selenium.isTextPresent("*Ethnicity:"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.spouseSecondLastName"));
// restore original configuration
defineHiddenMandatoryFieldsPage = navigationHelper.navigateToAdminPage().navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.uncheckHideRelativeSecondLastName();
defineHiddenMandatoryFieldsPage.uncheckMandatoryEthnicity();
defineHiddenMandatoryFieldsPage.submit();
}
use of org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage in project head by mifos.
the class CreateGroupLoanAccountTest method tryCreateGroupLoanWithMandatoryPurposeOfLoan.
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void tryCreateGroupLoanWithMandatoryPurposeOfLoan() throws Exception {
applicationDatabaseOperation.updateGLIM(1);
try {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineHiddenMandatoryFieldsPage defineHiddenMandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.checkMandatoryLoanAccountPurpose();
defineHiddenMandatoryFieldsPage.submit();
adminPage.navigateToClientsAndAccountsPageUsingHeaderTab();
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.selectTwoClientsForGlim();
loanAccountEntryPage = loanAccountEntryPage.clickContinueButExpectValidationFailure();
loanAccountEntryPage.verifyError("Please specify loan purpose for member 1.");
loanAccountEntryPage.selectPurposeForGlim();
loanAccountEntryPage.clickContinue();
} finally {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineHiddenMandatoryFieldsPage defineHiddenMandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.uncheckMandatoryLoanAccountPurpose();
defineHiddenMandatoryFieldsPage.submit();
applicationDatabaseOperation.updateGLIM(0);
}
}
use of org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage in project head by mifos.
the class ClientTest method verifyErrorsMessages.
@Test(singleThreaded = true, groups = { "smoke", "client", "acceptance", "ui", "no_db_unit" }, enabled = true)
public void verifyErrorsMessages() {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineHiddenMandatoryFieldsPage mandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
mandatoryFieldsPage.checkMandatoryCitizenShip();
mandatoryFieldsPage.checkMandatoryEthnicity();
mandatoryFieldsPage.checkMandatoryMaritalStatus();
mandatoryFieldsPage.submit();
CreateClientEnterPersonalDataPage personalDataPage = navigationHelper.navigateToCreateClientEnterPersonalDataPage(officeName);
String[] errors = personalDataPage.getMandatoryBlankFieldsNames();
String[] fields = new String[] { "Salutation", "First Name", "Last Name", "Date of birth", "Gender", "Ethnicity", "Citizenship", "Poverty status", "Marital Status" };
for (int i = 0; i < fields.length; ++i) {
Assert.assertEquals(fields[i], errors[i]);
}
adminPage = navigationHelper.navigateToAdminPage();
adminPage.navigateToDefineHiddenMandatoryFields();
mandatoryFieldsPage.uncheckMandatoryCitizenShip();
mandatoryFieldsPage.uncheckMandatoryEthnicity();
mandatoryFieldsPage.uncheckMandatoryMaritalStatus();
mandatoryFieldsPage.submit();
adminPage.logout();
}
use of org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage in project head by mifos.
the class DefineHiddenMandatoryFieldsTest method verifyHiddenFields.
/**
* Verify Hidden Fields
* http://mifosforge.jira.com/browse/MIFOSTEST-1182
*
* @throws Exception
*/
@Test(enabled = true)
@SuppressWarnings("PMD")
public void verifyHiddenFields() {
//When
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineHiddenMandatoryFieldsPage defineHiddenMandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.uncheckMandatoryPovertyStatus();
defineHiddenMandatoryFieldsPage.checkHideExternalId();
defineHiddenMandatoryFieldsPage.checkHideEthnicity();
defineHiddenMandatoryFieldsPage.checkHideCitizenShip();
defineHiddenMandatoryFieldsPage.checkHideHandicapped();
defineHiddenMandatoryFieldsPage.checkHideEducationLevel();
defineHiddenMandatoryFieldsPage.checkHidePhoto();
defineHiddenMandatoryFieldsPage.checkHideAssignClientPostions();
defineHiddenMandatoryFieldsPage.checkHideAddress2();
defineHiddenMandatoryFieldsPage.checkHideAddress3();
defineHiddenMandatoryFieldsPage.checkHideCity();
defineHiddenMandatoryFieldsPage.checkHideState();
defineHiddenMandatoryFieldsPage.checkHideCountry();
defineHiddenMandatoryFieldsPage.checkHidePostalCode();
defineHiddenMandatoryFieldsPage.checkHideReceiptIdDate();
defineHiddenMandatoryFieldsPage.checkHideCollateralTypeNotes();
defineHiddenMandatoryFieldsPage.checkHideMiddleName();
defineHiddenMandatoryFieldsPage.checkHideSecondLastName();
defineHiddenMandatoryFieldsPage.checkHideGovtId();
defineHiddenMandatoryFieldsPage.checkHideRelativeMiddleName();
defineHiddenMandatoryFieldsPage.checkHideRelativeSecondLastName();
defineHiddenMandatoryFieldsPage.checkHidePhone();
defineHiddenMandatoryFieldsPage.checkHideTrained();
defineHiddenMandatoryFieldsPage.checkHideBusinessWorkActivities();
defineHiddenMandatoryFieldsPage.checkHidePovertyStatus();
defineHiddenMandatoryFieldsPage.checkHideGroupTrained();
adminPage = defineHiddenMandatoryFieldsPage.submit();
CreateClientEnterPersonalDataPage createClientEnterPersonalDataPage = adminPage.navigateToClientsAndAccountsPageUsingHeaderTab().navigateToCreateNewClientPage().navigateToCreateClientWithoutGroupPage().chooseOffice("MyOfficeDHMFT");
//Then
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.spouseSecondLastName"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.middleName"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.secondLastName"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.governmentId"));
Assert.assertFalse(selenium.isElementPresent("clientDetailView.citizenship"));
Assert.assertFalse(selenium.isElementPresent("clientDetailView.ethnicity"));
Assert.assertFalse(selenium.isElementPresent("clientDetailView.educationLevel"));
Assert.assertFalse(selenium.isElementPresent("clientDetailView.businessActivities"));
Assert.assertFalse(selenium.isElementPresent("clientDetailView.povertyStatus"));
Assert.assertFalse(selenium.isElementPresent("clientDetailView.handicapped"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.spouseMiddleName"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.address2"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.address3"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.city"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.state"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.country"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.postalCode"));
Assert.assertFalse(selenium.isElementPresent("create_ClientPersonalInfo.input.telephone"));
CreateClientEnterPersonalDataPage.SubmitFormParameters params = new CreateClientEnterPersonalDataPage.SubmitFormParameters();
params.setSalutation(47);
params.setFirstName("Client");
params.setLastName("Test");
params.setDateOfBirthDD("11");
params.setDateOfBirthMM("02");
params.setDateOfBirthYYYY("1981");
params.setGender(49);
createClientEnterPersonalDataPage.createWithoutSpouse(params);
createClientEnterPersonalDataPage.submitAndGotoCreateClientEnterMfiDataPage();
Assert.assertFalse(selenium.isElementPresent("trained"));
Assert.assertFalse(selenium.isElementPresent("trainedDateDD"));
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters params2 = new CreateLoanAccountSearchParameters();
params2.setSearchString("ClientWithLoan");
params2.setLoanProduct("ClientEmergencyLoan");
createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(params2);
Assert.assertFalse(selenium.isElementPresent("collateralTypeId"));
Assert.assertFalse(selenium.isElementPresent("collateralNotes"));
Assert.assertFalse(selenium.isElementPresent("externalId"));
navigationHelper.navigateToClientsAndAccountsPage();
CreateGroupSearchPage createGroupSearchPage = clientsAndAccountsHomepage.navigateToCreateNewGroupPage();
createGroupSearchPage.searchAndNavigateToCreateGroupPage("Default Center");
Assert.assertFalse(selenium.isElementPresent("trained"));
Assert.assertFalse(selenium.isElementPresent("trainedDateDD"));
// restore original configuration
defineHiddenMandatoryFieldsPage = navigationHelper.navigateToAdminPage().navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.uncheckHideExternalId();
defineHiddenMandatoryFieldsPage.uncheckHideEthnicity();
defineHiddenMandatoryFieldsPage.uncheckHideCitizenShip();
defineHiddenMandatoryFieldsPage.uncheckHideHandicapped();
defineHiddenMandatoryFieldsPage.uncheckHideEducationLevel();
defineHiddenMandatoryFieldsPage.uncheckHidePhoto();
defineHiddenMandatoryFieldsPage.uncheckHideAssignClientPostions();
defineHiddenMandatoryFieldsPage.uncheckHideAddress2();
defineHiddenMandatoryFieldsPage.uncheckHideAddress3();
defineHiddenMandatoryFieldsPage.uncheckHideCity();
defineHiddenMandatoryFieldsPage.uncheckHideState();
defineHiddenMandatoryFieldsPage.uncheckHideCountry();
defineHiddenMandatoryFieldsPage.uncheckHidePostalCode();
defineHiddenMandatoryFieldsPage.uncheckHideReceiptIdDate();
defineHiddenMandatoryFieldsPage.uncheckHideCollateralTypeNotes();
defineHiddenMandatoryFieldsPage.uncheckHideMiddleName();
defineHiddenMandatoryFieldsPage.uncheckHideSecondLastName();
defineHiddenMandatoryFieldsPage.uncheckHideGovtId();
defineHiddenMandatoryFieldsPage.uncheckHidePovertyStatus();
defineHiddenMandatoryFieldsPage.uncheckHideRelativeMiddleName();
defineHiddenMandatoryFieldsPage.uncheckHideRelativeSecondLastName();
defineHiddenMandatoryFieldsPage.uncheckHidePhone();
defineHiddenMandatoryFieldsPage.uncheckHideTrained();
defineHiddenMandatoryFieldsPage.uncheckHideBusinessWorkActivities();
defineHiddenMandatoryFieldsPage.uncheckHideGroupTrained();
defineHiddenMandatoryFieldsPage.checkMandatoryPovertyStatus();
defineHiddenMandatoryFieldsPage.submit();
}
Aggregations