Search in sources :

Example 26 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.

the class LecturesTest method lecturesRollCall_defaultAuthorizedAbsence.

/**
 * An author create a course, enable the absence management,
 * create a lecture block, add a coach and two participants.<br>
 * The coach login in, see the interceptor to start the roll call.
 * It starts the roll call, set an absence and close.<br>
 * The participant with an absence log in, use the lectures user's
 * tool to see that it has an absence.<br>
 * The absence management has the following settings: holding partial
 * lecture is disable, cancel status of lectures is disabled, authorized
 * absence are enabled with them as default authorized, teachers can
 * authorized absences.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void lecturesRollCall_defaultAuthorizedAbsence(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    // configure the lectures module
    loginPage.loginAs("administrator", "openolat").resume();
    new NavigationPage(browser).openAdministration().openLecturesSettings().configure(false, false, true, true, true).save();
    // start the test with authorized absence on
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO participant1 = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO participant2 = new UserRestClient(deploymentUrl).createRandomUser("Rymou");
    LoginPage.getLoginPage(browser, deploymentUrl).loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Lecture " + UUID.randomUUID();
    // create course
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // set access
    CoursePageFragment course = new CoursePageFragment(browser);
    course.accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
    // add a coach
    course.members().addMember().searchMember(author, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, true, false).nextPermissions().finish();
    // add the participants
    course.members().importMembers().setMembers(participant1, participant2).nextUsers().nextOverview().nextPermissions().finish();
    // enable the lectures
    LectureRepositoryAdminPage lecturesAdmin = course.lecturesAdministration();
    lecturesAdmin.settings().enableLectures().overrideDefaultSettings().saveSettings();
    LectureRepositoryAdminListPage lectureList = lecturesAdmin.lectureList();
    Calendar cal = Calendar.getInstance();
    int today = cal.get(Calendar.DATE);
    int hour = cal.get(Calendar.HOUR_OF_DAY);
    String lectureTitle = "1. Lecture";
    lectureList.newLectureBlock().setTitle(lectureTitle).setTeacher(author).setDate(today, hour, 0, hour, 59).save();
    // coach at work
    LoginPage coachLoginPage = LoginPage.getLoginPage(browser, deploymentUrl);
    coachLoginPage.loginAs(author);
    new RollCallInterceptorPage(browser).start().setAbsence(participant1, "1").closeRollCall().confirmCloseRollCall().assertOnClosedTable();
    // participant check it roll call
    LoginPage participantLoginPage = LoginPage.getLoginPage(browser, deploymentUrl);
    participantLoginPage.loginAs(participant1).resume();
    UserToolsPage participantUserTools = new UserToolsPage(browser);
    participantUserTools.openUserToolsMenu().openLectures().assertOnParticipantLecturesList().selectCourseAsParticipant(title).assertOnParticipantLectureBlocks().assertOnParticipantLectureBlockAuthorised(author, lectureTitle, title);
}
Also used : RollCallInterceptorPage(org.olat.selenium.page.lecture.RollCallInterceptorPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) Calendar(java.util.Calendar) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) LectureRepositoryAdminPage(org.olat.selenium.page.lecture.LectureRepositoryAdminPage) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) NavigationPage(org.olat.selenium.page.NavigationPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) LectureRepositoryAdminListPage(org.olat.selenium.page.lecture.LectureRepositoryAdminListPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 27 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.

the class PortfolioV2Test method createTemplate.

/**
 * Create a portfolio, a course with a portoflio course element,
 * publish it, ad a participant. The participant log in, search
 * the course and pick the portfolio.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createTemplate(@InitialPage LoginPage loginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("ryomou");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    String binderTitle = "PF-Binder-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createPortfolioBinder(binderTitle).clickToolbarBack();
    String sectionTitle = "Section 1 " + UUID.randomUUID();
    String assignmentTitle = "Assignment 1 " + UUID.randomUUID();
    BinderPage portfolio = new BinderPage(browser);
    portfolio.assertOnBinder().selectEntries().createSectionInEntries(sectionTitle).createAssignmentForSection(sectionTitle, assignmentTitle, "Write a small summary", "Your task is...").assertOnAssignmentInEntries(assignmentTitle);
    String courseTitle = "PF Course " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String portfolioNodeTitle = "Template-EP-v2";
    // create a course element of type portfolio and choose the one we created above
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("ep").nodeTitle(portfolioNodeTitle).selectTabLearnContent().choosePortfolio(binderTitle).publish().quickPublish(UserAccess.membersOnly);
    MembersPage membersPage = courseEditor.clickToolbarBack().members();
    membersPage.importMembers().setMembers(ryomou).nextUsers().nextOverview().nextPermissions().finish();
    // Participant log in
    LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
    ryomouLoginPage.loginAs(ryomou).resume();
    // open the course
    NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
    ryomouNavBar.openMyCourses().select(courseTitle);
    // go to the portfolio course element
    CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
    ryomouTestCourse.clickTree().selectWithTitle(portfolioNodeTitle);
    PortfolioElementPage portfolioCourseEl = new PortfolioElementPage(ryomouBrowser);
    BinderPage binder = portfolioCourseEl.pickPortfolio().goToPortfolioV2();
    binder.selectEntries().pickAssignment(assignmentTitle);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) PortfolioElementPage(org.olat.selenium.page.course.PortfolioElementPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 28 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.

the class PortfolioV2Test method collectForumMediaInCourse.

/**
 * Create a course with a forum, open a new thread and pick it as
 * a media. Go in the media center and check that the media
 * is waiting there, click the details and check again.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectForumMediaInCourse(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    String courseTitle = "Collect-Forum-" + UUID.randomUUID();
    String forumTitle = ("Forum-" + UUID.randomUUID()).substring(0, 24);
    // go to authoring, create a course with a forum
    navBar.openAuthoringEnvironment().openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(courseTitle).clickToolbarBack();
    // open course editor
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("fo").nodeTitle(forumTitle).publish().quickPublish();
    courseEditor.clickToolbarBack();
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    course.clickTree().selectWithTitle(forumTitle);
    String mediaTitle = "A post";
    String threadTitle = "Very interessant thread";
    ForumPage forum = ForumPage.getCourseForumPage(browser);
    forum.createThread(threadTitle, "With a lot of content", null).addAsMedia().fillForumMedia(mediaTitle, "A post I write");
    UserToolsPage userTools = new UserToolsPage(browser);
    MediaCenterPage mediaCenter = userTools.openUserToolsMenu().openPortfolioV2().openMediaCenter();
    mediaCenter.assertOnMedia(mediaTitle).selectMedia(mediaTitle).assertOnMediaDetails(mediaTitle);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) ForumPage(org.olat.selenium.page.forum.ForumPage) MediaCenterPage(org.olat.selenium.page.portfolio.MediaCenterPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 29 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.

the class LecturesRepositoryPage method clickToolbarRootCrumb.

/**
 * Click back to the course
 *
 * @return
 */
