Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
11 efrain 1
@editor @editor_tiny @tiny_h5p @javascript
1 efrain 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
 
24
  @javascript @external
25
  Scenario: TinyMCE can be used to embed an H5P activity
26
    Given I change window size to "large"
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
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"
31
    When I click on "Save and display" "button"
32
    Then ".h5p-placeholder" "css_element" should exist
33
    And I switch to "h5pcontent" iframe
34
    And I should see "Lorum ipsum"
35
 
36
  @javascript
37
  Scenario: TinyMCE can be used to upload and embed an H5P activity
11 efrain 38
    Given the following "user private file" exists:
39
      | user     | admin                                   |
40
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
1 efrain 41
    And I change window size to "large"
11 efrain 42
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
1 efrain 43
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
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"
46
    And I click on "guess-the-answer.h5p" "link"
47
    And I click on "Select this file" "button"
48
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
49
    When I click on "Save and display" "button"
50
    Then ".h5p-placeholder" "css_element" should exist
51
 
52
  @javascript
53
  Scenario: When a user does not have any H5P capabilities, they cannot embed H5P content with TinyMCE
54
    Given the following "permission overrides" exist:
55
      | capability        | permission | role           | contextlevel | reference |
56
      | tiny/h5p:addembed | Prohibit   | editingteacher | Course       | C1        |
57
    When I am on the PageName1 "page activity editing" page logged in as teacher1
58
    Then "Configure H5P content" "button" should not exist
59
 
60
  @javascript
61
  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:
63
      | capability        | permission | role           | contextlevel | reference |
64
      | moodle/h5p:deploy | Prohibit   | editingteacher | Course       | C1        |
65
    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
67
    Then I should not see "H5P file upload" in the "Insert H5P content" "dialogue"
68
    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"
70
 
71
  @javascript @external
72
  Scenario: A user can edit H5P content embedding with TinyMCE
11 efrain 73
    Given the following "user private file" exists:
74
      | user     | admin                       |
75
      | filepath | h5p/tests/fixtures/drag.h5p |
76
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
1 efrain 77
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
78
    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"
80
    And I click on "drag" "link"
81
    And I click on "Select this file" "button"
82
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
83
    When I click on "Save and display" "button"
84
    And I switch to "h5pcontent" iframe
85
    And I switch to "h5p-iframe" class iframe
86
    Then I should not see "reveal"
87
    And I should see "Cloudberries"
88
    And I switch to the main frame
89
    And I navigate to "Settings" in current page administration
90
    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
92
    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"
94
    And I wait "1" seconds
95
    And I click on "Save and display" "button"
96
    And I switch to "h5pcontent" iframe
97
    And I should see "Lorum ipsum"
98
    And I should not see "Cloudberries"
99
 
100
  @javascript
101
  Scenario: Enable/disable H5P options tiny
11 efrain 102
    Given the following "user private file" exists:
103
      | user     | admin                                   |
104
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
105
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
1 efrain 106
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
107
    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"
109
    And I click on "guess-the-answer.h5p" "link"
110
    And I click on "Select this file" "button"
111
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
112
    When I click on "Save and display" "button"
113
    And I switch to "h5pcontent" iframe
114
    And I switch to "h5p-iframe" class iframe
115
    Then ".h5p-actions" "css_element" should not exist
116
    And I switch to the main frame
117
    And I navigate to "Settings" in current page administration
118
    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
120
    And I click on "H5P options" "link"
121
    And I click on "Allow download" "checkbox"
122
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
123
    And I wait "1" seconds
124
    And I click on "Save and display" "button"
125
    And I switch to "h5pcontent" iframe
126
    And I switch to "h5p-iframe" class iframe
127
    And "Reuse" "text" should exist in the ".h5p-actions" "css_element"
128
    And I should not see "Embed"
129
    And I should not see "Rights of use"
130
    And I switch to the main frame
131
    And I navigate to "Settings" in current page administration
132
    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
134
    And I click on "Allow download" "checkbox"
135
    And I click on "Embed button" "checkbox"
136
    And I click on "Copyright button" "checkbox"
137
    And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
138
    And I wait "1" seconds
139
    And I click on "Save and display" "button"
140
    And I switch to "h5pcontent" iframe
141
    And I switch to "h5p-iframe" class iframe
142
    And "Reuse" "text" should not exist in the ".h5p-actions" "css_element"
143
    And I should see "Embed"
144
    And I should see "Rights of use"
145
 
146
  @javascript @external
147
  Scenario: H5P options are ignored for H5P URLs
148
    Given I change window size to "large"
149
    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
151
    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"
153
    And I click on "Embed button" "checkbox"
154
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
155
    When I click on "Save and display" "button"
156
    Then ".h5p-placeholder" "css_element" should exist
157
    And I switch to "h5pcontent" iframe
158
    And I should see "Far far away"
159
    And I should not see "Embed"
160
    And I switch to the main frame
161
    And I navigate to "Settings" in current page administration
162
    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
164
    And I click on "H5P options" "link"
165
    And "input[aria-label=\"Embed button\"]:not([checked=checked])" "css_element" should exist
166
 
167
  @javascript
168
  Scenario: Private H5P files are shown to students
169
    Given the following "users" exist:
170
      | username | firstname | lastname | email                |
171
      | student1 | Student   | 1        | student1@example.com |
172
    And the following "course enrolments" exist:
173
      | user     | course | role    |
174
      | student1 | C1     | student |
11 efrain 175
    And the following "user private file" exists:
176
      | user     | admin                                   |
177
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
178
    And I am on the "PageName1" "page activity editing" page logged in as "admin"
1 efrain 179
    And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
180
    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"
182
    And I click on "guess-the-answer.h5p" "link"
183
    And I click on "Select this file" "button"
184
    And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
185
    And I click on "Save and display" "button"
186
    When I am on the PageName1 "page activity" page logged in as student1
187
    Then I switch to "h5pcontent" iframe
188
    And I switch to "h5p-iframe" class iframe
189
    And I should see "reveal"