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);
}
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);
}
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);
}
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");
}
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;
}
Aggregations