public CoursePageFragment clickToolbarRootCrumb() {
    OOGraphene.closeBlueMessageWindow(browser);
    By toolbarBackBy = By.xpath("//li[contains(@class,'o_breadcrumb_back')]/following-sibling::li/a");
    browser.findElement(toolbarBackBy).click();
    OOGraphene.waitBusy(browser);
    return new CoursePageFragment(browser);
}
Also used : By(org.openqa.selenium.By) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment)

Example 30 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.

the class AuthoringEnvPage method clickToolbarRootCrumb.

/**
 * Click back from the editor
 *
 * @return
 */
public CoursePageFragment clickToolbarRootCrumb() {
    OOGraphene.closeBlueMessageWindow(browser);
    By toolbarBackBy = By.xpath("//li[contains(@class,'o_breadcrumb_back')]/following-sibling::li/a");
    browser.findElement(toolbarBackBy).click();
    OOGraphene.waitBusy(browser);
    return new CoursePageFragment(browser);
}
Also used : By(org.openqa.selenium.By) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment)

Aggregations

CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)110 Test (org.junit.Test)104 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)102 UserRestClient (org.olat.test.rest.UserRestClient)102 UserVO (org.olat.user.restapi.UserVO)102 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)80 NavigationPage (org.olat.selenium.page.NavigationPage)56 LoginPage (org.olat.selenium.page.LoginPage)54 MembersPage (org.olat.selenium.page.course.MembersPage)34 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)30 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)30 WebElement (org.openqa.selenium.WebElement)30 URL (java.net.URL)24 File (java.io.File)22 By (org.openqa.selenium.By)14 Calendar (java.util.Calendar)10 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)8 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)8 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)8 EnrollmentPage (org.olat.selenium.page.course.EnrollmentPage)8