Search in sources :

Example 6 with CalendarPage

use of org.olat.selenium.page.core.CalendarPage in project OpenOLAT by OpenOLAT.

the class BusinessGroupTest method groupCalendar_addEditEvent.

/**
 * A coach create a group, enable the calendar, create an event
 * and save it. Reopen it, edit it and save it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void groupCalendar_addEditEvent(@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-1-" + UUID.randomUUID();
    GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A very little group to delete");
    group.openAdministration().openAdminTools().enableCalendarTool();
    // add an event to the calendar
    CalendarPage calendar = group.openCalendar().assertOnCalendar().addEvent(2).setDescription("Hello", "Very important event", "here or there").save().assertOnEvent("Hello");
    // edit the event
    calendar.openDetails("Hello").edit().setDescription("Bye", null, null).save();
    // check the changes
    calendar.assertOnEvent("Bye");
}
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)

Example 7 with CalendarPage

use of org.olat.selenium.page.core.CalendarPage in project OpenOLAT by OpenOLAT.

the class CourseTest method createCourseWithCalendar.

/**
 * Create a course with a calendar element, add a recurring event
 * all day, modify an occurence to an event between 13h and 15h.
 * Remove an other single occurence and at the end, remove all remaining
 * events by removing the original event and confirm that
 * all must be deleted.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourseWithCalendar(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Course-With-iCal-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    navBar.openCourse(courseTitle);
    String calendarNodeTitle = "iCal-1";
    // create a course element of type calendar
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("cal").nodeTitle(calendarNodeTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the calendar
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(calendarNodeTitle);
    // create a recurring event
    CalendarPage calendar = new CalendarPage(browser);
    calendar.addEvent(3).setDescription("Eventhor", "Hammer", "Asgard").setAllDay(true).setRecurringEvent(KalendarEvent.WEEKLY, 28).save();
    // modify an occurence
    calendar.openDetailsOccurence("Eventhor", 17).edit().setAllDay(false).setBeginEnd(13, 15).save().confirmModifyOneOccurence();
    // check
    calendar.assertOnEvents("Eventhor", 4).assertOnEventsAt("Eventhor", 1, 13);
    // modify all events
    calendar.openDetailsOccurence("Eventhor", 3).edit().setDescription("Eventoki", null, null).save().confirmModifyAllOccurences();
    // check
    calendar.assertOnEvents("Eventoki", 3).assertOnEventsAt("Eventhor", 1, 13);
    // delete an occurence
    calendar.openDetailsOccurence("Eventoki", 10).edit().delete().confirmDeleteOneOccurence();
    // check
    calendar.assertOnEvents("Eventoki", 2).assertOnEventsAt("Eventhor", 1, 13);
    // delete all
    calendar.openDetailsOccurence("Eventoki", 3).edit().delete().confirmDeleteAllOccurences();
    OOGraphene.waitingALittleBit();
    calendar.assertZeroEvent();
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) 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)

Example 8 with CalendarPage

use of org.olat.selenium.page.core.CalendarPage in project openolat by klemens.

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

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)8 Test (org.junit.Test)8 CalendarPage (org.olat.selenium.page.core.CalendarPage)8 UserRestClient (org.olat.test.rest.UserRestClient)8 UserVO (org.olat.user.restapi.UserVO)8 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)4 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)4 GroupPage (org.olat.selenium.page.group.GroupPage)4