Search in sources :

Example 6 with ForumPage

use of org.olat.selenium.page.forum.ForumPage in project OpenOLAT by OpenOLAT.

the class DialogPage method openForum.

public ForumPage openForum(String filename) {
    By openForumBy = By.xpath("//table//tr[td/a[contains(text(),'" + filename + "')]]/td/a[contains(@href,'forum')]");
    browser.findElement(openForumBy).click();
    OOGraphene.waitBusy(browser);
    By forumBy = By.cssSelector("div.o_sel_dialog div.o_sel_forum");
    OOGraphene.waitElement(forumBy, browser);
    return new ForumPage(browser);
}
Also used : By(org.openqa.selenium.By) ForumPage(org.olat.selenium.page.forum.ForumPage)

Example 7 with ForumPage

use of org.olat.selenium.page.forum.ForumPage in project openolat by klemens.

the class CourseElementTest method forumWithGuest.

/**
 * An administrator create a category in catalog. It creates a new course
 * with a forum open to guests. it publish the course in the
 * catalog.<br>
 * The guest find the course, create a new thread. The administrator reply
 * to the message, the guest to its reply.<br>
 * The administrator checks the last message in its new messages, click
 * back, use the list of users to see the messages of the guest. It clicks
 * back to the threads list and checks the thread has 3 messages.
 *
 * @param loginPage
 * @param guestBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void forumWithGuest(@InitialPage LoginPage loginPage, @Drone @User WebDriver guestBrowser) throws IOException, URISyntaxException {
    loginPage.loginAs("administrator", "openolat").resume();
    String node1 = "Forums " + UUID.randomUUID();
    navBar.openCatalogAdministration().addCatalogNode(node1, "First level of the catalog");
    // create a course
    String courseTitle = "Guest FO " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // go the authoring environment to create a forum
    String foTitle = "GFO - " + UUID.randomUUID();
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("fo").nodeTitle(foTitle);
    // configure for guest
    ForumCEPage forumConfig = new ForumCEPage(browser);
    forumConfig.selectConfiguration().allowGuest();
    // publish the course
    courseEditor.publish().nextSelectNodes().selectAccess(UserAccess.guest).nextAccess().selectCatalog(true).selectCategory(null, node1).nextCatalog().finish();
    // back in course
    courseEditor.clickToolbarBack();
    // guest go to the catalog and find the course
    LoginPage guestLogin = LoginPage.getLoginPage(guestBrowser, deploymentUrl);
    guestLogin.asGuest();
    NavigationPage guestNavBar = new NavigationPage(guestBrowser);
    guestNavBar.openCatalog().selectCatalogEntry(node1).select(courseTitle).start();
    // go to the forum
    new CoursePageFragment(guestBrowser).clickTree().selectWithTitle(foTitle.substring(0, 20));
    String guestAlias = "Guest-" + UUID.randomUUID();
    ForumPage guestForum = ForumPage.getCourseForumPage(guestBrowser).createThread("Your favorite author", "Name your favorite author", guestAlias);
    // admin go to the forum
    new CoursePageFragment(browser).clickTree().selectWithTitle(foTitle.substring(0, 20));
    // admin reply to the thread of guest
    ForumPage adminForum = ForumPage.getCourseForumPage(browser).openThread("Your favorite author").assertOnGuestPseudonym(guestAlias).newMessages().assertOnGuestPseudonym(guestAlias).replyToMessage("Your favorite author", "Huxley is my favorite author", "My favorite author is Huxley");
    // guest refresh the view and reply to admin
    guestForum.flatView().assertMessageBody("Huxley").replyToMessage("Huxley is my favorite author", " I prefer Orwell", "Orwell is my favorite author");
    // admin see its new messages, see the list of users, select the guest and its messages
    // JMS message need to be delivered
    OOGraphene.waitingALittleLonger();
    adminForum.newMessages().assertMessageBody("Orwell").clickBack().userFilter().selectFilteredUser(guestAlias).assertMessageBody("Orwell").clickBack().clickBack().assertThreadListOnNumber("Your favorite author", 3);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) ForumCEPage(org.olat.selenium.page.course.ForumCEPage) NavigationPage(org.olat.selenium.page.NavigationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) ForumPage(org.olat.selenium.page.forum.ForumPage) LoginPage(org.olat.selenium.page.LoginPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 8 with ForumPage

use of org.olat.selenium.page.forum.ForumPage in project openolat by klemens.

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)

Aggregations

ForumPage (org.olat.selenium.page.forum.ForumPage)8 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)6 Test (org.junit.Test)6 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)6 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)6 LoginPage (org.olat.selenium.page.LoginPage)4 NavigationPage (org.olat.selenium.page.NavigationPage)4 UserRestClient (org.olat.test.rest.UserRestClient)4 UserVO (org.olat.user.restapi.UserVO)4 ForumCEPage (org.olat.selenium.page.course.ForumCEPage)2 MediaCenterPage (org.olat.selenium.page.portfolio.MediaCenterPage)2 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)2 By (org.openqa.selenium.By)2