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);
}
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);
}
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);
}
Aggregations