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