Search in sources :

Example 6 with AssessmentToolPage

use of org.olat.selenium.page.course.AssessmentToolPage in project openolat by klemens.

the class AssessmentTest method qti12CourseWithAssessment.

/**
 * An author upload a test, create a course with a test course
 * element, publish the course, assign the course to a student.
 * The student come to pass the test, logout after passing it.
 * The author check if the test of the student is passed in the
 * assessment tool.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti12CourseWithAssessment(@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 qtiTestTitle = "QTI-Test-1.2-" + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/e4_test.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile);
    // create a course
    String courseTitle = "Course-With-QTI-Test-1.2-" + 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";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("iqtest").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(qtiTestTitle);
    // publish the course
    courseEditor.publish().quickPublish(UserAccess.membersOnly);
    // open the course and see the test start page
    CoursePageFragment courseRuntime = courseEditor.clickToolbarBack();
    courseRuntime.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());
    // 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);
    // go to the test
    CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
    ryomouTestCourse.clickTree().selectWithTitle(testNodeTitle);
    // start the test
    QTI12Page testPage = QTI12Page.getQTI12Page(ryomouBrowser);
    testPage.start().selectItem("Single choice").answerSingleChoice("Correct answer").saveAnswer().selectItem("Multiple choice").answerMultipleChoice("Correct answer", "The answer is correct").saveAnswer().selectItem("Kprim").answerKPrim(true, false, true, false).saveAnswer().selectItem("Fill-in").answerFillin("not").saveAnswer();
    testPage.endTest();
    // check results page
    By resultsBy = By.id("o_qti_results");
    OOGraphene.waitElement(resultsBy, ryomouBrowser);
    WebElement resultsEl = ryomouBrowser.findElement(resultsBy);
    Assert.assertTrue(resultsEl.getText().contains(ryomou.getFirstName()));
    // close the test
    testPage.closeTest();
    // all answers are correct -> passed
    WebElement passedEl = ryomouBrowser.findElement(By.cssSelector("tr.o_state.o_passed"));
    Assert.assertTrue(passedEl.isDisplayed());
    // 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);
}
Also used : QTI12Page(org.olat.selenium.page.qti.QTI12Page) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) WebElement(org.openqa.selenium.WebElement) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) By(org.openqa.selenium.By) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) File(java.io.File) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 7 with AssessmentToolPage

use of org.olat.selenium.page.course.AssessmentToolPage in project OpenOLAT by OpenOLAT.

the class AssessmentTest method assessmentMode_manual.

/**
 * An author upload a test, create a course with a test course
 * element, publish the course, add 2 students (Ryomou and Kanu)
 * to the course, configure an assessment.<br />
 * A first student log in before the assessment is started by the
 * author, the second log-in after the begin of the assessment.
 * Both pass the test. The Author ends the assessment. The two
 * students wait the end of the assessment and go back to normal
 * activities. The author checks the students pass the test in the
 * assessment tool.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void assessmentMode_manual(@InitialPage LoginPage authorLoginPage, @Drone @Student WebDriver ryomouBrowser, @Drone @Participant WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    // upload a test
    String qtiTestTitle = "QTI-Test-1.2-" + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/e4_test.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile);
    // create a course
    String courseTitle = "Course-With-QTI-Test-1.2-" + 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";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("iqtest").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(qtiTestTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the test start page
    CoursePageFragment courseRuntime = courseEditor.clickToolbarBack();
    courseRuntime.clickTree().selectWithTitle(testNodeTitle);
    OOGraphene.closeBlueMessageWindow(browser);
    // 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());
    // add Ryomou and Kanu as a course member
    courseRuntime.members().quickAdd(ryomou);
    courseRuntime.members().quickAdd(kanu);
    // Kanu log in
    LoginPage kanuLoginPage = LoginPage.getLoginPage(kanuBrowser, deploymentUrl);
    kanuLoginPage.loginAs(kanu.getLogin(), kanu.getPassword()).resume();
    // prepare and start an assessment
    Calendar cal = Calendar.getInstance();
    Date begin = cal.getTime();
    cal.add(Calendar.MINUTE, 5);
    Date end = cal.getTime();
    String assessmentName = "Assessment-" + UUID.randomUUID();
    courseRuntime.assessmentConfiguration().createAssessmentMode().editAssessment(assessmentName, begin, end, true).save().start(assessmentName).confirmStart();
    // Ryomou opens the course
    LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
    ryomouLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword());
    // start the assessment
    AssessmentModePage ryomouAssessment = new AssessmentModePage(ryomouBrowser).startAssessment(false);
    // go to the test
    CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
    ryomouTestCourse.clickTree().selectWithTitle(testNodeTitle);
    // pass the test
    QTI12Page.getQTI12Page(ryomouBrowser).passE4(ryomou);
    // Kanu makes the test
    AssessmentModePage kanuAssessment = new AssessmentModePage(kanuBrowser).startAssessment(true);
    // go to the test
    CoursePageFragment kanuTestCourse = new CoursePageFragment(kanuBrowser);
    kanuTestCourse.clickTree().selectWithTitle(testNodeTitle);
    // pass the test
    QTI12Page.getQTI12Page(kanuBrowser).passE4(kanu);
    // Author ends the test
    courseRuntime.assessmentConfiguration().stop(assessmentName).confirmStop();
    By continueBy = By.className("o_sel_assessment_continue");
    OOGraphene.waitElement(continueBy, 10, ryomouBrowser);
    OOGraphene.waitElement(continueBy, 10, kanuBrowser);
    kanuAssessment.backToOpenOLAT();
    ryomouAssessment.backToOpenOLAT();
    // Author check if they pass the test
    navBar.openMyCourses().select(courseTitle);
    // open the assessment tool
    AssessmentToolPage assessmentTool = new CoursePageFragment(browser).assessmentTool();
    assessmentTool.users().assertOnUsers(ryomou).assertOnUsers(kanu).selectUser(ryomou).assertPassed(ryomou);
}
Also used : CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) Calendar(java.util.Calendar) WebElement(org.openqa.selenium.WebElement) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) Date(java.util.Date) UserRestClient(org.olat.test.rest.UserRestClient) AssessmentModePage(org.olat.selenium.page.course.AssessmentModePage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) By(org.openqa.selenium.By) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) File(java.io.File) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 8 with AssessmentToolPage

use of org.olat.selenium.page.course.AssessmentToolPage 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);
}
Also used : AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) PortfolioElementPage(org.olat.selenium.page.course.PortfolioElementPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) MembersPage(org.olat.selenium.page.course.MembersPage) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 9 with AssessmentToolPage

use of org.olat.selenium.page.course.AssessmentToolPage 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);
}
Also used : CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) WebElement(org.openqa.selenium.WebElement) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) ScormPage(org.olat.selenium.page.repository.ScormPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) By(org.openqa.selenium.By) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) File(java.io.File) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 10 with AssessmentToolPage

use of org.olat.selenium.page.course.AssessmentToolPage in project openolat by klemens.

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);
}
Also used : AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) PortfolioElementPage(org.olat.selenium.page.course.PortfolioElementPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) MembersPage(org.olat.selenium.page.course.MembersPage) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)10 Test (org.junit.Test)10 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)10 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)10 UserRestClient (org.olat.test.rest.UserRestClient)10 UserVO (org.olat.user.restapi.UserVO)10 LoginPage (org.olat.selenium.page.LoginPage)8 NavigationPage (org.olat.selenium.page.NavigationPage)8 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)8 File (java.io.File)6 URL (java.net.URL)6 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)6 By (org.openqa.selenium.By)6 WebElement (org.openqa.selenium.WebElement)6 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)4 MembersPage (org.olat.selenium.page.course.MembersPage)4 Calendar (java.util.Calendar)2 Date (java.util.Date)2 MenuTreePageFragment (org.olat.selenium.page.core.MenuTreePageFragment)2 AssessmentModePage (org.olat.selenium.page.course.AssessmentModePage)2