Search in sources :

Example 61 with CourseEditorPageFragment

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

the class CourseElementTest method createCourseWithParticipantFolder.

/**
 * An author create a course with a participant folder course
 * element. It add a participant to the course and upload file
 * in the return box of this participant.<br>
 * The participant come in and open the course, see the file
 * uploaded by the author in its return box and it uploads an
 * image in its drop box. The author go the see the image.
 *
 * @param authorLoginPage
 * @param participantBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourseWithParticipantFolder(@InitialPage LoginPage authorLoginPage, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Course partilist " + UUID.randomUUID();
    // create course
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    String participantFolderTitle = "ParticipantList";
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit().createNode("pf").nodeTitle(participantFolderTitle);
    // publish
    editor.publish().quickPublish(UserAccess.membersOnly);
    editor.clickToolbarBack();
    // add a participant
    MembersPage members = new CoursePageFragment(browser).members();
    members.addMember().searchMember(participant, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, false, true).nextPermissions().finish();
    members.clickToolbarBack();
    // go to the course element
    course.clickTree().selectWithTitle(participantFolderTitle);
    // open the return box of the participant and upload a file
    URL coachImageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
    File coachImageFile = new File(coachImageUrl.toURI());
    ParticipantFolderPage folder = new ParticipantFolderPage(browser);
    folder.assertOnParticipantsList().assertOnParticipant(participant.getFirstName()).openParticipantFolder(participant.getFirstName());
    FolderPage directory = folder.openReturnBox().uploadFile(coachImageFile).assertOnFile(coachImageFile.getName());
    // The participant come in
    LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
    participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
    // The participant find the course
    NavigationPage participantNavBar = new NavigationPage(participantBrowser);
    participantNavBar.assertOnNavigationPage().openMyCourses().select(title);
    // And opens the participant folder
    CoursePageFragment participantCourse = CoursePageFragment.getCourse(participantBrowser);
    participantCourse.clickTree().selectWithTitle(participantFolderTitle);
    ParticipantFolderPage participantFolder = new ParticipantFolderPage(participantBrowser);
    participantFolder.openReturnBox().assertOnFile(coachImageFile.getName()).selectRootDirectory();
    // Participant upload a file in its drop box
    URL participantImageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
    File participantImageFile = new File(participantImageUrl.toURI());
    participantFolder.openDropBox().uploadFile(participantImageFile).assertOnFile(participantImageFile.getName());
    // Author check the image in the participant drop box
    directory.selectRootDirectory();
    folder.openDropBox().assertOnFile(participantImageFile.getName());
}
Also used : CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) FolderPage(org.olat.selenium.page.core.FolderPage) ParticipantFolderPage(org.olat.selenium.page.course.ParticipantFolderPage) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) NavigationPage(org.olat.selenium.page.NavigationPage) ParticipantFolderPage(org.olat.selenium.page.course.ParticipantFolderPage) MembersPage(org.olat.selenium.page.course.MembersPage) File(java.io.File) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 62 with CourseEditorPageFragment

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

the class CourseElementTest method createCourseWithWiki.

/**
 * Create a course, create a wiki, go the the course editor,
 * create a course element of type wiki, select the wiki which just created,
 * close the course editor and select the index page of the wiki.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourseWithWiki(@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-Wiki-" + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // go the authoring environment to create a CP
    String wikiTitle = "Wiki for a course - " + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createWiki(wikiTitle).assertOnGeneralTab();
    navBar.openCourse(courseTitle);
    String wikiNodeTitle = "Wiki-1";
    // create a course element of type CP with the CP that we create above
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("wiki").nodeTitle(wikiNodeTitle).selectTabLearnContent().chooseWiki(wikiTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the CP
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(wikiNodeTitle).selectWithTitle("Index");
    // check that the title of the index article/page is visible
    WebElement indexArticleTitle = browser.findElement(By.className("o_wikimod_heading"));
    Assert.assertEquals("Index", indexArticleTitle.getText().trim());
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) WebElement(org.openqa.selenium.WebElement) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 63 with CourseEditorPageFragment

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

the class CourseElementTest method createCourseWithPodcast_externalFeed.

/**
 * Create a course with a course element of type podcast. Create
 * a podcast, publish the course, go the the course and configure
 * the podcast to read an external feed.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourseWithPodcast_externalFeed(@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-Podcast-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String podcastNodeTitle = "Podcats-1";
    String podcastTitle = "Podcast - " + UUID.randomUUID();
    // create a course element of type podcast
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("podcast").nodeTitle(podcastNodeTitle).selectTabLearnContent().createFeed(podcastTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the podcast
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(podcastNodeTitle);
    // check that the title of the podcast is correct
    WebElement podcastH2 = browser.findElement(By.cssSelector("div.o_podcast_info>h2>i.o_FileResource-PODCAST_icon"));
    Assert.assertNotNull(podcastH2);
    // Assert.assertEquals(podcastTitle, podcastH2.getText().trim());
    FeedPage feed = FeedPage.getFeedPage(browser);
    feed.newExternalPodcast(podcastTitle, "http://podcasts.srf.ch/rock_special_mpx.xml");
// check only that the "episodes" title is visible
/*
		By episodeTitleby = By.cssSelector("div.o_podcast_episodes>h4.o_title");
		OOGraphene.waitElement(episodeTitleby, 20, browser);
		WebElement episodeH4 = browser.findElement(episodeTitleby);
		Assert.assertNotNull(episodeH4);
		*/
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) FeedPage(org.olat.selenium.page.repository.FeedPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) WebElement(org.openqa.selenium.WebElement) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 64 with CourseEditorPageFragment

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

