use of org.olat.selenium.page.course.MembersPage in project OpenOLAT by OpenOLAT.
the class CourseElementTest method createCourseWithDialog.
/**
* An author create a course with a dialog course element. It
* add a participant to the course, a file to the dialog in
* the course element configuration and after publishing the course
* in the view of the dialog. It opens the forum of one of the files,
* create a new thread.<br>
* The participant log in, open the course and the dialog element. It
* reads the thread and make a reply. The author answers to the reply.
*
* @param loginPage
*/
@Test
@RunAsClient
public void createCourseWithDialog(@InitialPage LoginPage authorLoginPage, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Rei");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// go to authoring
AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
String title = "Course dialog " + UUID.randomUUID();
// create course
authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
// add a participant
MembersPage members = new CoursePageFragment(browser).members();
members.addMember().searchMember(participant, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, false, true).nextPermissions().finish();
members.clickToolbarBack();
String dialogNodeTitle = "Dialog";
// open course editor
CoursePageFragment course = CoursePageFragment.getCourse(browser);
CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit().createNode("dialog").nodeTitle(dialogNodeTitle);
// upload a file in the configuration
URL imageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File imageFile = new File(imageUrl.toURI());
DialogConfigurationPage dialogConfig = new DialogConfigurationPage(browser);
dialogConfig.selectConfiguration().uploadFile(imageFile);
// publish and go to the course element
editor.publish().quickPublish(UserAccess.membersOnly);
editor.clickToolbarBack();
course.clickTree().selectWithTitle(dialogNodeTitle);
// upload a second file
URL imageRunUrl = JunitTestHelper.class.getResource("file_resources/IMG_1483.png");
File imageRunFile = new File(imageRunUrl.toURI());
DialogPage dialog = new DialogPage(browser);
dialog.assertOnFile(imageFile.getName()).uploadFile(imageRunFile).assertOnFile(imageRunFile.getName()).openForum(imageRunFile.getName()).createThread("JPEG vs PNG", "Which is the best format", null);
// The participant come in
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
// The participant find the course
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.assertOnNavigationPage().openMyCourses().select(title);
// And opens the dialog course element
CoursePageFragment participantCourse = CoursePageFragment.getCourse(participantBrowser);
participantCourse.clickTree().selectWithTitle(dialogNodeTitle);
DialogPage participantDialog = new DialogPage(participantBrowser);
participantDialog.assertOnFile(imageRunFile.getName()).openForum(imageRunFile.getName()).openThread("JPEG vs PNG").replyToMessage("JPEG vs PNG", "PNG for sure", "Not a loosy format");
// The author reload the messages
dialog.back().openForum(imageRunFile.getName()).openThread("JPEG vs PNG").assertMessageBody("Not a loosy format").replyToMessage("PNG for sure", "JPEG smaller", "JPEG is smaller");
// The participant check the reply
participantDialog.back().openForum(imageRunFile.getName()).openThread("JPEG vs PNG").assertMessageBody("JPEG is smaller");
}
use of org.olat.selenium.page.course.MembersPage in project OpenOLAT by OpenOLAT.
the class PortfolioV2Test method createTemplate.
/**
* Create a portfolio, a course with a portoflio course element,
* publish it, ad a participant. The participant log in, search
* the course and pick the portfolio.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createTemplate(@InitialPage LoginPage loginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("ryomou");
loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
String binderTitle = "PF-Binder-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createPortfolioBinder(binderTitle).clickToolbarBack();
String sectionTitle = "Section 1 " + UUID.randomUUID();
String assignmentTitle = "Assignment 1 " + UUID.randomUUID();
BinderPage portfolio = new BinderPage(browser);
portfolio.assertOnBinder().selectEntries().createSectionInEntries(sectionTitle).createAssignmentForSection(sectionTitle, assignmentTitle, "Write a small summary", "Your task is...").assertOnAssignmentInEntries(assignmentTitle);
String courseTitle = "PF Course " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
String portfolioNodeTitle = "Template-EP-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).publish().quickPublish(UserAccess.membersOnly);
MembersPage membersPage = courseEditor.clickToolbarBack().members();
membersPage.importMembers().setMembers(ryomou).nextUsers().nextOverview().nextPermissions().finish();
// Participant log in
LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
ryomouLoginPage.loginAs(ryomou).resume();
// open the course
NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
ryomouNavBar.openMyCourses().select(courseTitle);
// go to the portfolio course element
CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
ryomouTestCourse.clickTree().selectWithTitle(portfolioNodeTitle);
PortfolioElementPage portfolioCourseEl = new PortfolioElementPage(ryomouBrowser);
BinderPage binder = portfolioCourseEl.pickPortfolio().goToPortfolioV2();
binder.selectEntries().pickAssignment(assignmentTitle);
}
use of org.olat.selenium.page.course.MembersPage in project openolat by klemens.
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.MembersPage in project openolat by klemens.
the class AssessmentTest method certificatesManuallyGenerated.
/**
* An author create a course, publish it and add a participant.
* It set the certificate, create one for the participant.<br>
* The participant logs in and look at its wonderful certificate.
*
* @param authorLoginPage
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void certificatesManuallyGenerated(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver reiBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
// create a course
String courseTitle = "Course-With-Certificates-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// create a course element of type CP with the CP that we create above
CoursePageFragment courseRuntime = CoursePageFragment.getCourse(browser).edit().createNode("info").autoPublish();
// 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().clickToolbarBack().efficiencyStatementConfiguration().enableCertificates(false).enableRecertification().save().clickToolbarBack();
// create a certificate
courseRuntime.assessmentTool().users().selectUser(rei).generateCertificate();
// Participant log in
LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
reiLoginPage.loginAs(rei.getLogin(), rei.getPassword()).resume();
// open the efficiency statements
UserToolsPage reiUserTools = new UserToolsPage(reiBrowser);
reiUserTools.openUserToolsMenu().openMyEfficiencyStatement().assertOnEfficiencyStatmentPage().assertOnCertificate(courseTitle);
}
use of org.olat.selenium.page.course.MembersPage in project openolat by klemens.
the class AssessmentTest method taskWithIndividuScoreAndRevision.
/**
* An author create a course for a task with the some custom
* settings, all steps are selected, grading with score and
* passed automatically calculated, 2 tasks, 1 solution...</br>
* It had 2 participants. One of them goes through the workflow,
* selects a task, submits 2 documents, one with the embedded editor,
* one with the upload mechanism.</br>
* The author reviews the documents, uploads a correction and
* want a revision.</br>
* The assessed participant upload a revised document.</br>
* The author sees it and close the revisions process, use
* the assessment tool to set the score.</br>
* The participant checks if she successfully passed the task.
*
* @param authorLoginPage
* @param ryomouBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void taskWithIndividuScoreAndRevision(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("kanu");
UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("ryomou");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// create a course
String courseTitle = "Course-with-individual-task-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// create a course element of type Test with the test that we create above
String gtaNodeTitle = "Individual task 1";
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
courseEditor.createNode("ita").nodeTitle(gtaNodeTitle);
GroupTaskConfigurationPage gtaConfig = new GroupTaskConfigurationPage(browser);
gtaConfig.selectAssignment();
URL task1Url = JunitTestHelper.class.getResource("file_resources/task_1_a.txt");
File task1File = new File(task1Url.toURI());
gtaConfig.uploadTask("Individual Task 1 alpha", task1File);
URL task2Url = JunitTestHelper.class.getResource("file_resources/task_1_b.txt");
File task2File = new File(task2Url.toURI());
gtaConfig.uploadTask("Individual Task 2 beta", task2File).saveTasks().selectSolution();
URL solutionUrl = JunitTestHelper.class.getResource("file_resources/solution_1.txt");
File solutionFile = new File(solutionUrl.toURI());
gtaConfig.uploadSolution("The Best Solution", solutionFile);
gtaConfig.selectAssessment().setAssessmentOptions(0.0f, 6.0f, 4.0f).saveAssessmentOptions();
courseEditor.publish().quickPublish(UserAccess.membersOnly);
MembersPage membersPage = courseEditor.clickToolbarBack().members();
membersPage.importMembers().setMembers(kanu, ryomou).nextUsers().nextOverview().nextPermissions().finish();
// go to the course
CoursePageFragment coursePage = membersPage.clickToolbarBack();
coursePage.clickTree().selectWithTitle(gtaNodeTitle);
// Participant log in
LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
ryomouLoginPage.loginAs(ryomou).resume();
// open the course
NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
ryomouNavBar.openMyCourses().select(courseTitle);
// go to the group task
CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
GroupTaskPage ryomouTask = new GroupTaskPage(ryomouBrowser);
ryomouTask.assertAssignmentAvailable().selectTask(1).assertTask("Individual Task 2 beta").assertSubmissionAvailable();
URL submit1Url = JunitTestHelper.class.getResource("file_resources/submit_2.txt");
File submit1File = new File(submit1Url.toURI());
String submittedFilename = "personal_solution.html";
String submittedText = "This is my solution";
ryomouTask.submitFile(submit1File).submitText(submittedFilename, submittedText).submitDocuments();
// back to author
coursePage.clickTree().selectWithTitle(gtaNodeTitle);
GroupTaskToCoachPage participantToCoach = new GroupTaskToCoachPage(browser);
URL correctionUrl = JunitTestHelper.class.getResource("file_resources/correction_1.txt");
File correctionFile = new File(correctionUrl.toURI());
participantToCoach.selectIdentityToCoach(ryomou).assertSubmittedDocument("personal_solution.html").assertSubmittedDocument("submit_2.txt").uploadCorrection(correctionFile).needRevision();
// participant add a revised document
URL revisionUrl = JunitTestHelper.class.getResource("file_resources/submit_3.txt");
File revisionFile = new File(revisionUrl.toURI());
ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
ryomouTask.submitRevisedFile(revisionFile).submitRevision();
// back to author
coursePage.clickTree().selectWithTitle(gtaNodeTitle);
participantToCoach.selectIdentityToCoach(ryomou).assertRevision("submit_3.txt").closeRevisions().openIndividualAssessment().individualAssessment(null, 5.5f).assertPassed();
// participant checks she passed the task
ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
ryomouTask.assertPassed();
}
Aggregations