Search in sources :

Example 1 with BulkAssessmentData

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

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 2 with BulkAssessmentData

use of org.olat.selenium.page.course.BulkAssessmentPage.BulkAssessmentData 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)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)2 Test (org.junit.Test)2 LoginPage (org.olat.selenium.page.LoginPage)2 NavigationPage (org.olat.selenium.page.NavigationPage)2 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)2 BulkAssessmentData (org.olat.selenium.page.course.BulkAssessmentPage.BulkAssessmentData)2 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)2 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)2 MembersPage (org.olat.selenium.page.course.MembersPage)2 UserRestClient (org.olat.test.rest.UserRestClient)2 UserVO (org.olat.user.restapi.UserVO)2 WebElement (org.openqa.selenium.WebElement)2