the class PortfolioV2Test method binderAssessment.

/**
 * This is a long test. It's test the whole process to assess a binder from
 * the template create by the author, to the assessment value saved in the
 * assessment tool of the course.<br>
 * The author creates a portfolio template with 2 sections and 2 assignments,
 * it creates a course with a portfolio element and bind the template to it. It
 * add a user as participant.<br>
 * The participant starts the course, pick the binder and do every assignment.
 * It edits the sharing settings to add the author as a coach.<br>
 * The author assesses the sections and set the binder as done. Than it goes
 * to the course, opens the assessment tool and check the participant passed
 * the binder.
 *
 * @param loginPage
 * @param reiBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void binderAssessment(@InitialPage LoginPage loginPage, @Drone @User WebDriver reiBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("rei");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    String binderTitle = "Binder to assess " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createPortfolioBinder(binderTitle).clickToolbarBack();
    // create a binder template with 2 sections and
    // an assignment in each
    String section1Title = "Section 1 " + UUID.randomUUID();
    String assignment1Title = "Assignment 1 " + UUID.randomUUID();
    String section2Title = "Section 2 " + UUID.randomUUID();
    String assignment2Title = "Assignment 2 " + UUID.randomUUID();
    BinderPage binderTemplate = new BinderPage(browser);
    binderTemplate.assertOnBinder().selectTableOfContent().deleteSection().selectEntries().createSectionInEntries(section1Title).createAssignmentForSection(section1Title, assignment1Title, "Write a small summary", "Your task is...").assertOnAssignmentInEntries(assignment1Title).createSection(section2Title).createAssignmentForSection(section2Title, assignment2Title, "Second part to do", "you have to work").assertOnAssignmentInEntries(assignment2Title);
    // create a course
    String courseTitle = "ASPF Course " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String portfolioNodeTitle = "Template-ASPF-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);
    // configure the assessment
    AssessmentCEConfigurationPage assessmentConfig = new AssessmentCEConfigurationPage(browser);
    assessmentConfig.selectConfiguration().setScoreAuto(0.0f, 10.0f, 5.0f);
    courseEditor.publish().quickPublish(UserAccess.membersOnly);
    MembersPage membersPage = courseEditor.clickToolbarBack().members();
    membersPage.importMembers().setMembers(rei).nextUsers().nextOverview().nextPermissions().finish();
    // Participant log in
    LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
    reiLoginPage.loginAs(rei).resume();
    // open the course
    NavigationPage reiNavBar = new NavigationPage(reiBrowser);
    reiNavBar.openMyCourses().select(courseTitle);
    // go to the portfolio course element
    CoursePageFragment reiTestCourse = new CoursePageFragment(reiBrowser);
    reiTestCourse.clickTree().selectWithTitle(portfolioNodeTitle);
    PortfolioElementPage portfolioCourseEl = new PortfolioElementPage(reiBrowser);
    BinderPage reiBinder = portfolioCourseEl.pickPortfolio().goToPortfolioV2();
    OOGraphene.waitAndCloseBlueMessageWindow(reiBrowser);
    reiBinder.selectEntries().pickAssignment(assignment1Title).publishEntry();
    reiBinder.selectEntries().pickAssignment(assignment2Title).publishEntry();
    // add the author as coach
    reiBinder.selectPublish().openAccessMenu().addMember().searchMember(author, false).nextUsers().nextOverview().fillAccessRights(binderTitle, Boolean.TRUE).nextPermissions().deSelectEmail().finish();
    // the author come to see the binder
    UserToolsPage userTools = new UserToolsPage(browser);
    PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
    portfolio.openSharedWithMe().openSharedBindersWithMe().assertOnBinder(binderTitle).selectBinder(binderTitle).selectAssessment().passed(section1Title).save().close(section1Title).passed(section2Title).save().close(section2Title).done().assertPassed(2);
    // than go to the course and check the results in the assessment tool
    // author take the lead and check the assessment tool
    navBar.openMyCourses().select(courseTitle);
    // open the assessment tool
    AssessmentToolPage assessmentTool = new CoursePageFragment(browser).assessmentTool();
    // check that rei has passed the test
    assessmentTool.users().assertOnUsers(rei).selectUser(rei).assertPassed(rei);
}
Also used : AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) 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) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) MembersPage(org.olat.selenium.page.course.MembersPage) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 65 with CourseEditorPageFragment

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

the class PortfolioV2Test method collectEfficiencyStatement.

/**
 * Create a course with an assessment course element, setup
 * efficiency statement, add a user and assess her.
 * The user log in, search its efficiency statement, pick it
 * as a media for is portfolio and goes in the media center
 * to search it and select it.
 *
 * @param authorLoginPage
 * @param ryomouBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectEfficiencyStatement(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Course-Assessment-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a course element of type Test with the test that we create above
    String assessmentNodeTitle = "Efficiency PF";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit().createNode("ms").nodeTitle(assessmentNodeTitle);
    // configure assessment
    AssessmentCEConfigurationPage assessmentConfig = new AssessmentCEConfigurationPage(browser);
    assessmentConfig.selectConfiguration().setScoreAuto(1.0f, 6.0f, 4.0f);
    // set the score / passed calculation in root node and publish
    courseEditor.selectRoot().selectTabScore().enableRootScoreByNodes().autoPublish().accessConfiguration().setUserAccess(UserAccess.registred);
    // go to members management
    CoursePageFragment courseRuntime = courseEditor.clickToolbarBack();
    MembersPage members = courseRuntime.members();
    members.addMember().searchMember(ryomou, true).nextUsers().nextOverview().nextPermissions().finish();
    // efficiency statement is default on
    // go to the assessment to to set the points
    members.clickToolbarBack().assessmentTool().users().assertOnUsers(ryomou).selectUser(ryomou).selectCourseNode(assessmentNodeTitle).setAssessmentScore(4.5f).assertUserPassedCourseNode(assessmentNodeTitle);
    // Ryomou login
    LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
    ryomouLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword()).resume();
    // see its beautiful efficiency statement
    String mediaTitle = "My efficiency";
    String mediaDesc = "My efficiency statement " + UUID.randomUUID();
    UserToolsPage ryomouUserTools = new UserToolsPage(ryomouBrowser);
    ryomouUserTools.openUserToolsMenu().openMyEfficiencyStatement().assertOnEfficiencyStatmentPage().assertOnStatement(courseTitle, true).addAsMediaInList(courseTitle).fillEfficiencyStatementMedia(mediaTitle, mediaDesc);
    MediaCenterPage mediaCenter = ryomouUserTools.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) AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) MediaCenterPage(org.olat.selenium.page.portfolio.MediaCenterPage) LoginPage(org.olat.selenium.page.LoginPage) 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)86 Test (org.junit.Test)86 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)86 UserRestClient (org.olat.test.rest.UserRestClient)84 UserVO (org.olat.user.restapi.UserVO)84 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)80 NavigationPage (org.olat.selenium.page.NavigationPage)44 LoginPage (org.olat.selenium.page.LoginPage)40 MembersPage (org.olat.selenium.page.course.MembersPage)30 WebElement (org.openqa.selenium.WebElement)30 URL (java.net.URL)24 File (java.io.File)22 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)16 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)14 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)10 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)10 By (org.openqa.selenium.By)10 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)8 EnrollmentPage (org.olat.selenium.page.course.EnrollmentPage)8 GroupPage (org.olat.selenium.page.group.GroupPage)8