Search in sources :

Example 36 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project openolat by klemens.

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 37 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project openolat by klemens.

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 38 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project openolat by klemens.

the class CourseElementTest method createCourseWithWiki_createInCourseEditor.

/**
 * Create a course, create a course element of type wiki. Open
 * the resource chooser, create a wiki, close the editor, show the
 * index page of the wiki.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourseWithWiki_createInCourseEditor(@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();
    String wikiNodeTitle = "Wiki-1";
    String wikiTitle = "Wiki for a course - " + UUID.randomUUID().toString();
    // 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().createWiki(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 39 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project openolat by klemens.

the class CourseElementTest method forumConcurrent.

/**
 * An author creates a course with a forum, publish it, open a new thread.
 * A first user come to see the thread. A second come via the peekview.
 * The three make a reply at the same time. And they check that they see
 * the replies, and the ones of the others.
 *
 * @param loginPage
 * @param kanuBrowser
 * @param reiBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void forumConcurrent(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver kanuBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Course FO " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // go the authoring environment to create a forum
    String foTitle = "FO - " + UUID.randomUUID();
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("fo").nodeTitle(foTitle).publish().quickPublish(UserAccess.registred);
    // go to the forum
    courseEditor.clickToolbarBack().clickTree().selectWithTitle(foTitle.substring(0, 20));
    ForumPage authorForum = ForumPage.getCourseForumPage(browser);
    authorForum.createThread("The best anime ever", "What is the best anime ever?", null);
    // First user go to the course
    LoginPage kanuLoginPage = LoginPage.getLoginPage(kanuBrowser, deploymentUrl);
    kanuLoginPage.loginAs(kanu.getLogin(), kanu.getPassword()).resume();
    NavigationPage kanuNavBar = new NavigationPage(kanuBrowser);
    kanuNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    // go to the forum
    new CoursePageFragment(kanuBrowser).clickTree().selectWithTitle(foTitle.substring(0, 20));
    ForumPage kanuForum = ForumPage.getCourseForumPage(kanuBrowser).openThread("The best anime ever");
    // First user go to the course
    LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
    reiLoginPage.loginAs(rei).resume();
    NavigationPage reiNavBar = new NavigationPage(reiBrowser);
    reiNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    // select the thread in peekview
    ForumPage reiForum = new ForumPage(reiBrowser).openThreadInPeekview("The best anime ever");
    // concurrent reply
    String kanuReply = "Ikki Touzen";
    String reiReply = "Neon Genesis Evangelion";
    String authorReply = "Lain, serial experiment";
    authorForum.replyToMessageNoWait("The best anime ever", null, authorReply);
    reiForum.replyToMessageNoWait("The best anime ever", null, reiReply);
    kanuForum.replyToMessageNoWait("The best anime ever", null, kanuReply);
    // wait the responses
    OOGraphene.waitBusy(browser);
    OOGraphene.waitBusy(kanuBrowser);
    OOGraphene.waitBusy(reiBrowser);
    // check own responses
    authorForum.assertMessageBody(authorReply);
    kanuForum.assertMessageBody(kanuReply);
    reiForum.assertMessageBody(reiReply);
    // check others responses
    authorForum.flatView().waitMessageBody(kanuReply);
    reiForum.flatView().waitMessageBody(kanuReply);
    kanuForum.flatView().waitMessageBody(reiReply);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) 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) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 40 with CoursePageFragment

use of org.olat.selenium.page.course.CoursePageFragment in project openolat by klemens.

the class CourseElementTest method createCourseWithBlog_externalFeed.

@Test
@RunAsClient
public void createCourseWithBlog_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-Blog-" + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String blogNodeTitle = "Blog-1";
    String blogTitle = "Blog - " + UUID.randomUUID();
    // create a course element of type 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);
    // check that the title of the podcast is correct
    WebElement podcastH2 = browser.findElement(By.cssSelector("div.o_blog_info>h2>i.o_FileResource-BLOG_icon"));
    Assert.assertNotNull(podcastH2);
    // Assert.assertEquals(blogTitle, podcastH2.getText().trim());
    FeedPage feed = FeedPage.getFeedPage(browser);
    feed.newExternalBlog(blogTitle, "https://www.openolat.com/feed/");
// check only that the subscription link is visible
/*
		By subscriptionBy = By.cssSelector("div.o_subscription>a");
		OOGraphene.waitElement(subscriptionBy, 20, browser);
		WebElement subscriptionLink = browser.findElement(subscriptionBy);
		Assert.assertTrue(subscriptionLink.isDisplayed());
		*/
}
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)

Aggregations

CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)110 Test (org.junit.Test)104 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)102 UserRestClient (org.olat.test.rest.UserRestClient)102 UserVO (org.olat.user.restapi.UserVO)102 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)80 NavigationPage (org.olat.selenium.page.NavigationPage)56 LoginPage (org.olat.selenium.page.LoginPage)54 MembersPage (org.olat.selenium.page.course.MembersPage)34 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)30 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)30 WebElement (org.openqa.selenium.WebElement)30 URL (java.net.URL)24 File (java.io.File)22 By (org.openqa.selenium.By)14 Calendar (java.util.Calendar)10 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)8 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)8 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)8 EnrollmentPage (org.olat.selenium.page.course.EnrollmentPage)8