Search in sources :

Example 6 with CreateUserParameters

use of org.mifos.test.acceptance.framework.user.CreateUserParameters in project head by mifos.

the class PersonnelTest method findUserTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true, groups = { "acceptance" })
public void findUserTest() throws Exception {
    CreateUserParameters formParameters = new CreateUserParameters();
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    formParameters = adminPage.getAdminUserParameters();
    formParameters.setSecondLastName("SecondLastName" + StringUtil.getRandomString(8));
    //When
    userHelper.createUser(formParameters, "MyOfficeDHMFT");
    //Then
    ViewSystemUsersPage findUserPage = navigationHelper.navigateToFindUserPage();
    String secondLastName = formParameters.getSecondLastName();
    findUserPage.searchAndNavigateToUserViewDetailsPage(secondLastName);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) ViewSystemUsersPage(org.mifos.test.acceptance.framework.admin.ViewSystemUsersPage) Test(org.testng.annotations.Test)

Example 7 with CreateUserParameters

use of org.mifos.test.acceptance.framework.user.CreateUserParameters in project head by mifos.

the class PersonnelTest method editUserTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true, groups = { "acceptance" })
public void editUserTest() throws Exception {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    UserViewDetailsPage userDetailsPage = userHelper.createUser(adminPage.getAdminUserParameters(), "MyOfficeDHMFT");
    EditUserDataPage editUserPage = userDetailsPage.navigateToEditUserDataPage();
    CreateUserParameters formParameters = new CreateUserParameters();
    formParameters.setFirstName("Update");
    formParameters.setLastName("User" + StringUtil.getRandomString(8));
    formParameters.setEmail("xxx.yyy@xxx.zzz");
    EditUserPreviewDataPage editPreviewDataPage = editUserPage.submitAndGotoEditUserPreviewDataPage(formParameters);
    UserViewDetailsPage userDetailsPage2 = editPreviewDataPage.submit();
    userDetailsPage2.verifyModifiedNameAndEmail(formParameters);
}
Also used : EditUserPreviewDataPage(org.mifos.test.acceptance.framework.user.EditUserPreviewDataPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) UserViewDetailsPage(org.mifos.test.acceptance.framework.user.UserViewDetailsPage) EditUserDataPage(org.mifos.test.acceptance.framework.user.EditUserDataPage) Test(org.testng.annotations.Test)

Example 8 with CreateUserParameters

use of org.mifos.test.acceptance.framework.user.CreateUserParameters in project head by mifos.

the class CenterMeetingTest method prepareCenterForTest.

private void prepareCenterForTest(MeetingParameters meeting) {
    OfficeHelper officeHelper = new OfficeHelper(selenium);
    String officeName = "Office" + StringUtil.getRandomString(10);
    OfficeParameters officeParameters = new OfficeParameters();
    officeParameters.setOfficeName(officeName);
    officeParameters.setOfficeType(OfficeParameters.BRANCH_OFFICE);
    officeParameters.setShortName(StringUtil.getRandomString(4));
    officeParameters.setParentOffice("Head Office(Mifos HO )");
    officeHelper.createOffice(officeParameters);
    UserHelper userHelper = new UserHelper(selenium);
    CreateUserParameters userParameters = new CreateUserParameters();
    firstName = StringUtil.getRandomString(6);
    lastName = StringUtil.getRandomString(6);
    userParameters.setFirstName(firstName);
    userParameters.setLastName(lastName);
    userParameters.setDateOfBirthDD("11");
    userParameters.setDateOfBirthMM("11");
    userParameters.setDateOfBirthYYYY("1950");
    String userName = StringUtil.getRandomString(6);
    String password = StringUtil.getRandomString(6);
    userParameters.setPassword(password);
    userParameters.setPasswordRepeat(password);
    userParameters.setUserName(userName);
    userParameters.setUserLevel(CreateUserParameters.LOAN_OFFICER);
    userParameters.setGender(CreateUserParameters.MALE);
    userHelper.createUser(userParameters, officeName);
    CenterTestHelper centerHelper = new CenterTestHelper(selenium);
    CreateCenterEnterDataPage.SubmitFormParameters formParameters = new CreateCenterEnterDataPage.SubmitFormParameters();
    centerName = "Center" + StringUtil.getRandomString(8);
    formParameters.setCenterName(centerName);
    formParameters.setLoanOfficer(firstName + " " + lastName);
    formParameters.setMeeting(meeting);
    centerHelper.createCenter(formParameters, officeName);
}
Also used : CreateCenterEnterDataPage(org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage) OfficeHelper(org.mifos.test.acceptance.framework.testhelpers.OfficeHelper) OfficeParameters(org.mifos.test.acceptance.framework.office.OfficeParameters) UserHelper(org.mifos.test.acceptance.framework.testhelpers.UserHelper) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) CenterTestHelper(org.mifos.test.acceptance.framework.testhelpers.CenterTestHelper)

