コード例 #1
0
  @Override
  public void testAddQuestionAction() throws Exception {
    ______TS("NUMSCALE: add question action success");

    assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1));
    feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion();
    feedbackEditPage.selectRecipientsToBeStudents();
    feedbackEditPage.clickAddQuestionButton();
    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_ADDED);
    assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1));
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackNumScaleQuestionAddSuccess.html");
  }
コード例 #2
0
  @Override
  public void testAddQuestionAction() throws Exception {
    ______TS("RUBRIC: add question action success");

    feedbackEditPage.clickNewQuestionButton();
    feedbackEditPage.selectNewQuestionType("RUBRIC");
    feedbackEditPage.fillNewQuestionBox("RUBRIC qn");
    feedbackEditPage.fillNewQuestionDescription("more details");
    assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1));
    feedbackEditPage.clickAddQuestionButton();
    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_ADDED);
    assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1));
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionAddSuccess.html");
  }
コード例 #3
0
  @Override
  public void testEditQuestionAction() throws Exception {
    ______TS("NUMSCALE: edit question success");

    feedbackEditPage.clickEditQuestionButton(1);
    feedbackEditPage.fillEditQuestionBox("edited numscale qn text", 1);
    feedbackEditPage.fillEditQuestionDescription("more details", 1);
    feedbackEditPage.fillMinNumScaleBox(3, 1);
    feedbackEditPage.fillMaxNumScaleBox(4, 1);
    feedbackEditPage.fillStepNumScaleBox(0.002, 1);
    assertEquals(
        "[Based on the above settings, acceptable responses are: 3, 3.002, 3.004, ..., 3.996, 3.998, 4]",
        feedbackEditPage.getNumScalePossibleValuesString(1));
    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED);

    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackNumScaleQuestionEditSuccess.html");
  }
