Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 23... Línea 23...
23
 
23
 
24
  @javascript @external
24
  @javascript @external
25
  Scenario: TinyMCE can be used to embed an H5P activity
25
  Scenario: TinyMCE can be used to embed an H5P activity
26
    Given I change window size to "large"
26
    Given I change window size to "large"
27
    And I am on the PageName1 "page activity editing" page logged in as admin
27
    And I am on the PageName1 "page activity editing" page logged in as admin
28
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
28
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
29
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
29
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
30
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
30
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
31
    When I click on "Save and display" "button"
31
    When I click on "Save and display" "button"
32
    Then ".h5p-placeholder" "css_element" should exist
32
    Then ".h5p-placeholder" "css_element" should exist
Línea 38... Línea 38...
38
    Given the following "user private file" exists:
38
    Given the following "user private file" exists:
39
      | user     | admin                                   |
39
      | user     | admin                                   |
40
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
40
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
41
    And I change window size to "large"
41
    And I change window size to "large"
42
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
42
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
43
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
43
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
44
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
44
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
45
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
45
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
46
    And I click on "guess-the-answer.h5p" "link"
46
    And I click on "guess-the-answer.h5p" "link"
47
    And I click on "Select this file" "button"
47
    And I click on "Select this file" "button"
48
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
48
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
49
    When I click on "Save and display" "button"
49
    When I click on "Save and display" "button"
50
    Then ".h5p-placeholder" "css_element" should exist
50
    Then ".h5p-placeholder" "css_element" should exist
Línea 51... Línea 51...
51
 
51
 
52
  @javascript
52
  @javascript
-
 
53
  Scenario: Permissions can be configured to control access to H5P
-
 
54
    Given the following "users" exist:
-
 
55
      | username | firstname | lastname | email                |
-
 
56
      | teacher2 | Teacher   | 2        | teacher2@example.com |
-
 
57
    And the following "roles" exist:
-
 
58
      | name           | shortname | description         | archetype      |
-
 
59
      | Custom teacher | custom1   | Limited permissions | editingteacher |
-
 
60
    And the following "course enrolments" exist:
-
 
61
      | user     | course | role    |
-
 
62
      | teacher2 | C1     | custom1 |
-
 
63
    And the following "activity" exists:
-
 
64
      | activity | assign          |
-
 
65
      | course   | C1              |
53
  Scenario: When a user does not have any H5P capabilities, they cannot embed H5P content with TinyMCE
66
      | name     | Test assignment |
54
    Given the following "permission overrides" exist:
67
    And the following "permission overrides" exist:
55
      | capability        | permission | role           | contextlevel | reference |
68
      | capability   | permission | role    | contextlevel | reference |
-
 
69
      | tiny/h5p:use | Prohibit   | custom1 | Course       | C1        |
-
 
70
    # Check plugin access as a role with prohibited permissions.
-
 
71
    And I log in as "teacher2"
-
 
72
    And I am on the "Test assignment" Activity page
56
      | tiny/h5p:addembed | Prohibit   | editingteacher | Course       | C1        |
73
    And I navigate to "Settings" in current page administration
-
 
74
    When I click on the "Insert" menu item for the "Activity instructions" TinyMCE editor
-
 
75
    Then I should not see "Insert H5P content"
-
 
76
    # Check plugin access as a role with allowed permissions.
-
 
77
    And I log in as "teacher1"
57
    When I am on the PageName1 "page activity editing" page logged in as teacher1
78
    And I am on the "Test assignment" Activity page
-
 
79
    And I navigate to "Settings" in current page administration
-
 
80
    And I click on the "Insert" menu item for the "Activity instructions" TinyMCE editor
Línea 58... Línea 81...
58
    Then "Configure H5P content" "button" should not exist
81
    And I should see "Insert H5P content"
59
 
82
 
60
  @javascript
83
  @javascript
61
  Scenario: When a user does not have the Upload H5P capability, they can embed but not upload H5P content with TinyMCE
84
  Scenario: When a user does not have the Upload H5P capability, they can embed but not upload H5P content with TinyMCE
62
    Given the following "permission overrides" exist:
85
    Given the following "permission overrides" exist:
