use of org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage in project head by mifos.
the class DefineHiddenMandatoryFieldsTest method verifyMandatoryFields.
/**
* Verify Mandatory Fields
* http://mifosforge.jira.com/browse/MIFOSTEST-1181
*
* @throws Exception
*/
@Test(enabled = true)
@SuppressWarnings("PMD")
public void verifyMandatoryFields() {
//When
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineHiddenMandatoryFieldsPage defineHiddenMandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.checkMandatoryExternalId();
defineHiddenMandatoryFieldsPage.checkMandatoryEthnicity();
defineHiddenMandatoryFieldsPage.checkMandatoryCitizenShip();
defineHiddenMandatoryFieldsPage.checkMandatoryHandicapped();
defineHiddenMandatoryFieldsPage.checkMandatoryEducationLevel();
// TODO: we cannot make photo as a mandatory one, because we cannot upload images in selenium tests
//defineHiddenMandatoryFieldsPage.checkMandatoryPhoto();
defineHiddenMandatoryFieldsPage.checkMandatoryAddress1();
defineHiddenMandatoryFieldsPage.checkMandatoryMiddleName();
defineHiddenMandatoryFieldsPage.checkMandatorySecondLastName();
defineHiddenMandatoryFieldsPage.checkMandatoryGovtId();
defineHiddenMandatoryFieldsPage.checkMandatoryMaritalStatus();
defineHiddenMandatoryFieldsPage.checkMandatoryRelativeSecondLastName();
defineHiddenMandatoryFieldsPage.checkMandatoryPhone();
defineHiddenMandatoryFieldsPage.checkMandatoryTrained();
defineHiddenMandatoryFieldsPage.checkMandatoryTrainedOn();
defineHiddenMandatoryFieldsPage.checkMandatoryNumberOfChildren();
defineHiddenMandatoryFieldsPage.checkMandatoryLoanAccountPurpose();
defineHiddenMandatoryFieldsPage.checkMandatoryLoanSourceOfFund();
adminPage = defineHiddenMandatoryFieldsPage.submit();
CreateClientEnterPersonalDataPage createClientEnterPersonalDataPage = adminPage.navigateToClientsAndAccountsPageUsingHeaderTab().navigateToCreateNewClientPage().navigateToCreateClientWithoutGroupPage().chooseOffice("MyOfficeDHMFT");
//Then
Assert.assertTrue(selenium.isTextPresent("*Middle Name"));
Assert.assertTrue(selenium.isTextPresent("*Second Last Name"));
Assert.assertTrue(selenium.isTextPresent("*Government ID"));
Assert.assertTrue(selenium.isTextPresent("*Marital Status"));
Assert.assertTrue(selenium.isTextPresent("*Number Of Children"));
Assert.assertTrue(selenium.isTextPresent("*Citizenship"));
Assert.assertTrue(selenium.isTextPresent("*Ethnicity"));
Assert.assertTrue(selenium.isTextPresent("*Education Level"));
Assert.assertTrue(selenium.isTextPresent("*Handicapped"));
Assert.assertTrue(selenium.isTextPresent("*Address 1"));
Assert.assertTrue(selenium.isTextPresent("*Poverty Status"));
CreateClientEnterPersonalDataPage.SubmitFormParameters params3 = new CreateClientEnterPersonalDataPage.SubmitFormParameters();
params3.setSalutation(47);
params3.setFirstName("Client");
params3.setMiddleName("Middle");
params3.setLastName("Test");
params3.setSecondLastName("Second");
params3.setGovernmentID("12345");
params3.setMaritalStatus(67);
params3.setCitizenship(131);
params3.setEthnicity(133);
params3.setHandicappedDropdown(139);
params3.setPovertyStatus(42);
params3.setEducationLevel(135);
params3.setSpouseLastName("LastName");
params3.setAddress1("address1");
params3.setNumberOfChildren("2");
params3.setDateOfBirthDD("11");
params3.setDateOfBirthMM("02");
params3.setDateOfBirthYYYY("1981");
params3.setGender(49);
params3.setPhone("123456");
params3.setSpouseNameType(2);
createClientEnterPersonalDataPage.createWithMandatoryFields(params3);
createClientEnterPersonalDataPage.submitAndGotoCreateClientEnterMfiDataPage();
Assert.assertTrue(selenium.isTextPresent("*External Id"));
Assert.assertTrue(selenium.isTextPresent("*Trained"));
Assert.assertTrue(selenium.isTextPresent("*Trained On Date"));
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters params4 = new CreateLoanAccountSearchParameters();
params4.setSearchString("ClientWithLoan");
params4.setLoanProduct("ClientEmergencyLoan");
createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(params4);
Assert.assertTrue(selenium.isTextPresent("*External id"));
navigationHelper.navigateToClientsAndAccountsPage();
CreateGroupSearchPage createGroupSearchPage = clientsAndAccountsHomepage.navigateToCreateNewGroupPage();
createGroupSearchPage.searchAndNavigateToCreateGroupPage("Default Center");
Assert.assertTrue(selenium.isTextPresent("*External Id"));
// restore original configuration
defineHiddenMandatoryFieldsPage = navigationHelper.navigateToAdminPage().navigateToDefineHiddenMandatoryFields();
defineHiddenMandatoryFieldsPage.uncheckMandatoryExternalId();
defineHiddenMandatoryFieldsPage.uncheckMandatoryEthnicity();
defineHiddenMandatoryFieldsPage.uncheckMandatoryCitizenShip();
defineHiddenMandatoryFieldsPage.uncheckMandatoryHandicapped();
defineHiddenMandatoryFieldsPage.uncheckMandatoryEducationLevel();
//defineHiddenMandatoryFieldsPage.uncheckMandatoryPhoto();
defineHiddenMandatoryFieldsPage.uncheckMandatoryAddress1();
defineHiddenMandatoryFieldsPage.uncheckMandatoryMiddleName();
defineHiddenMandatoryFieldsPage.uncheckMandatorySecondLastName();
defineHiddenMandatoryFieldsPage.uncheckMandatoryGovtId();
defineHiddenMandatoryFieldsPage.uncheckMandatoryMaritalStatus();
defineHiddenMandatoryFieldsPage.uncheckMandatoryRelativeSecondLastName();
defineHiddenMandatoryFieldsPage.uncheckMandatoryPhone();
defineHiddenMandatoryFieldsPage.uncheckMandatoryTrained();
defineHiddenMandatoryFieldsPage.uncheckMandatoryTrainedOn();
defineHiddenMandatoryFieldsPage.uncheckMandatoryNumberOfChildren();
defineHiddenMandatoryFieldsPage.uncheckMandatoryLoanAccountPurpose();
defineHiddenMandatoryFieldsPage.uncheckMandatoryLoanSourceOfFund();
defineHiddenMandatoryFieldsPage.submit();
}
Aggregations