use of org.olat.selenium.page.user.UserToolsPage 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);
}
use of org.olat.selenium.page.user.UserToolsPage in project openolat by klemens.
the class AssessmentTest method certificatesGeneratedByTest.
/**
* An author create a course, set up the root node to make efficiency statement,
* add a test, publish it and add a participant. It set the certificate.<br>
*
* The participant logs in, make the test and look at its wonderful certificate
* and the details of its performance.
*
* @param authorLoginPage
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void certificatesGeneratedByTest(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver reiBrowser) throws IOException, URISyntaxException {
// create an author and a participant
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
// deploy the test
URL testUrl = ArquillianDeployments.class.getResource("file_resources/e4_test.zip");
String testTitle = "E4Test-" + UUID.randomUUID();
new RepositoryRestClient(deploymentUrl, author).deployResource(new File(testUrl.toURI()), "-", testTitle);
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// create a course
String courseTitle = "Certif-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// create a course element of type CP with the CP that we create above
String testNodeTitle = "Test-QTI-1.2";
CoursePageFragment courseRuntime = CoursePageFragment.getCourse(browser);
courseRuntime.edit().createNode("iqtest").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(testTitle).selectRoot().selectTabScore().enableRootScoreByNodes().autoPublish().accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
// add a participant to the course
MembersPage members = courseRuntime.members();
members.addMember().searchMember(rei, true).nextUsers().nextOverview().nextPermissions().finish();
// return to course
courseRuntime = members.clickToolbarBack().efficiencyStatementConfiguration().enableCertificates(true).enableRecertification().save().clickToolbarBack();
// Participant log in
LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
reiLoginPage.loginAs(rei.getLogin(), rei.getPassword()).resume();
// open the course
NavigationPage reiNavBar = new NavigationPage(reiBrowser);
reiNavBar.openMyCourses().select(courseTitle);
// go to the test
CoursePageFragment reiTestCourse = new CoursePageFragment(reiBrowser);
reiTestCourse.clickTree().selectWithTitle(testNodeTitle);
// pass the test
QTI12Page.getQTI12Page(reiBrowser).passE4(rei);
// open the efficiency statements
UserToolsPage reiUserTools = new UserToolsPage(reiBrowser);
reiUserTools.openUserToolsMenu().openMyEfficiencyStatement().assertOnEfficiencyStatmentPage().assertOnCertificateAndStatements(courseTitle).selectStatement(courseTitle).selectStatementSegment().assertOnCourseDetails(testNodeTitle, true);
}
use of org.olat.selenium.page.user.UserToolsPage in project openolat by klemens.
the class CourseTest method courseReminders.
/**
* An author create a course, set a start and end date for life-cycle.
* It add a participant to the course. It creates a reminder
* with a rule to catch only participant, an other to send
* the reminder after the start of the course. It sends the reminder
* manually, checks the reminders send, checks the log.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void courseReminders(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
// configure at least a license
loginPage.loginAs("administrator", "openolat").resume();
new NavigationPage(browser).openAdministration().openLicenses().enableForResources("all rights reserved");
new UserToolsPage(browser).logout();
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
loginPage.loginAs(author.getLogin(), author.getPassword());
UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
// go to authoring
AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.DATE, -10);
Date validFrom = cal.getTime();
cal.add(Calendar.DATE, 20);
Date validTo = cal.getTime();
String title = "Remind-me-" + UUID.randomUUID();
// create course
authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().setLicense().setLifecycle(validFrom, validTo, Locale.GERMAN).save().clickToolbarBack();
// open course editor, create a node, set access
CoursePageFragment course = new CoursePageFragment(browser);
course.openToolsMenu().edit().createNode("info").autoPublish().accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
// add a participant
course.members().quickAdd(kanu);
// go to reminders
RemindersPage reminders = course.reminders().assertOnRemindersList();
String reminderTitle = "REM-" + UUID.randomUUID();
reminders.addReminder().setDescription(reminderTitle).setSubject(reminderTitle).setTimeBasedRule(1, "RepositoryEntryLifecycleAfterValidFromRuleSPI", 5, "day").addRule(1).setRoleBasedRule(2, "RepositoryEntryRoleRuleSPI", "participant").saveReminder().assertOnRemindersList().assertOnReminderInList(reminderTitle);
// send the reminders
reminders.openActionMenu(reminderTitle).sendReminders();
// check the reminder is send to user
reminders.openActionMenu(reminderTitle).showSentReminders().assertSentRemindersList(kanu, true).assertSentRemindersList(author, false);
// open reminders log
reminders.clickToolbarBack().openLog().assertLogList(kanu, reminderTitle, true).assertLogList(author, reminderTitle, false);
}
use of org.olat.selenium.page.user.UserToolsPage in project openolat by klemens.
the class AssessmentTest method scormCourseWithAssessment.
/**
* An author upload a SCORM resource, create a course and use the
* SCORM within. It publish the course, add a participant to the
* course. The participant log in, select the course above, run
* the SCORM and finish it.<br>
* At the end, the author go to the assessment tool and chec that
* the participant has successfully passed the test.
*
* @param authorLoginPage
* @param ryomouBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void scormCourseWithAssessment(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
// upload a test
String scormTitle = "SCORM - " + UUID.randomUUID();
URL scormUrl = JunitTestHelper.class.getResource("file_resources/very_simple_scorm.zip");
File scormFile = new File(scormUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(scormTitle, scormFile);
// create a course
String courseTitle = "Course-With-SCORM-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// create a course element of type Scorm with the scorm that we create above
String scormNodeTitle = "SCORM";
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
courseEditor.createNode("scorm").nodeTitle(scormNodeTitle).selectTabLearnContent().chooseScorm(scormTitle);
// publish the course
courseEditor.autoPublish().accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
CoursePageFragment courseRuntime = new CoursePageFragment(browser);
// add Ryomou as a course member
courseRuntime.members().addMember().searchMember(ryomou, true).nextUsers().nextOverview().nextPermissions().finish();
// Ryomou open the course
LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
ryomouLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword()).resume();
// open the course
NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
ryomouNavBar.openMyCourses().select(courseTitle);
// open the course and see the test start page
CoursePageFragment ryomouCourse = new CoursePageFragment(ryomouBrowser);
ryomouCourse.clickTree().selectWithTitle(scormNodeTitle);
By scormH2By = By.cssSelector("div.o_course_run h2");
WebElement scormH2 = ryomouBrowser.findElement(scormH2By);
Assert.assertEquals(scormNodeTitle, scormH2.getText().trim());
// scorm
ScormPage scorm = ScormPage.getScormPage(ryomouBrowser);
scorm.start().passVerySimpleScorm().back();
WebElement scormH2Back = ryomouBrowser.findElement(scormH2By);
Assert.assertEquals(scormNodeTitle, scormH2Back.getText().trim());
// log out
UserToolsPage roymouUserTools = new UserToolsPage(ryomouBrowser);
roymouUserTools.logout();
// author take the lead and check the assessment tool
navBar.openMyCourses().select(courseTitle);
// open the assessment tool
AssessmentToolPage assessmentTool = new CoursePageFragment(browser).assessmentTool();
assessmentTool.users().assertOnUsers(ryomou).selectUser(ryomou).assertPassed(ryomou);
}
use of org.olat.selenium.page.user.UserToolsPage 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