use of org.olat.selenium.page.course.MembersPage in project openolat by klemens.
the class AssessmentTest method assessmentCourseElement.
/**
* An author create a course with an assessment course element with
* min., max., cut value and so on. It add an user to the course,
* go to the assessment tool and set a score to the assessed user.<br>
*
* The user log in, go to the efficiency statements list and check
* it become its statement.
*
* @param authorLoginPage
* @param ryomouBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void assessmentCourseElement(@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 = "Assessment CE";
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit().createNode("ms").nodeTitle(assessmentNodeTitle);
// configure assessment
AssessmentCEConfigurationPage assessmentConfig = new AssessmentCEConfigurationPage(browser);
assessmentConfig.selectConfiguration().setScoreAuto(0.1f, 10.0f, 5.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(8.0f).assertUserPassedCourseNode(assessmentNodeTitle);
// Ryomou login
LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
ryomouLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword()).resume();
// see its beautiful efficiency statement
UserToolsPage ryomouUserTools = new UserToolsPage(ryomouBrowser);
ryomouUserTools.openUserToolsMenu().openMyEfficiencyStatement().assertOnEfficiencyStatmentPage().assertOnStatement(courseTitle, true).selectStatement(courseTitle).assertOnCourseDetails(assessmentNodeTitle, true);
}
use of org.olat.selenium.page.course.MembersPage in project openolat by klemens.
the class AssessmentTest method bulkAssessment.
/**
* Create an assessment course element, add two users to the course
* and assesses them with the bulk assessment tool. The 2 users
* log in and check their results.
*
* @param loginPage
* @param kanuBrowser
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void bulkAssessment(@InitialPage LoginPage loginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver kanuBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
loginPage.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 = "Assessment CE";
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit().createNode("ms").nodeTitle(assessmentNodeTitle);
// configure assessment
AssessmentCEConfigurationPage assessmentConfig = new AssessmentCEConfigurationPage(browser);
assessmentConfig.selectConfiguration().setScoreAuto(0.1f, 10.0f, 5.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.importMembers().setMembers(ryomou, kanu).nextUsers().nextOverview().nextPermissions().finish();
BulkAssessmentData[] data = new BulkAssessmentData[] { new BulkAssessmentData(ryomou, 8.0f, null, "Well done"), new BulkAssessmentData(kanu, 4.0f, null, "Need more work") };
members.clickToolbarBack().assessmentTool().bulk().data(data).nextData().nextColumns().nextValidation().finish();
// Ryomou login
LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
ryomouLoginPage.loginAs(ryomou).resume();
NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
ryomouNavBar.openMyCourses().select(courseTitle);
// go to the group task
CoursePageFragment ryomouCourse = new CoursePageFragment(ryomouBrowser);
ryomouCourse.clickTree().selectWithTitle(assessmentNodeTitle);
// Second login
LoginPage kanuLoginPage = LoginPage.getLoginPage(kanuBrowser, deploymentUrl);
kanuLoginPage.loginAs(kanu).resume();
NavigationPage kanuNavBar = new NavigationPage(kanuBrowser);
kanuNavBar.openMyCourses().select(courseTitle);
// go to the group task
CoursePageFragment kanuCourse = new CoursePageFragment(kanuBrowser);
kanuCourse.clickTree().selectWithTitle(assessmentNodeTitle);
// Ryomou -> passed
WebElement passedEl = ryomouBrowser.findElement(By.cssSelector("tr.o_state.o_passed"));
Assert.assertTrue(passedEl.isDisplayed());
// Kanu -> failed
WebElement failedEl = kanuBrowser.findElement(By.cssSelector("tr.o_state.o_failed"));
Assert.assertTrue(failedEl.isDisplayed());
}
use of org.olat.selenium.page.course.MembersPage in project OpenOLAT by OpenOLAT.
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();
}
use of org.olat.selenium.page.course.MembersPage in project OpenOLAT by OpenOLAT.
the class CourseElementTest method createCourseWithMemberList.
/**
* An author create a course with a member list course element.
* It add two participants and a coach. It publish the course and
* check that it sees the authors, coaches and participants.<br>
* After that, it edits the course and change the settins to only
* show the participants. It checks that only the participants are
* visible.<br>
* At least, it changes the settings a second time to only show
* the course coaches.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createCourseWithMemberList(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO coach = new UserRestClient(deploymentUrl).createRandomUser("Rei");
UserVO participant1 = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
UserVO participant2 = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// go to authoring
AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
String title = "Course partilist " + UUID.randomUUID();
// create course
authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
// add 2 participants
CoursePageFragment course = new CoursePageFragment(browser);
MembersPage members = course.members();
members.importMembers().setMembers(participant1, participant2).nextUsers().nextOverview().nextPermissions().finish();
// add a coach
course.members().addMember().searchMember(coach, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, true, false).nextPermissions().finish();
members.clickToolbarBack();
String memberListTitle = "MemberList";
// open course editor
CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit().createNode("cmembers").nodeTitle(memberListTitle);
// publish
editor.publish().quickPublish(UserAccess.registred);
editor.clickToolbarBack();
course.clickTree().selectWithTitle(memberListTitle);
// check the default configuration with authors, coaches and participants
MemberListPage memberList = new MemberListPage(browser);
memberList.assertOnOwner(author.getFirstName()).assertOnCoach(coach.getFirstName()).assertOnParticipant(participant1.getFirstName()).assertOnParticipant(participant2.getFirstName());
// the author is not satisfied with the configuration
editor = course.openToolsMenu().edit().selectNode(memberListTitle);
MemberListConfigurationPage memberListConfig = new MemberListConfigurationPage(browser);
memberListConfig.selectSettings().setOwners(Boolean.FALSE).setCoaches(Boolean.FALSE).save();
// go check the results
course = editor.autoPublish();
course.clickTree().selectWithTitle(memberListTitle);
memberList.assertOnMembers().assertOnNotOwner(author.getFirstName()).assertOnNotCoach(coach.getFirstName()).assertOnParticipant(participant1.getFirstName()).assertOnParticipant(participant2.getFirstName());
// perhaps only the coaches
editor = course.openToolsMenu().edit().selectNode(memberListTitle);
memberListConfig = new MemberListConfigurationPage(browser);
memberListConfig.selectSettings().setCoaches(Boolean.TRUE).setCourseCoachesOnly().setParticipants(Boolean.FALSE).save();
// go check that we see only the coaches results
course = editor.autoPublish();
course.clickTree().selectWithTitle(memberListTitle);
memberList.assertOnMembers().assertOnNotOwner(author.getFirstName()).assertOnCoach(coach.getFirstName()).assertOnNotParticipant(participant1.getFirstName()).assertOnNotParticipant(participant2.getFirstName());
}
use of org.olat.selenium.page.course.MembersPage in project OpenOLAT by OpenOLAT.
the class CourseElementTest method createCourseWithLTI.
/**
* An author setup a course with a LTI course element with score enabled.
* A participant take the course and see the LTI content. The back channel
* need the url of the OpenOLAT instance which is currently difficult
* for a selenium test. The grading is not tested until a LTI server
* can be installed on localhost.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createCourseWithLTI(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// create a course
String courseTitle = "Course-LTI-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// create a course element of type Test with the test that we create above
String ltiTitle = "LTI";
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit().createNode("lti").nodeTitle(ltiTitle);
// configure assessment
LTIConfigurationPage ltiConfig = new LTIConfigurationPage(browser);
ltiConfig.selectConfiguration().setLtiPage("http://lti.frentix.com/tool.php", "123456", "secret").enableScore(10.0d, 5.0d).save();
// 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(participant, true).nextUsers().nextOverview().nextPermissions().finish();
// Participant login
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle);
CoursePageFragment participantCourse = new CoursePageFragment(participantBrowser);
participantCourse.clickTree().selectWithTitle(ltiTitle);
LTIPage lti = new LTIPage(participantBrowser);
lti.start().outcomeToolProvider();
// .sendGrade(0.8d);
}
Aggregations