Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 15... Línea 15...
15
      | teacher2 | C1     | editingteacher |
15
      | teacher2 | C1     | editingteacher |
16
    And the following "activities" exist:
16
    And the following "activities" exist:
17
      | activity | name      | course | idnumber |
17
      | activity | name      | course | idnumber |
18
      | quiz     | Test quiz | C1     | quiz1    |
18
      | quiz     | Test quiz | C1     | quiz1    |
19
    And the following "question categories" exist:
19
    And the following "question categories" exist:
20
      | contextlevel | reference | name           |
20
      | contextlevel    | reference | name           |
21
      | Course       | C1        | Test questions |
21
      | Activity module | quiz1     | Test questions |
22
    And the following "questions" exist:
22
    And the following "questions" exist:
23
      | questioncategory | qtype     | name           | questiontext              |
23
      | questioncategory | qtype     | name           | questiontext              |
24
      | Test questions   | truefalse | First question | Answer the first question |
24
      | Test questions   | truefalse | First question | Answer the first question |
Línea 25... Línea 25...
25
 
25
 
26
  @javascript
26
  @javascript
27
  Scenario: Add a comment in question
27
  Scenario: Add a comment in question
28
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
28
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
29
    And I apply question bank filter "Category" with value "Test questions"
29
    And I apply question bank filter "Category" with value "Test questions"
-
 
30
    And "0" "qbank_comment > Comment count link" should exist
30
    And I should see "0" on the comments column
31
    And "1" "qbank_comment > Comment count link" should not exist
31
    When I click "0" on the row on the comments column
32
    And I click on "0" "qbank_comment > Comment count link"
32
    And I add "Super test comment 01" comment to question
33
    And I add "Super test comment 01" comment to question
33
    And I click on "Add comment" "button" in the ".modal-dialog" "css_element"
34
    And I click on "Add comment" "button" in the ".modal-dialog" "css_element"
34
    And I should see "Super test comment 01"
35
    And I should see "Super test comment 01"
35
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
36
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
-
 
37
    And "1" "qbank_comment > Comment count link" should exist
Línea 36... Línea 38...
36
    Then I should see "1" on the comments column
38
    And "0" "qbank_comment > Comment count link" should not exist
37
 
39
 
38
  @javascript
40
  @javascript
39
  Scenario: Delete a comment from question
41
  Scenario: Delete a comment from question
40
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
42
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
-
 
43
    And I apply question bank filter "Category" with value "Test questions"
41
    And I apply question bank filter "Category" with value "Test questions"
44
    And "0" "qbank_comment > Comment count link" should exist
42
    And I should see "0" on the comments column
45
    And "1" "qbank_comment > Comment count link" should not exist
43
    When I click "0" on the row on the comments column
46
    And I click on "0" "qbank_comment > Comment count link"
44
    And I add "Super test comment 01 to be deleted" comment to question
47
    And I add "Super test comment 01 to be deleted" comment to question
45
    And I click on "Add comment" "button" in the ".modal-dialog" "css_element"
48
    And I click on "Add comment" "button" in the ".modal-dialog" "css_element"
46
    And I should see "Super test comment 01 to be deleted"
49
    And I should see "Super test comment 01 to be deleted"
-
 
50
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
47
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
51
    And "1" "qbank_comment > Comment count link" should exist
48
    Then I should see "1" on the comments column
52
    And "0" "qbank_comment > Comment count link" should not exist
49
    And I click "1" on the row on the comments column
53
    And I click on "1" "qbank_comment > Comment count link"
50
    And I delete "Super test comment 01 to be deleted" comment from question
54
    And I delete "Super test comment 01 to be deleted" comment from question
51
    And I should not see "Super test comment 01 to be deleted"
55
    And I should not see "Super test comment 01 to be deleted"
-
 
56
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
Línea 52... Línea 57...
52
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
57
    And "0" "qbank_comment > Comment count link" should exist
53
    But I should see "0" on the comments column
58
    And "1" "qbank_comment > Comment count link" should not exist
54
 
59
 
55
  @javascript
60
  @javascript
Línea 62... Línea 67...
62
    And I add "Super test comment 01" comment to question preview
67
    And I add "Super test comment 01" comment to question preview
63
    And I click on "Save comment" "link"
68
    And I click on "Save comment" "link"
64
    And I wait "1" seconds
69
    And I wait "1" seconds
65
    Then I should see "Super test comment 01"
70
    Then I should see "Super test comment 01"
66
    And I click on "Close preview" "button"
71
    And I click on "Close preview" "button"
67
    Then I should see "1" on the comments column
72
    And "1" "qbank_comment > Comment count link" should exist
-
 
73
    And "0" "qbank_comment > Comment count link" should not exist
68
    And I choose "Preview" action for "First question" in the question bank
74
    And I choose "Preview" action for "First question" in the question bank
69
    And I click on "Comments" "link"
75
    And I click on "Comments" "link"
70
    And I delete "Super test comment 01" comment from question preview
76
    And I delete "Super test comment 01" comment from question preview
