Search in sources :

Example 1 with RepositoryEditDescriptionPage

use of org.olat.selenium.page.repository.RepositoryEditDescriptionPage in project OpenOLAT by OpenOLAT.

the class CourseTest method createCourse_withWizard.

/**
 * Create a course, use the course wizard, select all course
 * elements and go further with the standard settings.
 *
 * Go from the description editor to the course, check
 * that the course is automatically published and that
 * the five course elements are there.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourse_withWizard(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Create-Course-Wizard-" + UUID.randomUUID().toString();
    // create course
    CourseWizardPage courseWizard = authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateFormAndStartWizard(title);
    courseWizard.selectAllCourseElements().nextNodes().nextCatalog().finish();
    // OOGraphene.closeErrorBox(browser);//STMP error
    RepositoryEditDescriptionPage editDescription = new RepositoryEditDescriptionPage(browser);
    // from description editor, back to details and launch the course
    editDescription.assertOnGeneralTab();
    // close mail error
    OOGraphene.closeErrorBox(browser);
    editDescription.clickToolbarBack();
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    course.assertOnCoursePage().assertOnTitle(title);
    // assert the 5 nodes are there and click them
    By nodeBy = By.cssSelector("span.o_tree_link.o_tree_l1.o_tree_level_label_leaf>a");
    List<WebElement> nodes = browser.findElements(nodeBy);
    Assert.assertEquals(5, nodes.size());
    for (WebElement node : nodes) {
        node.click();
        OOGraphene.waitBusy(browser);
    }
}
Also used : UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) CourseWizardPage(org.olat.selenium.page.course.CourseWizardPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) By(org.openqa.selenium.By) WebElement(org.openqa.selenium.WebElement) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 2 with RepositoryEditDescriptionPage

use of org.olat.selenium.page.repository.RepositoryEditDescriptionPage in project OpenOLAT by OpenOLAT.

the class CourseTest method createCourse.

/**
 * An author create a course, jump to it, open the editor
 * add an info messages course element, publish the course
 * and view it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourse(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Create-Selen-" + UUID.randomUUID();
    // create course
    RepositoryEditDescriptionPage editDescription = authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab();
    // from description editor, back to the course
    editDescription.clickToolbarBack();
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit();
    // create a course element of type info messages
    PublisherPageFragment publisher = editor.assertOnEditor().createNode("info").publish();
    // publish
    publisher.assertOnPublisher().nextSelectNodes().selectAccess(UserAccess.guest).nextAccess().selectCatalog(false).nextCatalog().finish();
    // back to the course
    CoursePageFragment publishedCourse = editor.clickToolbarBack();
    // review the course
    publishedCourse.assertOnCoursePage().clickTree();
}
Also used : 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) PublisherPageFragment(org.olat.selenium.page.course.PublisherPageFragment) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 3 with RepositoryEditDescriptionPage

use of org.olat.selenium.page.repository.RepositoryEditDescriptionPage in project OpenOLAT by OpenOLAT.

the class CourseElementTest method courseWithSCORM_fullAuto.

/**
 * This test an edge case where a course start automatically its first
 *  course element, which is a structure node which start itself its first
 *  element, which is a SCORM which launch itself automatically.
 *
 * @param loginPage
 */
@Test
@RunAsClient
public void courseWithSCORM_fullAuto(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    URL zipUrl = JunitTestHelper.class.getResource("file_resources/scorm/SCORM_course_full_auto.zip");
    File zipFile = new File(zipUrl.toURI());
    // go the authoring environment to import our course
    String zipTitle = "SCORM - " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().uploadResource(zipTitle, zipFile);
    // publish the course
    new RepositoryEditDescriptionPage(browser).clickToolbarBack();
    CoursePageFragment.getCourse(browser).edit().autoPublish();
    // scorm is auto started -> back
    ScormPage.getScormPage(browser).back();
    // log out
    new UserToolsPage(browser).logout();
    // log in and resume test
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // direct jump in SCORM content
    ScormPage.getScormPage(browser).passVerySimpleScorm().back().assertOnScormPassed().assertOnScormScore(33);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 4 with RepositoryEditDescriptionPage

use of org.olat.selenium.page.repository.RepositoryEditDescriptionPage in project openolat by klemens.

the class CourseElementTest method courseWithSCORM_fullAuto.

/**
 * This test an edge case where a course start automatically its first
 *  course element, which is a structure node which start itself its first
 *  element, which is a SCORM which launch itself automatically.
 *
 * @param loginPage
 */
@Test
@RunAsClient
public void courseWithSCORM_fullAuto(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    URL zipUrl = JunitTestHelper.class.getResource("file_resources/scorm/SCORM_course_full_auto.zip");
    File zipFile = new File(zipUrl.toURI());
    // go the authoring environment to import our course
    String zipTitle = "SCORM - " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().uploadResource(zipTitle, zipFile);
    // publish the course
    new RepositoryEditDescriptionPage(browser).clickToolbarBack();
    CoursePageFragment.getCourse(browser).edit().autoPublish();
    // scorm is auto started -> back
    ScormPage.getScormPage(browser).back();
    // log out
    new UserToolsPage(browser).logout();
    // log in and resume test
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // direct jump in SCORM content
    ScormPage.getScormPage(browser).passVerySimpleScorm().back().assertOnScormPassed().assertOnScormScore(33);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 5 with RepositoryEditDescriptionPage

use of org.olat.selenium.page.repository.RepositoryEditDescriptionPage in project openolat by klemens.

the class CourseTest method createCourse.

/**
 * An author create a course, jump to it, open the editor
 * add an info messages course element, publish the course
 * and view it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourse(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Create-Selen-" + UUID.randomUUID();
    // create course
    RepositoryEditDescriptionPage editDescription = authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab();
    // from description editor, back to the course
    editDescription.clickToolbarBack();
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit();
    // create a course element of type info messages
    PublisherPageFragment publisher = editor.assertOnEditor().createNode("info").publish();
    // publish
    publisher.assertOnPublisher().nextSelectNodes().selectAccess(UserAccess.guest).nextAccess().selectCatalog(false).nextCatalog().finish();
    // back to the course
    CoursePageFragment publishedCourse = editor.clickToolbarBack();
    // review the course
    publishedCourse.assertOnCoursePage().clickTree();
}
Also used : 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) PublisherPageFragment(org.olat.selenium.page.course.PublisherPageFragment) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) 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)8 Test (org.junit.Test)8 RepositoryEditDescriptionPage (org.olat.selenium.page.repository.RepositoryEditDescriptionPage)8 UserRestClient (org.olat.test.rest.UserRestClient)8 UserVO (org.olat.user.restapi.UserVO)8 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)6 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)6 File (java.io.File)2 URL (java.net.URL)2 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)2 CourseWizardPage (org.olat.selenium.page.course.CourseWizardPage)2 PublisherPageFragment (org.olat.selenium.page.course.PublisherPageFragment)2 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)2 By (org.openqa.selenium.By)2 WebElement (org.openqa.selenium.WebElement)2