Example 9 with CreateUserParameters

use of org.mifos.test.acceptance.framework.user.CreateUserParameters in project head by mifos.

the class PersonnelTest method createUserWithQuestionGroup.

//http://mifosforge.jira.com/browse/MIFOSTEST-670
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createUserWithQuestionGroup() throws Exception {
    //Given
    createQuestions();
    //When
    Map<String, List<String>> sectionQuestions = new HashMap<String, List<String>>();
    List<String> questions = new ArrayList<String>();
    questions.add("user question 1");
    sectionQuestions.put("Sec 1", questions);
    questions = new ArrayList<String>();
    questions.add("user question 2");
    questions.add("user question 3");
    sectionQuestions.put("Sec 2", questions);
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.setAnswerEditable(true);
    createQuestionGroupParameters.setAppliesTo("Create Personnel");
    createQuestionGroupParameters.setTitle("Create Personnel QG1");
    createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
    questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
    sectionQuestions = new HashMap<String, List<String>>();
    questions = new ArrayList<String>();
    questions.add("user question 4");
    sectionQuestions.put("Sec 3", questions);
    createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.setAnswerEditable(true);
    createQuestionGroupParameters.setAppliesTo("Create Personnel");
    createQuestionGroupParameters.setTitle("Create Personnel QG2");
    createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
    questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateUserParameters userParameters = adminPage.getAdminUserParameters();
    ChooseOfficePage createUserPage = adminPage.navigateToCreateUserPage();
    createUserPage.verifyPage();
    CreateUserEnterDataPage userEnterDataPage = createUserPage.selectOffice("MyOfficeDHMFT");
    QuestionResponsePage questionResponsePage = userEnterDataPage.submitAndNavigateToQuestionResponsePage(userParameters);
    questionResponsePage.verifyPage();
    QuestionResponseParameters responseParameters = new QuestionResponseParameters();
    responseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "yes");
    responseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "text1");
    questionResponsePage.populateAnswers(responseParameters);
    CreateUserPreviewDataPage createUserPreviewDataPage = questionResponsePage.continueAndNavigateToCreateUserPreviewPage();
    questionResponsePage = createUserPreviewDataPage.navigateToEditAdditionalInformation();
    questionResponsePage.populateTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "text2");
    createUserPreviewDataPage = questionResponsePage.continueAndNavigateToCreateUserPreviewPage();
    CreateUserConfirmationPage userConfirmationPage = createUserPreviewDataPage.submit();
    QuestionnairePage questionnairePage = userConfirmationPage.navigateToUserViewDetailsPage().navigateToQuestionnairePage();
    //Then
    questionnairePage.verifyRadioGroup("details[0].sectionDetails[0].questions[0].value", "yes", true);
    questionnairePage.verifyRadioGroup("details[0].sectionDetails[1].questions[0].value", "good", false);
    questionnairePage.verifyField("details[0].sectionDetails[1].questions[1].value", "text2");
    //When
    questionnairePage.typeText("details[0].sectionDetails[1].questions[1].value", "text3");
    questionnairePage.submitAndNavigateToPersonnalDetailsPage();
    List<String> questionToAdd = new ArrayList<String>();
    questionToAdd.add("user question 5");
    questionToAdd.add("user question 6");
    List<String> questionToDesactivate = new ArrayList<String>();
    questionToDesactivate.add("user question 1");
    questionToDesactivate.add("user question 2");
    questionToDesactivate.add("user question 3");
    createQuestionGroupParameters = new CreateQuestionGroupParameters();
    for (String question : questionToAdd) {
        createQuestionGroupParameters.addExistingQuestion("Sec 1", question);
    }
    questionGroupTestHelper.addQuestionsToQuestionGroup("Create Personnel QG1", createQuestionGroupParameters.getExistingQuestions());
    for (String question : questionToDesactivate) {
        questionGroupTestHelper.markQuestionAsInactive(question);
    }
    questionGroupTestHelper.markQuestionGroupAsInactive("Create Personnel QG2");
    adminPage = navigationHelper.navigateToAdminPage();
    userParameters = adminPage.getAdminUserParameters();
    createUserPage = adminPage.navigateToCreateUserPage();
    createUserPage.verifyPage();
    userEnterDataPage = createUserPage.selectOffice("MyOfficeDHMFT");
    questionResponsePage = userEnterDataPage.submitAndNavigateToQuestionResponsePage(userParameters);
    questionResponsePage.verifyPage();
    //Then
    questionResponsePage.verifyQuestionsDoesnotappear(questionToDesactivate.toArray(new String[questionToDesactivate.size()]));
    questionResponsePage.verifyQuestionsExists(questionToAdd.toArray(new String[questionToAdd.size()]));
    questionResponsePage.verifySectionDoesnotappear("Sec 2");
    questionGroupTestHelper.markQuestionGroupAsInactive("Create Personnel QG1");
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) CreateUserEnterDataPage(org.mifos.test.acceptance.framework.user.CreateUserEnterDataPage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) CreateUserConfirmationPage(org.mifos.test.acceptance.framework.user.CreateUserConfirmationPage) ChooseOfficePage(org.mifos.test.acceptance.framework.office.ChooseOfficePage) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateUserPreviewDataPage(org.mifos.test.acceptance.framework.user.CreateUserPreviewDataPage) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) ArrayList(java.util.ArrayList) List(java.util.List)

