Search in sources :

Example 1 with CreateGroupSearchPage

use of org.mifos.test.acceptance.framework.group.CreateGroupSearchPage in project head by mifos.

the class GroupTest method loginAndNavigateToNewGroupPage.

private CreateGroupEntryPage loginAndNavigateToNewGroupPage() {
    LoginPage loginPage = appLauncher.launchMifos();
    HomePage homePage = loginPage.loginSuccessfullyUsingDefaultCredentials();
    String centerName = "Default Center";
    CreateGroupSearchPage groupSearchPage = homePage.navigateToCreateNewGroupSearchPage();
    groupSearchPage.verifyPage();
    return groupSearchPage.searchAndNavigateToCreateGroupPage(centerName);
}
Also used : HomePage(org.mifos.test.acceptance.framework.HomePage) CreateGroupSearchPage(org.mifos.test.acceptance.framework.group.CreateGroupSearchPage) LoginPage(org.mifos.test.acceptance.framework.login.LoginPage)

Example 2 with CreateGroupSearchPage

use of org.mifos.test.acceptance.framework.group.CreateGroupSearchPage 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)

Example 3 with CreateGroupSearchPage

use of org.mifos.test.acceptance.framework.group.CreateGroupSearchPage 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();
}
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

CreateGroupSearchPage (org.mifos.test.acceptance.framework.group.CreateGroupSearchPage)3 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)2 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)2 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)2 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)2 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)2 Test (org.testng.annotations.Test)2 HomePage (org.mifos.test.acceptance.framework.HomePage)1 LoginPage (org.mifos.test.acceptance.framework.login.LoginPage)1