use of org.olat.selenium.page.course.CourseEditorPageFragment 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);
}
Aggregations