Example 10 with CreateUserParameters

use of org.mifos.test.acceptance.framework.user.CreateUserParameters in project head by mifos.

the class AdminPage method getAdminUserParameters.

public CreateUserParameters getAdminUserParameters() {
    CreateUserParameters formParameters = new CreateUserParameters();
    formParameters.setFirstName("New");
    formParameters.setLastName("User" + StringUtil.getRandomString(8));
    formParameters.setDateOfBirthDD("21");
    formParameters.setDateOfBirthMM("11");
    formParameters.setDateOfBirthYYYY("1980");
    formParameters.setGender(CreateUserParameters.MALE);
    //        Integer preferredSupportedLocale = 1;
    //        formParameters.setPreferredLanguage(preferredSupportedLocale);
    formParameters.setUserLevel(CreateUserParameters.LOAN_OFFICER);
    formParameters.setRole("Admin");
    formParameters.setUserName("loanofficer_blore" + StringUtil.getRandomString(3));
    formParameters.setPassword("password");
    formParameters.setPasswordRepeat("password");
    return formParameters;
}
Also used : CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters)

Aggregations

CreateUserParameters (org.mifos.test.acceptance.framework.user.CreateUserParameters)11 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)7 Test (org.testng.annotations.Test)4 HomePage (org.mifos.test.acceptance.framework.HomePage)3 LoginPage (org.mifos.test.acceptance.framework.login.LoginPage)3 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)2 ChooseOfficePage (org.mifos.test.acceptance.framework.office.ChooseOfficePage)2 UserHelper (org.mifos.test.acceptance.framework.testhelpers.UserHelper)2 CreateUserConfirmationPage (org.mifos.test.acceptance.framework.user.CreateUserConfirmationPage)2 CreateUserEnterDataPage (org.mifos.test.acceptance.framework.user.CreateUserEnterDataPage)2 CreateUserPreviewDataPage (org.mifos.test.acceptance.framework.user.CreateUserPreviewDataPage)2 EditUserDataPage (org.mifos.test.acceptance.framework.user.EditUserDataPage)2 EditUserPreviewDataPage (org.mifos.test.acceptance.framework.user.EditUserPreviewDataPage)2 UserViewDetailsPage (org.mifos.test.acceptance.framework.user.UserViewDetailsPage)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 MifosPage (org.mifos.test.acceptance.framework.MifosPage)1 ViewSystemUsersPage (org.mifos.test.acceptance.framework.admin.ViewSystemUsersPage)1 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1