Search in sources :

Example 21 with MembersPage

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);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) 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 22 with MembersPage

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());
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) BulkAssessmentData(org.olat.selenium.page.course.BulkAssessmentPage.BulkAssessmentData) NavigationPage(org.olat.selenium.page.NavigationPage) AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) WebElement(org.openqa.selenium.WebElement) 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 23 with MembersPage

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();
}
Also used : CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) GroupTaskPage(org.olat.selenium.page.course.GroupTaskPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) GroupTaskConfigurationPage(org.olat.selenium.page.course.GroupTaskConfigurationPage) MembersPage(org.olat.selenium.page.course.MembersPage) File(java.io.File) GroupTaskToCoachPage(org.olat.selenium.page.course.GroupTaskToCoachPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 24 with MembersPage

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());
}
Also used : MemberListPage(org.olat.selenium.page.course.MemberListPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MemberListConfigurationPage(org.olat.selenium.page.course.MemberListConfigurationPage) MembersPage(org.olat.selenium.page.course.MembersPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 25 with MembersPage

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);
}
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) MembersPage(org.olat.selenium.page.course.MembersPage) LTIPage(org.olat.selenium.page.course.LTIPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) LTIConfigurationPage(org.olat.selenium.page.course.LTIConfigurationPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)36 Test (org.junit.Test)36 MembersPage (org.olat.selenium.page.course.MembersPage)36 UserRestClient (org.olat.test.rest.UserRestClient)36 UserVO (org.olat.user.restapi.UserVO)36 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)34 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)30 LoginPage (org.olat.selenium.page.LoginPage)28 NavigationPage (org.olat.selenium.page.NavigationPage)28 File (java.io.File)10 URL (java.net.URL)10 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)10 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)10 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)8 GroupPage (org.olat.selenium.page.group.GroupPage)6 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)4 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)4 EnrollmentPage (org.olat.selenium.page.course.EnrollmentPage)4 GroupTaskConfigurationPage (org.olat.selenium.page.course.GroupTaskConfigurationPage)4 GroupTaskPage (org.olat.selenium.page.course.GroupTaskPage)4