Search in sources :

Example 1 with DefineHiddenMandatoryFieldsPage

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();
}
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 2 with DefineHiddenMandatoryFieldsPage

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();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) Test(org.testng.annotations.Test)

Example 3 with DefineHiddenMandatoryFieldsPage

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);
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) Test(org.testng.annotations.Test)

Example 4 with DefineHiddenMandatoryFieldsPage

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();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) Test(org.testng.annotations.Test)

Example 5 with DefineHiddenMandatoryFieldsPage

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();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) CreateLoanAccountSearchPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage) ClientsAndAccountsHomepage(org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage) CreateGroupSearchPage(org.mifos.test.acceptance.framework.group.CreateGroupSearchPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) Test(org.testng.annotations.Test)

Aggregations

DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)6 Test (org.testng.annotations.Test)6 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)5 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)4 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)3 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)2 CreateGroupSearchPage (org.mifos.test.acceptance.framework.group.CreateGroupSearchPage)2 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)2 HomePage (org.mifos.test.acceptance.framework.HomePage)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 ClientSearchResultsPage (org.mifos.test.acceptance.framework.client.ClientSearchResultsPage)1 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)1 CustomerChangeStatusPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage)1 EditCustomerStatusParameters (org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)1 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)1 SearchResultsPage (org.mifos.test.acceptance.framework.search.SearchResultsPage)1