Search in sources :

Example 1 with MediaCenterPage

use of org.olat.selenium.page.portfolio.MediaCenterPage 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 2 with MediaCenterPage

use of org.olat.selenium.page.portfolio.MediaCenterPage in project openolat by klemens.

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)

Example 3 with MediaCenterPage

use of org.olat.selenium.page.portfolio.MediaCenterPage in project openolat by klemens.

the class PortfolioV2Test method collectWikiMediaInWikiResource.

/**
 * Create a wiki as resource, add and fill a page. The author
 * picks the page as media and go in its media center to see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectWikiMediaInWikiResource(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "PF-Wiki-" + UUID.randomUUID();
    // create a wiki and launch it
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.wiki).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // create a page in the wiki
    String page = "LMS-" + UUID.randomUUID();
    String content = "Learning Management System";
    WikiPage wiki = WikiPage.getWiki(browser);
    // create page and add it as artefact to portfolio
    String mediaTitle = "My own wiki page";
    wiki.createPage(page, content).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 : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) WikiPage(org.olat.selenium.page.wiki.WikiPage) 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 4 with MediaCenterPage

use of org.olat.selenium.page.portfolio.MediaCenterPage in project OpenOLAT by OpenOLAT.

the class PortfolioV2Test method collectWikiMediaInWikiResource.

/**
 * Create a wiki as resource, add and fill a page. The author
 * picks the page as media and go in its media center to see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectWikiMediaInWikiResource(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "PF-Wiki-" + UUID.randomUUID();
    // create a wiki and launch it
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.wiki).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // create a page in the wiki
    String page = "LMS-" + UUID.randomUUID();
    String content = "Learning Management System";
    WikiPage wiki = WikiPage.getWiki(browser);
    // create page and add it as artefact to portfolio
    String mediaTitle = "My own wiki page";
    wiki.createPage(page, content).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 : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) WikiPage(org.olat.selenium.page.wiki.WikiPage) 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 5 with MediaCenterPage

use of org.olat.selenium.page.portfolio.MediaCenterPage 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)8 Test (org.junit.Test)8 MediaCenterPage (org.olat.selenium.page.portfolio.MediaCenterPage)8 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)8 UserRestClient (org.olat.test.rest.UserRestClient)8 UserVO (org.olat.user.restapi.UserVO)8 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)6 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)6 LoginPage (org.olat.selenium.page.LoginPage)2 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)2 MembersPage (org.olat.selenium.page.course.MembersPage)2 ForumPage (org.olat.selenium.page.forum.ForumPage)2 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)2 FeedPage (org.olat.selenium.page.repository.FeedPage)2 WikiPage (org.olat.selenium.page.wiki.WikiPage)2