63
      | capability        | permission | role           | contextlevel | reference |
86
      | capability        | permission | role           | contextlevel | reference |
64
      | moodle/h5p:deploy | Prohibit   | editingteacher | Course       | C1        |
87
      | moodle/h5p:deploy | Prohibit   | editingteacher | Course       | C1        |
65
    When I am on the PageName1 "page activity editing" page logged in as teacher1
88
    When I am on the PageName1 "page activity editing" page logged in as teacher1
66
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
89
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
67
    Then I should not see "H5P file upload" in the "Insert H5P content" "dialogue"
90
    Then I should not see "H5P file upload" in the "Insert H5P content" "dialogue"
Línea 68... Línea 91...
68
    And I should see "H5P URL" in the "Insert H5P content" "dialogue"
91
    And I should see "H5P URL" in the "Insert H5P content" "dialogue"
69
    And I should not see "H5P options" in the "Insert H5P content" "dialogue"
92
    And I should not see "H5P options" in the "Insert H5P content" "dialogue"
70
 
93
 
71
  @javascript @external
94
  @javascript @external
72
  Scenario: A user can edit H5P content embedding with TinyMCE
95
  Scenario: A user can edit H5P content embedding with TinyMCE
73
    Given the following "user private file" exists:
96
    Given the following "user private file" exists:
74
      | user     | admin                       |
97
      | user     | admin                       |
75
      | filepath | h5p/tests/fixtures/drag.h5p |
98
      | filepath | h5p/tests/fixtures/drag.h5p |
76
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
99
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
77
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
100
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
78
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
101
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
79
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
102
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
Línea 86... Línea 109...
86
    Then I should not see "reveal"
109
    Then I should not see "reveal"
87
    And I should see "Cloudberries"
110
    And I should see "Cloudberries"
88
    And I switch to the main frame
111
    And I switch to the main frame
89
    And I navigate to "Settings" in current page administration
112
    And I navigate to "Settings" in current page administration
90
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
113
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
91
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
114
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
92
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
115
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
93
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
116
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
94
    And I wait "1" seconds
117
    And I wait "1" seconds
95
    And I click on "Save and display" "button"
118
    And I click on "Save and display" "button"
96
    And I switch to "h5pcontent" iframe
119
    And I switch to "h5pcontent" iframe
Línea 101... Línea 124...
101
  Scenario: Enable/disable H5P options tiny
124
  Scenario: Enable/disable H5P options tiny
102
    Given the following "user private file" exists:
125
    Given the following "user private file" exists:
103
      | user     | admin                                   |
126
      | user     | admin                                   |
104
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
127
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
105
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
128
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
106
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
129
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
107
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
130
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
108
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
131
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
109
    And I click on "guess-the-answer.h5p" "link"
132
    And I click on "guess-the-answer.h5p" "link"
110
    And I click on "Select this file" "button"
133
    And I click on "Select this file" "button"
111
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
134
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
Línea 114... Línea 137...
114
    And I switch to "h5p-iframe" class iframe
137
    And I switch to "h5p-iframe" class iframe
115
    Then ".h5p-actions" "css_element" should not exist
138
    Then ".h5p-actions" "css_element" should not exist
116
    And I switch to the main frame
139
    And I switch to the main frame
117
    And I navigate to "Settings" in current page administration
140
    And I navigate to "Settings" in current page administration
118
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
141
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
119
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
142
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
120
    And I click on "H5P options" "link"
143
    And I click on "H5P options" "link"
121
    And I click on "Allow download" "checkbox"
144
    And I click on "Allow download" "checkbox"
122
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
145
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
123
    And I wait "1" seconds
146
    And I wait "1" seconds
124
    And I click on "Save and display" "button"
147
    And I click on "Save and display" "button"
Línea 128... Línea 151...
128
    And I should not see "Embed"
151
    And I should not see "Embed"
129
    And I should not see "Rights of use"
152
    And I should not see "Rights of use"
130
    And I switch to the main frame
153
    And I switch to the main frame
131
    And I navigate to "Settings" in current page administration
154
    And I navigate to "Settings" in current page administration
132
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
155
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
133
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
156
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
134
    And I click on "Allow download" "checkbox"
