use of org.olat.selenium.page.NavigationPage 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();
}
use of org.olat.selenium.page.NavigationPage in project openolat by klemens.
the class BusinessGroupTest method createGroupWithWaitingList.
/**
* An author creates a group, it opens the tab groups and then "My groups". It
* creates a group, enters a number of participants "1", enable the waiting
* list. In members visibility, it see coaches, participants and waiting
* list visible to members.<br>
* A participant and than a student come, book the group. The first enters
* the group, the second the waiting list.<br>
* The author go in the members list to check if it's in the coach list,
* the participant in the participants list and the student in the waiting
* list.
*
* Should show group starting page, with menu items Administration and Bookings visible
*
* @param loginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createGroupWithWaitingList(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantBrowser, @Drone @Student WebDriver studentBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createRandomUser("Selena");
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
UserVO student = new UserRestClient(deploymentUrl).createRandomUser("Asuka");
loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
// go to groups
String groupName = "Group-1-" + UUID.randomUUID();
GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A group with a waiting list").openAdministration().openEditDetails().setMaxNumberOfParticipants(1).setWaitingList().saveDetails();
// add booking ( token one )
String token = "secret";
String description = "The password is secret";
group.openBookingConfig().openAddDropMenu().addTokenMethod().configureTokenMethod(token, description).assertOnToken(token);
// members see members
group = GroupPage.getGroup(browser).openAdminMembers().setVisibility(true, true, true).openMembers();
// participant search published groups
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
// tools
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
// groups
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openGroups(participantBrowser).publishedGroups().bookGroup(groupName).bookToken(token);
// are we that we are in the right group?
GroupPage.getGroup(participantBrowser).assertOnInfosPage(groupName);
// student search published groups
LoginPage studentLoginPage = LoginPage.getLoginPage(studentBrowser, deploymentUrl);
// tools
studentLoginPage.loginAs(student.getLogin(), student.getPassword()).resume();
// groups
NavigationPage studentNavBar = new NavigationPage(studentBrowser);
studentNavBar.openGroups(studentBrowser).publishedGroups().bookGroup(groupName).bookToken(token);
// are we that we are in the right group?
GroupPage.getGroup(studentBrowser).assertOnWaitingList(groupName);
group = GroupPage.getGroup(browser).openMembers().assertMembersInOwnerList(author).assertMembersInParticipantList(participant).assertMembersInWaitingList(student);
}
use of org.olat.selenium.page.NavigationPage in project openolat by klemens.
the class BusinessGroupTest method enrollment.
/**
* An author create a course and a business group in the members
* management. It has max. participants set to 1 and no waiting list.
* Than it returns in the course editor to create an enrollment
* course element. It configure it and select the group created before.<br>
*
* Three users goes to the course and try to enroll. One will become
* a participant, the 2 others get an error message.
*
* @param authorLoginPage
* @param ryomouBrowser
* @param reiBrowser
* @param kanuBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void enrollment(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
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 = "Enrollment-2-" + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// create a group in members management
String groupName = "Enroll - " + UUID.randomUUID();
CoursePageFragment authorCourse = CoursePageFragment.getCourse(browser);
MembersPage membersPage = authorCourse.members().selectBusinessGroups().createBusinessGroup(groupName, "-", 1, false, false);
// back to the members page
navBar.openCourse(courseTitle);
authorCourse = membersPage.clickToolbarBack();
// create an enrollment course element
String enNodeTitle = "Enroll - 2";
CourseEditorPageFragment courseEditor = authorCourse.edit().createNode("en").nodeTitle(enNodeTitle);
// select the group created above
EnrollmentConfigurationPage enrolmentConfig = new EnrollmentConfigurationPage(browser);
enrolmentConfig.selectConfiguration().selectBusinessGroups();
// publish the course
courseEditor.publish().quickPublish(UserAccess.registred);
GroupPage authorGroup = navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(false, true, false).openMembers().assertParticipantList();
Enrollment[] participantDrivers = new Enrollment[] { new Enrollment(ryomou, ryomouBrowser), new Enrollment(rei, reiBrowser), new Enrollment(kanu, kanuBrowser) };
for (Enrollment enrollment : participantDrivers) {
WebDriver driver = enrollment.getDriver();
LoginPage.getLoginPage(driver, deploymentUrl).loginAs(enrollment.getUser()).resume();
NavigationPage participantNavBar = new NavigationPage(driver);
participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
// go to the enrollment
CoursePageFragment participantCourse = new CoursePageFragment(driver);
participantCourse.clickTree().selectWithTitle(enNodeTitle);
EnrollmentPage enrollmentPage = new EnrollmentPage(driver);
enrollmentPage.assertOnEnrolmentPage();
enrollment.setEnrollmentPage(enrollmentPage);
}
// enroll
for (Enrollment enrollment : participantDrivers) {
enrollment.getEnrollmentPage().enrollNoWait();
}
// wait
for (Enrollment enrollment : participantDrivers) {
OOGraphene.waitBusy(enrollment.getDriver());
}
int errors = 0;
for (Enrollment enrollment : participantDrivers) {
if (enrollment.getEnrollmentPage().hasError()) {
errors++;
}
}
// author check the lists
authorGroup.openMembers();
// must a participant and 2 in waiting list
int participants = 0;
for (Enrollment enrollment : participantDrivers) {
if (authorGroup.isInMembersParticipantList(enrollment.getUser())) {
participants++;
}
}
Assert.assertEquals(1, participants);
Assert.assertEquals(participantDrivers.length - 1, errors);
}
use of org.olat.selenium.page.NavigationPage in project openolat by klemens.
the class BusinessGroupTest method groupMembersVisibility.
/**
* An author create a group, set the visibility to
* show owners and participants. Add a member to the
* group.
*
* The participant log in, search the group and open it.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void groupMembersVisibility(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createRandomUser("Selena");
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Aoi");
loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
// go to groups
String groupName = "Group-1-" + UUID.randomUUID();
GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A very little group");
MembersWizardPage members = group.openAdministration().openAdminMembers().setVisibility(true, true, false).addMember();
members.searchMember(participant, false).nextUsers().nextOverview().nextPermissions().finish();
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
// tools
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openGroups(participantBrowser).selectGroup(groupName);
WebElement contentEl = participantBrowser.findElement(By.id("o_main_center_content_inner"));
String content = contentEl.getText();
Assert.assertTrue(content.contains(groupName));
}
use of org.olat.selenium.page.NavigationPage in project openolat by klemens.
the class CourseElementTest method forumConcurrent.
/**
* An author creates a course with a forum, publish it, open a new thread.
* A first user come to see the thread. A second come via the peekview.
* The three make a reply at the same time. And they check that they see
* the replies, and the ones of the others.
*
* @param loginPage
* @param kanuBrowser
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void forumConcurrent(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver kanuBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
loginPage.loginAs(author.getLogin(), author.getPassword());
// create a course
String courseTitle = "Course FO " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
// go the authoring environment to create a forum
String foTitle = "FO - " + UUID.randomUUID();
CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
courseEditor.createNode("fo").nodeTitle(foTitle).publish().quickPublish(UserAccess.registred);
// go to the forum
courseEditor.clickToolbarBack().clickTree().selectWithTitle(foTitle.substring(0, 20));
ForumPage authorForum = ForumPage.getCourseForumPage(browser);
authorForum.createThread("The best anime ever", "What is the best anime ever?", null);
// First user go to the course
LoginPage kanuLoginPage = LoginPage.getLoginPage(kanuBrowser, deploymentUrl);
kanuLoginPage.loginAs(kanu.getLogin(), kanu.getPassword()).resume();
NavigationPage kanuNavBar = new NavigationPage(kanuBrowser);
kanuNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
// go to the forum
new CoursePageFragment(kanuBrowser).clickTree().selectWithTitle(foTitle.substring(0, 20));
ForumPage kanuForum = ForumPage.getCourseForumPage(kanuBrowser).openThread("The best anime ever");
// First user go to the course
LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
reiLoginPage.loginAs(rei).resume();
NavigationPage reiNavBar = new NavigationPage(reiBrowser);
reiNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
// select the thread in peekview
ForumPage reiForum = new ForumPage(reiBrowser).openThreadInPeekview("The best anime ever");
// concurrent reply
String kanuReply = "Ikki Touzen";
String reiReply = "Neon Genesis Evangelion";
String authorReply = "Lain, serial experiment";
authorForum.replyToMessageNoWait("The best anime ever", null, authorReply);
reiForum.replyToMessageNoWait("The best anime ever", null, reiReply);
kanuForum.replyToMessageNoWait("The best anime ever", null, kanuReply);
// wait the responses
OOGraphene.waitBusy(browser);
OOGraphene.waitBusy(kanuBrowser);
OOGraphene.waitBusy(reiBrowser);
// check own responses
authorForum.assertMessageBody(authorReply);
kanuForum.assertMessageBody(kanuReply);
reiForum.assertMessageBody(reiReply);
// check others responses
authorForum.flatView().waitMessageBody(kanuReply);
reiForum.flatView().waitMessageBody(kanuReply);
kanuForum.flatView().waitMessageBody(reiReply);
}
Aggregations