71
    And I should not see "Super test comment 01"
77
    And I should not see "Super test comment 01"
72
    And I click on "Close preview" "button"
78
    And I click on "Close preview" "button"
73
    Then I should see "0" on the comments column
79
    And "0" "qbank_comment > Comment count link" should exist
-
 
80
    And "1" "qbank_comment > Comment count link" should not exist
Línea 74... Línea 81...
74
 
81
 
75
  @javascript
82
  @javascript
76
  Scenario: Teacher with comment permissions for their own questions but not others questions
83
  Scenario: Teacher with comment permissions for their own questions but not others questions
77
    Given the following "role capability" exists:
84
    Given the following "role capability" exists:
Línea 107... Línea 114...
107
  @javascript
114
  @javascript
108
  Scenario: Comments added from the quiz page are visible
115
  Scenario: Comments added from the quiz page are visible
109
    Given I am on the "Test quiz" "mod_quiz > edit" page logged in as "teacher1"
116
    Given I am on the "Test quiz" "mod_quiz > edit" page logged in as "teacher1"
110
    And I press "Add"
117
    And I press "Add"
111
    And I follow "from question bank"
118
    And I follow "from question bank"
-
 
119
    And I apply question bank filter "Category" with value "Test questions"
112
    And I click on "Select" "checkbox" in the "First question" "table_row"
120
    And I click on "Select" "checkbox" in the "First question" "table_row"
113
    And I click on "Add selected questions to the quiz" "button"
121
    And I click on "Add selected questions to the quiz" "button"
114
    And I click on "Preview question" "link"
122
    And I click on "Preview question" "link"
115
    And I switch to "questionpreview" window
123
    And I switch to "questionpreview" window
116
    And I press "Comments"
124
    And I press "Comments"
117
    And I set the field "content" to "Some new comment"
125
    And I set the field "content" to "Some new comment"
118
    And I click on "Save comment" "link"
126
    And I click on "Save comment" "link"
119
    And I should see "Some new comment"
127
    And I should see "Some new comment"
120
    And I switch to the main window
128
    And I switch to the main window
121
    And I am on the "Test quiz" "mod_quiz > question bank" page
129
    And I am on the "Test quiz" "mod_quiz > question bank" page
-
 
130
    And I apply question bank filter "Category" with value "Test questions"
122
    And I choose "Preview" action for "First question" in the question bank
131
    And I choose "Preview" action for "First question" in the question bank
123
    And I click on "Comments" "link"
132
    And I click on "Comments" "link"
124
    And I should see "Some new comment"
133
    And I should see "Some new comment"
125
    And I should see "T1 Teacher1"
134
    And I should see "T1 Teacher1"
126
    And I delete "Some new comment" comment from question preview
135
    And I delete "Some new comment" comment from question preview
Línea 131... Línea 140...
131
    And I press "Comments"
140
    And I press "Comments"
132
    Then I should not see "Some new comment"
141
    Then I should not see "Some new comment"
Línea 133... Línea 142...
133
 
142
 
134
  @javascript
143
  @javascript
135
  Scenario: Comments modal can change the version using dropdown
-
 
136
    Given I log in as "teacher1"
144
  Scenario: Comments modal can change the version using dropdown
137
    And I am on the "Test quiz" "quiz activity" page
145
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
138
    When I navigate to "Question bank" in current page administration
146
    And I apply question bank filter "Category" with value "Test questions"
139
    And I should see "First question"
147
    And I should see "First question"
140
    And I choose "Edit question" action for "First question" in the question bank
148
    And I choose "Edit question" action for "First question" in the question bank
141
    And I set the field "id_name" to "Renamed question v2"
149
    And I set the field "id_name" to "Renamed question v2"
142
    And I set the field "id_questiontext" to "edited question"
150
    And I set the field "id_questiontext" to "edited question"
143
    And I press "id_submitbutton"
151
    And I press "id_submitbutton"
144
    And I should not see "First question"
152
    And I should not see "First question"
145
    And I should see "Renamed question v2"
153
    And I should see "Renamed question v2"
146
    And I click "0" on the row on the comments column
154
    And I click on "0" "qbank_comment > Comment count link"
147
    And I should see "Version 2"
155
    And I should see "Version 2"
148
    Then I should see "edited question"
156
    Then I should see "edited question"
149
    And I should see "Version 1"
157
    And I should see "Version 1"
150
    And I set the field "question_version_dropdown" to "Version 1"
158
    And I set the field "question_version_dropdown" to "Version 1"
-
 
159
    And I should see "Answer the first question"
-
 
160
 
-
 
161
  @javascript
-
 
162
  Scenario: User without system moodle/comment:post capability cannot post comments on question
-
 
163
    Given the following "role capability" exists:
-
 
164
      | role                            | user     |
-
 
165
      | moodle/comment:post             | prohibit |
-
 
166
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
-
 
167
    And I apply question bank filter "Category" with value "Test questions"
-
 
168
    And "0" "qbank_comment > Comment count text" should exist