コード例 #4
0
  @Override
  public void testEditQuestionAction() throws Exception {
    ______TS("RUBRIC: edit question success");

    // Click edit button
    feedbackEditPage.clickEditQuestionButton(1);

    // Check that fields are editable
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEdit.html");

    feedbackEditPage.fillEditQuestionBox("edited RUBRIC qn text", 1);
    feedbackEditPage.fillEditQuestionDescription("more details", 1);
    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED);

    // Check question text is updated
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditSuccess.html");

    ______TS("RUBRIC: edit sub-questions success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit sub-question for row 1
    feedbackEditPage.fillRubricSubQuestionBox("New(0) sub-question text", 1, 0);

    // Add new sub-question
    feedbackEditPage.clickAddRubricRowLink(1);
    feedbackEditPage.fillRubricSubQuestionBox("New(1) sub-question text", 1, 2);

    // Remove existing sub-questions
    feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 0);
    feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 1);

    // Add new sub-question
    feedbackEditPage.clickAddRubricRowLink(1);
    feedbackEditPage.fillRubricSubQuestionBox("New(2) sub-question text", 1, 3);

    // Remove new sub-question
    feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 2);

    // Should end up with 1 question

    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditSubQuestionSuccess.html");

    ______TS("RUBRIC: edit choices success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit choice for col 1
    feedbackEditPage.fillRubricChoiceBox("New(0) choice", 1, 0);

    // Add new choice
    feedbackEditPage.clickAddRubricColLink(1);
    feedbackEditPage.fillRubricChoiceBox("New(1) choice", 1, 4);

    // Remove existing choice
    feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 0);

    // Add new choice
    feedbackEditPage.clickAddRubricColLink(1);
    feedbackEditPage.fillRubricChoiceBox("New(2) choice", 1, 5);

    // Remove new choice
    feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 4);

    // Should end up with 4 choices, including (1) and (2)

    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditChoiceSuccess.html");

    ______TS("RUBRIC: edit weight success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit the weight of the first choice
    feedbackEditPage.clickAssignWeightsCheckbox(1);
    feedbackEditPage.fillRubricWeightBox("2.25", 1, 0);

    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditWeightSuccess.html");

    ______TS("RUBRIC: edit descriptions success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit description for 0-0
    feedbackEditPage.fillRubricDescriptionBox("New(0) description", 1, 0, 0);

    // Edit description for a new row, to test if the js generated html works.
    feedbackEditPage.clickAddRubricRowLink(1);
    feedbackEditPage.fillRubricSubQuestionBox("New sub-question text", 1, 1);

    feedbackEditPage.fillRubricDescriptionBox("New(1) description", 1, 1, 0);

    // Should end up with 2 rubric descriptions, (0) and (1)

    feedbackEditPage.clickSaveExistingQuestionButton(1);

    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditDescriptionSuccess.html");
  }
コード例 #5
0
  @Test
  public void allTests() throws Exception {
    feedbackEditPage = getFeedbackEditPage();

    ______TS("Submit empty course list");
    feedbackEditPage.clickFsCopyButton();
    feedbackEditPage.getFsCopyToModal().waitForModalToLoad();

    // Full HTML verification already done in InstructorFeedbackEditPageUiTest
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditCopyPage.html");

    feedbackEditPage.getFsCopyToModal().clickSubmitButton();
    feedbackEditPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence();
    assertTrue(feedbackEditPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible());
    feedbackEditPage
        .getFsCopyToModal()
        .verifyStatusMessage(Const.StatusMessages.FEEDBACK_SESSION_COPY_NONESELECTED);

    feedbackEditPage.getFsCopyToModal().clickCloseButton();

    ______TS("Copying fails due to fs with same name in course selected");
    feedbackEditPage.clickFsCopyButton();
    feedbackEditPage.getFsCopyToModal().waitForModalToLoad();
    feedbackEditPage.getFsCopyToModal().fillFormWithAllCoursesSelected(feedbackSessionName);

    feedbackEditPage.getFsCopyToModal().clickSubmitButton();
    feedbackEditPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence();
    assertTrue(feedbackEditPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible());

    feedbackEditPage
        .getFsCopyToModal()
        .verifyStatusMessage(
            String.format(
                Const.StatusMessages.FEEDBACK_SESSION_COPY_ALREADYEXISTS,
                feedbackSessionName,
                testData.courses.get("course").getId()));

    // Full HTML verification already done in InstructorFeedbackEditPageUiTest
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditCopyFail.html");

    feedbackEditPage.getFsCopyToModal().clickCloseButton();

    ______TS("Copying fails due to fs with invalid name");
    feedbackEditPage.clickFsCopyButton();
    feedbackEditPage.getFsCopyToModal().waitForModalToLoad();
    feedbackEditPage
        .getFsCopyToModal()
        .fillFormWithAllCoursesSelected("Invalid name | for feedback session");

    feedbackEditPage.getFsCopyToModal().clickSubmitButton();

    feedbackEditPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence();
    assertTrue(feedbackEditPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible());
    feedbackEditPage
        .getFsCopyToModal()
        .verifyStatusMessage(
            "\"Invalid name | for feedback session\" is not acceptable to TEAMMATES as "
                + "feedback session name because it contains invalid characters. "
                + "All feedback session name must start with an alphanumeric character, "
                + "and cannot contain any vertical bar (|) or percent sign (%).");

    feedbackEditPage.getFsCopyToModal().clickCloseButton();

    ______TS("Successful case");
    feedbackEditPage.clickFsCopyButton();
    feedbackEditPage.getFsCopyToModal().waitForModalToLoad();
    feedbackEditPage.getFsCopyToModal().fillFormWithAllCoursesSelected("New name!");

    feedbackEditPage.getFsCopyToModal().clickSubmitButton();
    feedbackEditPage.waitForPageToLoad();

    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_COPIED);
    feedbackEditPage.waitForElementPresence(By.id("table-sessions"));

    // Full HTML verification already done in InstructorFeedbackEditPageUiTest
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditCopySuccess.html");
  }