Rev 1 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
@qbank @qbank_comment @javascriptFeature: A Teacher can comment in a questionBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | T1 | Teacher1 | teacher1@example.com || teacher2 | T2 | Teacher2 | teacher2@example.com |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || teacher2 | C1 | editingteacher |And the following "activities" exist:| activity | name | course | idnumber || quiz | Test quiz | C1 | quiz1 |And the following "question categories" exist:| contextlevel | reference | name || Activity module | quiz1 | Test questions |And the following "questions" exist:| questioncategory | qtype | name | questiontext || Test questions | truefalse | First question | Answer the first question |@javascriptScenario: Add a comment in questionGiven I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"And I apply question bank filter "Category" with value "Test questions"And "0" "qbank_comment > Comment count link" should existAnd "1" "qbank_comment > Comment count link" should not existAnd I click on "0" "qbank_comment > Comment count link"And I add "Super test comment 01" comment to questionAnd I click on "Add comment" "button" in the ".modal-dialog" "css_element"And I should see "Super test comment 01"And I click on "Close" "button" in the ".modal-dialog" "css_element"And "1" "qbank_comment > Comment count link" should existAnd "0" "qbank_comment > Comment count link" should not exist@javascriptScenario: Delete a comment from questionGiven I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"And I apply question bank filter "Category" with value "Test questions"And "0" "qbank_comment > Comment count link" should existAnd "1" "qbank_comment > Comment count link" should not existAnd I click on "0" "qbank_comment > Comment count link"And I add "Super test comment 01 to be deleted" comment to questionAnd I click on "Add comment" "button" in the ".modal-dialog" "css_element"And I should see "Super test comment 01 to be deleted"And I click on "Close" "button" in the ".modal-dialog" "css_element"And "1" "qbank_comment > Comment count link" should existAnd "0" "qbank_comment > Comment count link" should not existAnd I click on "1" "qbank_comment > Comment count link"And I delete "Super test comment 01 to be deleted" comment from questionAnd I should not see "Super test comment 01 to be deleted"And I click on "Close" "button" in the ".modal-dialog" "css_element"And "0" "qbank_comment > Comment count link" should existAnd "1" "qbank_comment > Comment count link" should not exist@javascriptScenario: Preview question with commentsGiven I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"And I apply question bank filter "Category" with value "Test questions"And I choose "Preview" action for "First question" in the question bankAnd I click on "Comments" "link"Then I should see "Save comment"And I add "Super test comment 01" comment to question previewAnd I click on "Save comment" "link"And I wait "1" secondsThen I should see "Super test comment 01"And I click on "Close preview" "button"And "1" "qbank_comment > Comment count link" should existAnd "0" "qbank_comment > Comment count link" should not existAnd I choose "Preview" action for "First question" in the question bankAnd I click on "Comments" "link"And I delete "Super test comment 01" comment from question previewAnd I should not see "Super test comment 01"And I click on "Close preview" "button"And "0" "qbank_comment > Comment count link" should existAnd "1" "qbank_comment > Comment count link" should not exist@javascriptScenario: Teacher with comment permissions for their own questions but not others questionsGiven the following "role capability" exists:| role | editingteacher || moodle/question:commentmine | allow || moodle/question:commentall | prevent |And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"And I apply question bank filter "Category" with value "Test questions"And I choose "Preview" action for "First question" in the question bankThen I should not see "Save comment"And I click on "Close preview" "button"Then I click on "Create a new question ..." "button"And I set the field "item_qtype_essay" to "1"And I press "submitbutton"Then I should see "Adding an Essay question"And I set the field "Question name" to "Essay 01 new"And I set the field "Question text" to "Please write 200 words about Essay 01"And I press "id_submitbutton"Then I should see "Essay 01 new"And I choose "Preview" action for "Essay 01 new" in the question bankAnd I click on "Comments" "link"Then I should see "Save comment"And I log outAnd I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher2"And I apply question bank filter "Category" with value "Test questions"And I choose "Preview" action for "First question" in the question bankThen I should not see "Save comment"And I click on "Close preview" "button"And I choose "Preview" action for "Essay 01 new" in the question bankThen I should not see "Save comment"And I click on "Close preview" "button"@javascriptScenario: Comments added from the quiz page are visibleGiven I am on the "Test quiz" "mod_quiz > edit" page logged in as "teacher1"And I press "Add"And I follow "from question bank"And I apply question bank filter "Category" with value "Test questions"And I click on "Select" "checkbox" in the "First question" "table_row"And I click on "Add selected questions to the quiz" "button"And I click on "Preview question" "link"And I switch to "questionpreview" windowAnd I press "Comments"And I set the field "content" to "Some new comment"And I click on "Save comment" "link"And I should see "Some new comment"And I switch to the main windowAnd I am on the "Test quiz" "mod_quiz > question bank" pageAnd I apply question bank filter "Category" with value "Test questions"And I choose "Preview" action for "First question" in the question bankAnd I click on "Comments" "link"And I should see "Some new comment"And I should see "T1 Teacher1"And I delete "Some new comment" comment from question previewAnd I should not see "Some new comment"And I am on the "Test quiz" "mod_quiz > edit" pageAnd I click on "Preview question" "link"And I switch to "questionpreview" windowAnd I press "Comments"Then I should not see "Some new comment"@javascriptScenario: Comments modal can change the version using dropdownGiven I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"And I apply question bank filter "Category" with value "Test questions"And I should see "First question"And I choose "Edit question" action for "First question" in the question bankAnd I set the field "id_name" to "Renamed question v2"And I set the field "id_questiontext" to "edited question"And I press "id_submitbutton"And I should not see "First question"And I should see "Renamed question v2"And I click on "0" "qbank_comment > Comment count link"And I should see "Version 2"Then I should see "edited question"And I should see "Version 1"And I set the field "question_version_dropdown" to "Version 1"And I should see "Answer the first question"@javascriptScenario: User without system moodle/comment:post capability cannot post comments on questionGiven the following "role capability" exists:| role | user || moodle/comment:post | prohibit |Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"And I apply question bank filter "Category" with value "Test questions"And "0" "qbank_comment > Comment count text" should existAnd "0" "qbank_comment > Comment count link" should not exist