Search in sources :

Example 6 with UserVO

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");
}
Also used : UserVO(org.olat.user.restapi.UserVO) UserAdminPage(org.olat.selenium.page.user.UserAdminPage) ImportUserPage(org.olat.selenium.page.user.ImportUserPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 7 with UserVO

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);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) UserPasswordPage(org.olat.selenium.page.user.UserPasswordPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 8 with UserVO

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;
}
Also used : UserVO(org.olat.user.restapi.UserVO) By(org.openqa.selenium.By) WebElement(org.openqa.selenium.WebElement)

Example 9 with UserVO

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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) GroupPage(org.olat.selenium.page.group.GroupPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 10 with UserVO

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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) GroupPage(org.olat.selenium.page.group.GroupPage) CalendarPage(org.olat.selenium.page.core.CalendarPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

UserVO (org.olat.user.restapi.UserVO)364 Test (org.junit.Test)332 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)260 UserRestClient (org.olat.test.rest.UserRestClient)258 LoginPage (org.olat.selenium.page.LoginPage)114 NavigationPage (org.olat.selenium.page.NavigationPage)110 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)102 QTI21Page (org.olat.selenium.page.qti.QTI21Page)96 URL (java.net.URL)90 File (java.io.File)88 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)84 URI (java.net.URI)72 HttpResponse (org.apache.http.HttpResponse)72 Identity (org.olat.core.id.Identity)72 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)64 WebElement (org.openqa.selenium.WebElement)48 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)46 HttpGet (org.apache.http.client.methods.HttpGet)40 MembersPage (org.olat.selenium.page.course.MembersPage)36 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)34