Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@editor @editor_tiny @tiny_h5p @javascript @_file_upload
2
Feature: Use the TinyMCE editor to upload an h5p package
3
    In order to work with h5p
4
    As a content creator
5
    I need to be able to embed H5P packages
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | shortname | fullname |
10
      | C1        | Course 1 |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email                |
13
      | teacher1 | Teacher   | 1        | teacher1@example.com |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
    And the following "activities" exist:
18
      | activity | name      | intro     | introformat | course | content | contentformat | idnumber |
19
      | page     | PageName1 | PageDesc1 | 1           | C1     | H5Ptest | 1             | 1        |
20
    And the "displayh5p" filter is "on"
21
    And the following config values are set as admin:
22
      | allowedsources | https://moodle.h5p.com/content/[id] | filter_displayh5p |
23
    And the following "blocks" exist:
24
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
25
      | private_files | System       | 1         | my-index        | side-post     |
26
 
27
  @javascript @external
28
  Scenario: TinyMCE can be used to embed an H5P activity
29
    Given I change window size to "large"
30
    And I am on the PageName1 "page activity editing" page logged in as admin
31
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
32
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
33
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
34
    When I click on "Save and display" "button"
35
    Then ".h5p-placeholder" "css_element" should exist
36
    And I switch to "h5pcontent" iframe
37
    And I should see "Lorum ipsum"
38
 
39
  @javascript
40
  Scenario: TinyMCE can be used to upload and embed an H5P activity
41
    Given I log in as "admin"
42
    And I change window size to "large"
43
    And I follow "Manage private files..."
44
    And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
45
    And I click on "Save changes" "button"
46
    And I am on the "PageName1" "page activity editing" page
47
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
48
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
49
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
50
    And I click on "guess-the-answer.h5p" "link"
51
    And I click on "Select this file" "button"
52
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
53
    When I click on "Save and display" "button"
54
    Then ".h5p-placeholder" "css_element" should exist
55
 
56
  @javascript
57
  Scenario: When a user does not have any H5P capabilities, they cannot embed H5P content with TinyMCE
58
    Given the following "permission overrides" exist:
59
      | capability        | permission | role           | contextlevel | reference |
60
      | tiny/h5p:addembed | Prohibit   | editingteacher | Course       | C1        |
61
    When I am on the PageName1 "page activity editing" page logged in as teacher1
62
    Then "Configure H5P content" "button" should not exist
63
 
64
  @javascript
65
  Scenario: When a user does not have the Upload H5P capability, they can embed but not upload H5P content with TinyMCE
66
    Given the following "permission overrides" exist:
67
      | capability        | permission | role           | contextlevel | reference |
68
      | moodle/h5p:deploy | Prohibit   | editingteacher | Course       | C1        |
69
    When I am on the PageName1 "page activity editing" page logged in as teacher1
70
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
71
    Then I should not see "H5P file upload" in the "Insert H5P content" "dialogue"
72
    And I should see "H5P URL" in the "Insert H5P content" "dialogue"
73
    And I should not see "H5P options" in the "Insert H5P content" "dialogue"
74
 
75
  @javascript @external
76
  Scenario: A user can edit H5P content embedding with TinyMCE
77
    Given I log in as "admin"
78
    And I follow "Manage private files..."
79
    And I upload "lib/editor/atto/tests/fixtures/drag.h5p" file to "Files" filemanager
80
    And I click on "Save changes" "button"
81
    And I am on the PageName1 "page activity editing" page
82
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
83
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
84
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
85
    And I click on "drag" "link"
86
    And I click on "Select this file" "button"
87
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
88
    When I click on "Save and display" "button"
89
    And I switch to "h5pcontent" iframe
90
    And I switch to "h5p-iframe" class iframe
91
    Then I should not see "reveal"
92
    And I should see "Cloudberries"
93
    And I switch to the main frame
94
    And I navigate to "Settings" in current page administration
95
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
96
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
97
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
98
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
99
    And I wait "1" seconds
100
    And I click on "Save and display" "button"
101
    And I switch to "h5pcontent" iframe
102
    And I should see "Lorum ipsum"
103
    And I should not see "Cloudberries"
104
 
105
  @javascript
106
  Scenario: Enable/disable H5P options tiny
107
    Given I log in as "admin"
108
    And I follow "Manage private files..."
109
    And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
110
    And I click on "Save changes" "button"
111
    And I am on the PageName1 "page activity editing" page
112
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
113
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
114
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
115
    And I click on "guess-the-answer.h5p" "link"
116
    And I click on "Select this file" "button"
117
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
118
    When I click on "Save and display" "button"
119
    And I switch to "h5pcontent" iframe
120
    And I switch to "h5p-iframe" class iframe
121
    Then ".h5p-actions" "css_element" should not exist
122
    And I switch to the main frame
123
    And I navigate to "Settings" in current page administration
124
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
125
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
126
    And I click on "H5P options" "link"
127
    And I click on "Allow download" "checkbox"
128
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
129
    And I wait "1" seconds
130
    And I click on "Save and display" "button"
131
    And I switch to "h5pcontent" iframe
132
    And I switch to "h5p-iframe" class iframe
133
    And "Reuse" "text" should exist in the ".h5p-actions" "css_element"
134
    And I should not see "Embed"
135
    And I should not see "Rights of use"
136
    And I switch to the main frame
137
    And I navigate to "Settings" in current page administration
138
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
139
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
140
    And I click on "Allow download" "checkbox"
141
    And I click on "Embed button" "checkbox"
142
    And I click on "Copyright button" "checkbox"
143
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
144
    And I wait "1" seconds
145
    And I click on "Save and display" "button"
146
    And I switch to "h5pcontent" iframe
147
    And I switch to "h5p-iframe" class iframe
148
    And "Reuse" "text" should not exist in the ".h5p-actions" "css_element"
149
    And I should see "Embed"
150
    And I should see "Rights of use"
151
 
152
  @javascript @external
153
  Scenario: H5P options are ignored for H5P URLs
154
    Given I change window size to "large"
155
    And I am on the PageName1 "page activity editing" page logged in as admin
156
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
157
    And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1291366510035871129"
158
    And I click on "H5P options" "link"
159
    And I click on "Embed button" "checkbox"
160
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
161
    When I click on "Save and display" "button"
162
    Then ".h5p-placeholder" "css_element" should exist
163
    And I switch to "h5pcontent" iframe
164
    And I should see "Far far away"
165
    And I should not see "Embed"
166
    And I switch to the main frame
167
    And I navigate to "Settings" in current page administration
168
    And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
169
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
170
    And I click on "H5P options" "link"
171
    And "input[aria-label=\"Embed button\"]:not([checked=checked])" "css_element" should exist
172
 
173
  @javascript
174
  Scenario: Private H5P files are shown to students
175
    Given the following "users" exist:
176
      | username | firstname | lastname | email                |
177
      | student1 | Student   | 1        | student1@example.com |
178
    And the following "course enrolments" exist:
179
      | user     | course | role    |
180
      | student1 | C1     | student |
181
    And I log in as "admin"
182
    And I follow "Manage private files..."
183
    And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
184
    And I click on "Save changes" "button"
185
    And I am on the PageName1 "page activity editing" page
186
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
187
    And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
188
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
189
    And I click on "guess-the-answer.h5p" "link"
190
    And I click on "Select this file" "button"
191
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
192
    And I click on "Save and display" "button"
193
    When I am on the PageName1 "page activity" page logged in as student1
194
    Then I switch to "h5pcontent" iframe
195
    And I switch to "h5p-iframe" class iframe
196
    And I should see "reveal"