use of org.olat.user.restapi.UserVO in project OpenOLAT by OpenOLAT.
the class UserTest method importExistingUsers.
/**
* Import 1 new user and 1 existing, change the password and the last name
* of the existing user.
*
* @param loginPage
* @param existingUserBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void importExistingUsers(@InitialPage LoginPage loginPage, @Drone @User WebDriver existingUserBrowser, @Drone @Student WebDriver newUserBrowser) throws IOException, URISyntaxException {
UserVO user1 = new UserRestClient(deploymentUrl).createRandomUser("tsukune");
// login
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
UserAdminPage userAdminPage = navBar.openUserManagement().openImportUsers();
// start import wizard
ImportUserPage importWizard = userAdminPage.startImport();
String uuid = UUID.randomUUID().toString();
String username1 = "moka-" + uuid;
StringBuilder csv = new StringBuilder();
UserVO newUser = importWizard.append(username1, "rosario02", "Moka", "Akashiya", csv);
user1 = importWizard.append(user1, "Aono", "openolat2", csv);
importWizard.fill(csv.toString()).nextData().assertGreen(1).assertWarn(1).updatePasswords().updateUsers().nextOverview().nextGroups().finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
// existing user log in with its new password and check if its name was updated
LoginPage userLoginPage = LoginPage.getLoginPage(existingUserBrowser, deploymentUrl);
// tools
userLoginPage.loginAs(user1.getLogin(), "openolat2").resume().assertLoggedInByLastName("Aono");
// new user log in
LoginPage newLoginPage = LoginPage.getLoginPage(newUserBrowser, deploymentUrl);
// tools
newLoginPage.loginAs(newUser.getLogin(), "rosario02").resume().assertLoggedInByLastName("Akashiya");
}
use of org.olat.user.restapi.UserVO in project OpenOLAT by OpenOLAT.
the class UserTest method userChangeItsPassword.
/**
* Change the password, log out and try to log in again
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void userChangeItsPassword(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
loginPage.loginAs(user.getLogin(), user.getPassword()).resume();
UserToolsPage userTools = new UserToolsPage(browser);
userTools.openUserToolsMenu().openPassword();
String newPassword = UUID.randomUUID().toString();
UserPasswordPage password = UserPasswordPage.getUserPasswordPage(browser);
password.setNewPassword(user.getPassword(), newPassword);
userTools.logout();
loginPage.loginAs(user.getLogin(), newPassword).resume().assertLoggedIn(user);
}
use of org.olat.user.restapi.UserVO in project OpenOLAT by OpenOLAT.
the class MembersWizardPage method setMembers.
public MembersWizardPage setMembers(UserVO... users) {
StringBuilder sb = new StringBuilder();
for (UserVO user : users) {
if (sb.length() > 0)
sb.append("\\n");
sb.append(user.getLogin());
}
By importAreaBy = By.cssSelector(".modal-content textarea");
WebElement importAreaEl = browser.findElement(importAreaBy);
OOGraphene.textarea(importAreaEl, sb.toString(), browser);
return this;
}
use of org.olat.user.restapi.UserVO in project OpenOLAT by OpenOLAT.
the class BusinessGroupTest method createGroupWithWaitingList.
/**
* An author creates a group, it opens the tab groups and then "My groups". It
* creates a group, enters a number of participants "1", enable the waiting
* list. In members visibility, it see coaches, participants and waiting
* list visible to members.<br>
* A participant and than a student come, book the group. The first enters
* the group, the second the waiting list.<br>
* The author go in the members list to check if it's in the coach list,
* the participant in the participants list and the student in the waiting
* list.
*
* Should show group starting page, with menu items Administration and Bookings visible
*
* @param loginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createGroupWithWaitingList(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantBrowser, @Drone @Student WebDriver studentBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createRandomUser("Selena");
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
UserVO student = new UserRestClient(deploymentUrl).createRandomUser("Asuka");
loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
// go to groups
String groupName = "Group-1-" + UUID.randomUUID();
GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A group with a waiting list").openAdministration().openEditDetails().setMaxNumberOfParticipants(1).setWaitingList().saveDetails();
// add booking ( token one )
String token = "secret";
String description = "The password is secret";
group.openBookingConfig().openAddDropMenu().addTokenMethod().configureTokenMethod(token, description).assertOnToken(token);
// members see members
group = GroupPage.getGroup(browser).openAdminMembers().setVisibility(true, true, true).openMembers();
// participant search published groups
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
// tools
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
// groups
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openGroups(participantBrowser).publishedGroups().bookGroup(groupName).bookToken(token);
// are we that we are in the right group?
GroupPage.getGroup(participantBrowser).assertOnInfosPage(groupName);
// student search published groups
LoginPage studentLoginPage = LoginPage.getLoginPage(studentBrowser, deploymentUrl);
// tools
studentLoginPage.loginAs(student.getLogin(), student.getPassword()).resume();
// groups
NavigationPage studentNavBar = new NavigationPage(studentBrowser);
studentNavBar.openGroups(studentBrowser).publishedGroups().bookGroup(groupName).bookToken(token);
// are we that we are in the right group?
GroupPage.getGroup(studentBrowser).assertOnWaitingList(groupName);
group = GroupPage.getGroup(browser).openMembers().assertMembersInOwnerList(author).assertMembersInParticipantList(participant).assertMembersInWaitingList(student);
}
use of org.olat.user.restapi.UserVO in project OpenOLAT by OpenOLAT.
the class BusinessGroupTest method groupCalendar_recurringEvent.
/**
* A coach create a group, enable the calendar, create a recurring event
* and save it. Reopen it, edit it and save it, confirm that it will
* only change a single occurence of the recurring event. After change
* the begin and end hour of all others events.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void groupCalendar_recurringEvent(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO coach = new UserRestClient(deploymentUrl).createAuthor();
loginPage.loginAs(coach.getLogin(), coach.getPassword()).resume();
// go to groups
String groupName = "iCal-2-" + UUID.randomUUID();
GroupPage group = navBar.openGroups(browser).createGroup(groupName, "Calendar with a recurring event");
group.openAdministration().openAdminTools().enableCalendarTool();
int startdDate = 2;
// add an event to the calendar
CalendarPage calendar = group.openCalendar().assertOnCalendar().addEvent(startdDate).setDescription("Recurring", "Very important event 4-5 times", "In the way").setAllDay(false).setBeginEnd(10, 11).setRecurringEvent(KalendarEvent.WEEKLY, 28).save().assertOnEvents("Recurring", 4);
// pick an occurence of the recurring event and modify it
calendar.openDetailsOccurence("Recurring", 9).edit().setDescription("Special", null, null).save().confirmModifyOneOccurence().assertOnEvents("Special", 1).assertOnEvents("Recurring", 3);
// pick the first occurence and change all events but the modified above
calendar.openDetailsOccurence("Recurring", 2).edit().setBeginEnd(11, 12).assertOnEvents("Special", 1).save().confirmModifyAllOccurences().assertOnEventsAt("Recurring", 3, 11);
}
Aggregations