Search in sources :

Example 51 with UserRestClient

use of org.olat.test.rest.UserRestClient in project OpenOLAT by OpenOLAT.

the class ImsQTI21InteractionsTest method qti21AssociateInteraction.

/**
 * Check if the associate interaction return its 4 points.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21AssociateInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // upload a test
    String qtiTestTitle = "Associate QTI 2.1 " + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_associate_ims.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
    QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
    qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
    // to the test and spot it
    qtiPage.clickToolbarBack().assertOnAssessmentItem().answerAssociate("Antonio", 1, true).answerAssociate("Prospero", 1, false).answerAssociate("Capulet", 2, true).answerAssociate("Montague", 2, false).answerAssociate("Demetrius", 3, true).answerAssociate("Lysander", 3, false).saveAnswer().endTest().closeTest();
    // check the results
    qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Shakespearian Rivals", 4);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 52 with UserRestClient

use of org.olat.test.rest.UserRestClient in project OpenOLAT by OpenOLAT.

the class ImsQTI21InteractionsTest method qti21HotspotInteraction.

/**
 * Check if the hotspot interaction send a "correct" feedback.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21HotspotInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // upload a test
    String qtiTestTitle = "Hotspot QTI 2.1 " + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_hotspot.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
    QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
    qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
    // to the test and spot it
    qtiPage.clickToolbarBack().assertOnAssessmentItem().answerHotspot("circle").saveAnswer().assertFeedback("Correct!").endTest();
    // check the results
    qtiPage.assertOnAssessmentResults().assertOnAssessmentTestScore(1).assertOnAssessmentTestMaxScore(1);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 53 with UserRestClient

use of org.olat.test.rest.UserRestClient in project OpenOLAT by OpenOLAT.

the class ImsQTI21InteractionsTest method qti21OrderInteraction.

/**
 * Check if the order interaction return its 1 point.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21OrderInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // upload a test
    String qtiTestTitle = "Order QTI 2.1 " + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_order_ims.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
    QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
    qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
    // to the test and spot it
    qtiPage.clickToolbarBack().assertOnAssessmentItem().answerOrderDropItem("Jenson").answerOrderDropItem("Rubens").answerOrderDropItem("Michael").saveAnswer().endTest().closeTest();
    // check the results
    qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Grand Prix of Bahrain", 1);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 54 with UserRestClient

use of org.olat.test.rest.UserRestClient in project OpenOLAT by OpenOLAT.

the class ImsQTI21InteractionsTest method qti21GraphicGapInteraction.

/**
 * Check if hint with modal and inline feedbacks used
 * with choice interaction.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21GraphicGapInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // upload a test
    String qtiTestTitle = "Graphic Gap Match QTI 2.1 " + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_graphic_gap_match_ims.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
    QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
    qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
    // to the test and spot it
    qtiPage.clickToolbarBack().assertOnAssessmentItem().answerGraphicGapClick("GLA", "A").answerGraphicGapClick("EDI", "B").answerGraphicGapClick("MAN", "C").saveAnswer().endTest().closeTest();
    // check the results
    qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Airport Tags", 3);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 55 with UserRestClient

use of org.olat.test.rest.UserRestClient in project OpenOLAT by OpenOLAT.

the class ImsQTI21InteractionsTest method qti21InlineChoiceInteraction.

/**
 * Check if the position object interaction returns 3 points
 * if answered correctly.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21InlineChoiceInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // upload a test
    String qtiTestTitle = "Inline choice QTI 2.1 " + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_inline_choice_ims.zip");
    File qtiTestFile = new File(qtiTestUrl.toURI());
    navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
    QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
    qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
    // to the test and spot it
    qtiPage.clickToolbarBack().assertOnAssessmentItem().answerInlineChoice("Y").saveAnswer().endTest().closeTest();
    // check the results
    qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Richard III", 1);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)258 UserRestClient (org.olat.test.rest.UserRestClient)258 UserVO (org.olat.user.restapi.UserVO)258 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)254 NavigationPage (org.olat.selenium.page.NavigationPage)110 LoginPage (org.olat.selenium.page.LoginPage)108 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)102 QTI21Page (org.olat.selenium.page.qti.QTI21Page)96 URL (java.net.URL)88 File (java.io.File)86 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)84 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)62 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)46 WebElement (org.openqa.selenium.WebElement)46 MembersPage (org.olat.selenium.page.course.MembersPage)36 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)34 GroupPage (org.olat.selenium.page.group.GroupPage)22 BinderPage (org.olat.selenium.page.portfolio.BinderPage)12 PortfolioV2HomePage (org.olat.selenium.page.portfolio.PortfolioV2HomePage)12 By (org.openqa.selenium.By)12