Search in sources :

Example 6 with FeedPage

use of org.olat.selenium.page.repository.FeedPage in project OpenOLAT by OpenOLAT.

the class PortfolioV2Test method collectBlogEntryMediaInBlogResource.

/**
 * Create a blog as learn resource, create a new entry and publish it.
 * Than pick the entry as a media and go to the media center to see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectBlogEntryMediaInBlogResource(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // create a course
    String courseTitle = "Course-With-Blog-" + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String blogNodeTitle = "Blog-EP-1";
    String blogTitle = "Blog - EP - " + UUID.randomUUID().toString();
    // create a course element of type blog with a blog
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("blog").nodeTitle(blogNodeTitle).selectTabLearnContent().createFeed(blogTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the CP
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(blogNodeTitle);
    String postTitle = "Post-EP-" + UUID.randomUUID();
    String postSummary = "Some explantations as teaser";
    String postContent = "Content of the post";
    FeedPage feed = FeedPage.getFeedPage(browser);
    feed.newBlog().fillPostForm(postTitle, postSummary, postContent).publishPost();
    String mediaTitle = "My very own entry";
    feed.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) FeedPage(org.olat.selenium.page.repository.FeedPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) 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 7 with FeedPage

use of org.olat.selenium.page.repository.FeedPage in project openolat by klemens.

the class PortfolioV2Test method collectBlogEntryMediaInBlogResource.

/**
 * Create a blog as learn resource, create a new entry and publish it.
 * Than pick the entry as a media and go to the media center to see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectBlogEntryMediaInBlogResource(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // create a course
    String courseTitle = "Course-With-Blog-" + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String blogNodeTitle = "Blog-EP-1";
    String blogTitle = "Blog - EP - " + UUID.randomUUID().toString();
    // create a course element of type blog with a blog
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("blog").nodeTitle(blogNodeTitle).selectTabLearnContent().createFeed(blogTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the CP
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(blogNodeTitle);
    String postTitle = "Post-EP-" + UUID.randomUUID();
    String postSummary = "Some explantations as teaser";
    String postContent = "Content of the post";
    FeedPage feed = FeedPage.getFeedPage(browser);
    feed.newBlog().fillPostForm(postTitle, postSummary, postContent).publishPost();
    String mediaTitle = "My very own entry";
    feed.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) FeedPage(org.olat.selenium.page.repository.FeedPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) 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 8 with FeedPage

use of org.olat.selenium.page.repository.FeedPage in project openolat by klemens.

the class CourseElementTest method blogWithMultipleUsers.

/**
 * An author create a course with a blog, open it, add a post. A student
 * open the course, see the blog post. The author add a new post, the
 * student must see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void blogWithMultipleUsers(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantDrone) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course with a blog
    String courseTitle = "Course-Blog-1-" + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String blogNodeTitle = "Blog-RW-1";
    String blogTitle = "Blog - RW - " + UUID.randomUUID().toString();
    // create a course element of type blog with a blog
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("blog").nodeTitle(blogNodeTitle).selectTabLearnContent().createFeed(blogTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the blog
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(blogNodeTitle);
    String postTitle = "Blog-RW-1-" + UUID.randomUUID();
    String postSummary = "Some explantations as teaser";
    String postContent = "Content of the post";
    FeedPage feed = FeedPage.getFeedPage(browser);
    feed.newBlog().fillPostForm(postTitle, postSummary, postContent).publishPost();
    // participant go to the blog
    participantDrone.navigate().to(deploymentUrl);
    LoginPage participantLogin = LoginPage.getLoginPage(participantDrone, deploymentUrl);
    participantLogin.loginAs(participant.getLogin(), participant.getPassword());
    // search the course in "My courses"
    NavigationPage participantNavigation = new NavigationPage(participantDrone);
    participantNavigation.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    // Navigate the course to the blog
    CoursePageFragment participantCourse = new CoursePageFragment(participantDrone);
    participantCourse.clickTree().selectWithTitle(blogNodeTitle);
    FeedPage participantFeed = FeedPage.getFeedPage(participantDrone);
    participantFeed.assertOnBlogPost(postTitle);
    // the author publish a second post in its blog
    String post2Title = "Blog-RW-2-" + UUID.randomUUID();
    String post2Summary = "Some explantations as teaser";
    String post2Content = "Content of the post";
    feed.addBlogPost().fillPostForm(post2Title, post2Summary, post2Content).publishPost();
    // the participant must see the new post after some click
    participantFeed.clickFirstMonthOfPager().assertOnBlogPost(post2Title);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) FeedPage(org.olat.selenium.page.repository.FeedPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) 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 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)8 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)8 FeedPage (org.olat.selenium.page.repository.FeedPage)8 UserRestClient (org.olat.test.rest.UserRestClient)8 UserVO (org.olat.user.restapi.UserVO)8 WebElement (org.openqa.selenium.WebElement)4 LoginPage (org.olat.selenium.page.LoginPage)2 NavigationPage (org.olat.selenium.page.NavigationPage)2 MediaCenterPage (org.olat.selenium.page.portfolio.MediaCenterPage)2 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)2