use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.
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);
*/
}
use of org.olat.selenium.page.course.CoursePageFragment in project OpenOLAT by OpenOLAT.
the class PortfolioV2Test method binderAssessment.
/**
* This is a long test. It's test the whole process to assess a binder from
* the template create by the author, to the assessment value saved in the
* assessment tool of the course.<br>
* The author creates a portfolio template with 2 sections and 2 assignments,
* it creates a course with a portfolio element and bind the template to it. It
* add a user as participant.<br>
* The participant starts the course, pick the binder and do every assignment.
* It edits the sharing settings to add the author as a coach.<br>
* The author assesses the sections and set the binder as done. Than it goes
* to the course, opens the assessment tool and check the participant passed
* the binder.
*
* @param loginPage
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void binderAssessment(@InitialPage LoginPage loginPage, @Drone @User WebDriver reiBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("rei");
loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
String binderTitle = "Binder to assess " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createPortfolioBinder(binderTitle).clickToolbarBack();
// create a binder template with 2 sections and
// an assignment in each
String section1Title = "Section 1 " + UUID.randomUUID();
String assignment1Title = "Assignment 1 " + UUID.randomUUID();
String section2Title = "Section 2 " + UUID.randomUUID();
String assignment2Title = "Assignment 2 " + UUID.randomUUID();
BinderPage binderTemplate = new BinderPage(browser);
binderTemplate.assertOnBinder().selectTableOfContent().deleteSection().selectEntries().createSectionInEntries(section1Title).createAssignmentForSection(section1Title, assignment1Title, "Write a small summary", "Your task is...").assertOnAssignmentInEntries(assignment1Title).createSection(section2Title).createAssignmentForSection(section2Title, assignment2Title, "Second part to do", "you have to work").assertOnAssignmentInEntries(assignment2Title);
// create a course
String courseTitle = "ASPF Course " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
String portfolioNodeTitle = "Template-ASPF-v2";
// create a course element of type portfolio and choose the one we created above
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
courseEditor.createNode("ep").nodeTitle(portfolioNodeTitle).selectTabLearnContent().choosePortfolio(binderTitle);
// configure the assessment
AssessmentCEConfigurationPage assessmentConfig = new AssessmentCEConfigurationPage(browser);
assessmentConfig.selectConfiguration().setScoreAuto(0.0f, 10.0f, 5.0f);
courseEditor.publish().quickPublish(UserAccess.membersOnly);
MembersPage membersPage = courseEditor.clickToolbarBack().members();
membersPage.importMembers().setMembers(rei).nextUsers().nextOverview().nextPermissions().finish();
// Participant log in
LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
reiLoginPage.loginAs(rei).resume();
// open the course
NavigationPage reiNavBar = new NavigationPage(reiBrowser);
reiNavBar.openMyCourses().select(courseTitle);
// go to the portfolio course element
CoursePageFragment reiTestCourse = new CoursePageFragment(reiBrowser);
reiTestCourse.clickTree().selectWithTitle(portfolioNodeTitle);
PortfolioElementPage portfolioCourseEl = new PortfolioElementPage(reiBrowser);
BinderPage reiBinder = portfolioCourseEl.pickPortfolio().goToPortfolioV2();
OOGraphene.waitAndCloseBlueMessageWindow(reiBrowser);
reiBinder.selectEntries().pickAssignment(assignment1Title).publishEntry();
reiBinder.selectEntries().pickAssignment(assignment2Title).publishEntry();
// add the author as coach
reiBinder.selectPublish().openAccessMenu().addMember().searchMember(author, false).nextUsers().nextOverview().fillAccessRights(binderTitle, Boolean.TRUE).nextPermissions().deSelectEmail().finish();
// the author come to see the binder
UserToolsPage userTools = new UserToolsPage(browser);
PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
portfolio.openSharedWithMe().openSharedBindersWithMe().assertOnBinder(binderTitle).selectBinder(binderTitle).selectAssessment().passed(section1Title).save().close(section1Title).passed(section2Title).save().close(section2Title).done().assertPassed(2);
// than go to the course and check the results in the assessment tool
// author take the lead and check the assessment tool
navBar.openMyCourses().select(courseTitle);
// open the assessment tool
AssessmentToolPage assessmentTool = new CoursePageFragment(browser).assessmentTool();
// check that rei has passed the test
assessmentTool.users().assertOnUsers(rei).selectUser(rei).assertPassed(rei);
}
use of org.olat.selenium.page.course.CoursePageFragment 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);
}
use of org.olat.selenium.page.course.CoursePageFragment 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);
}
use of org.olat.selenium.page.course.CoursePageFragment in project openolat by klemens.
the class ImsQTI21Test method qti21Course.
/**
* Upload a test in QTI 2.1 format, create a course, bind
* the test in a course element, run it and check if
* the attempt go up.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21Course(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Simple QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_test.zip");
File qtiTestFile = new File(qtiTestUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile);
// create a course
String courseTitle = "Course QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
String testNodeTitle = "QTI21Test-1";
// create a course element of type CP with the CP that we create above
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
courseEditor.createNode("iqtest").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(qtiTestTitle);
QTI21ConfigurationCEPage configPage = new QTI21ConfigurationCEPage(browser);
configPage.selectConfiguration().showScoreOnHomepage(true).saveConfiguration();
// publish the course
courseEditor.publish().quickPublish();
// open the course and see the CP
CoursePageFragment course = courseEditor.clickToolbarBack();
course.clickTree().selectWithTitle(testNodeTitle);
// check that the title of the start page of test is correct
WebElement testH2 = browser.findElement(By.cssSelector("div.o_course_run h2"));
Assert.assertEquals(testNodeTitle, testH2.getText().trim());
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
qtiPage.start().answerSingleChoiceWithParagraph("Right").saveAnswer().endTest().assertOnCourseAttempts(1).assertOnCourseAssessmentTestScore(1);
}
Aggregations