use of org.mifos.test.acceptance.framework.testhelpers.UserHelper 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.testhelpers.UserHelper in project head by mifos.
the class PersonnelTest method setUp.
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
super.setUp();
navigationHelper = new NavigationHelper(selenium);
userHelper = new UserHelper(selenium);
questionGroupTestHelper = new QuestionGroupTestHelper(selenium);
}
use of org.mifos.test.acceptance.framework.testhelpers.UserHelper in project head by mifos.
the class CreateMultipleLoanAccountTest method setUp.
@Override
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
officeHelper = new OfficeHelper(selenium);
userHelper = new UserHelper(selenium);
centerTestHelper = new CenterTestHelper(selenium);
navigationHelper = new NavigationHelper(selenium);
loanProductTestHelper = new LoanProductTestHelper(selenium);
}
use of org.mifos.test.acceptance.framework.testhelpers.UserHelper in project head by mifos.
the class TestDataSetup method createUser.
public void createUser(String userLoginName, String userName, String officeName) throws SQLException {
String firstName = userName.split(" ")[0];
String lastName = userName.split(" ")[1];
if (applicationDatabaseOperation.doesSystemUserExist(userLoginName, userName, officeName)) {
return;
}
CreateUserParameters userParameters = new AdminPage(selenium).getAdminUserParameters();
userParameters.setUserName(userLoginName);
userParameters.setFirstName(firstName);
userParameters.setLastName(lastName);
new UserHelper(selenium).createUser(userParameters, officeName);
}
Aggregations