157
    And I click on "Allow download" "checkbox"
135
    And I click on "Embed button" "checkbox"
158
    And I click on "Embed button" "checkbox"
136
    And I click on "Copyright button" "checkbox"
159
    And I click on "Copyright button" "checkbox"
137
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
160
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
138
    And I wait "1" seconds
161
    And I wait "1" seconds
Línea 145... Línea 168...
145
 
168
 
146
  @javascript @external
169
  @javascript @external
147
  Scenario: H5P options are ignored for H5P URLs
170
  Scenario: H5P options are ignored for H5P URLs
148
    Given I change window size to "large"
171
    Given I change window size to "large"
149
    And I am on the PageName1 "page activity editing" page logged in as admin
172
    And I am on the PageName1 "page activity editing" page logged in as admin
150
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
173
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
151
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1291366510035871129"
174
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1291366510035871129"
152
    And I click on "H5P options" "link"
175
    And I click on "H5P options" "link"
153
    And I click on "Embed button" "checkbox"
176
    And I click on "Embed button" "checkbox"
154
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
177
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
Línea 158... Línea 181...
158
    And I should see "Far far away"
181
    And I should see "Far far away"
159
    And I should not see "Embed"
182
    And I should not see "Embed"
160
    And I switch to the main frame
183
    And I switch to the main frame
161
    And I navigate to "Settings" in current page administration
184
    And I navigate to "Settings" in current page administration
162
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
185
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
163
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
186
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
164
    And I click on "H5P options" "link"
187
    And I click on "H5P options" "link"
-
 
188
    And the field "Embed button" matches value "1"
-
 
189
 
-
 
190
  @javascript
-
 
191
  Scenario: Enable/disable display options
-
 
192
    Given the following "user private file" exists:
-
 
193
      | user     | admin                                   |
-
 
194
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
-
 
195
    When I am on the "PageName1" "page activity editing" page logged in as "admin"
-
 
196
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
-
 
197
    Then "Auto-play in the mobile app" "field" should exist
-
 
198
    And the field "Auto-play in the mobile app" matches value "0"
-
 
199
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
-
 
200
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
-
 
201
    And I click on "guess-the-answer.h5p" "link"
-
 
202
    And I click on "Select this file" "button"
-
 
203
    And I click on "Display options" "link"
-
 
204
    And I click on "Auto-play in the mobile app" "checkbox"
-
 
205
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
-
 
206
    And I click on "Save and display" "button"
-
 
207
    And ".h5p-placeholder[data-mobileapp-autoplay=true]" "css_element" should exist
-
 
208
    And I navigate to "Settings" in current page administration
-
 
209
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
-
 
210
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
-
 
211
    And the field "Auto-play in the mobile app" matches value "1"
-
 
212
    And I click on "Auto-play in the mobile app" "checkbox"
-
 
213
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
-
 
214
    And I wait "1" seconds
-
 
215
    And I click on "Save and display" "button"
165
    And "input[aria-label=\"Embed button\"]:not([checked=checked])" "css_element" should exist
216
    And ".h5p-placeholder:not([data-mobileapp-autoplay=true])" "css_element" should exist
-
 
217
    And I navigate to "Settings" in current page administration
-
 
218
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
-
 
219
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
-
 
220
    And the field "Auto-play in the mobile app" matches value "0"
Línea 166... Línea 221...
166
 
221
 
167
  @javascript
222
  @javascript
168
  Scenario: Private H5P files are shown to students
223
  Scenario: Private H5P files are shown to students
169
    Given the following "users" exist:
224
    Given the following "users" exist:
Línea 174... Línea 229...
174
      | student1 | C1     | student |
229
      | student1 | C1     | student |
175
    And the following "user private file" exists:
230
    And the following "user private file" exists:
176
      | user     | admin                                   |
231
      | user     | admin                                   |
177
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
232
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
178
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
233
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
179
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
234
    And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
180
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
235
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
181
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
236
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
182
    And I click on "guess-the-answer.h5p" "link"
237
    And I click on "guess-the-answer.h5p" "link"
183
    And I click on "Select this file" "button"
238
    And I click on "Select this file" "button"
184
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
239
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"