1 |
efrain |
1 |
@editor @editor_atto @atto @atto_media @_file_upload
|
|
|
2 |
Feature: Add media to Atto
|
|
|
3 |
To write rich text - I need to add media.
|
|
|
4 |
|
|
|
5 |
Background:
|
|
|
6 |
Given the following "blocks" exist:
|
|
|
7 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
8 |
| private_files | System | 1 | my-index | side-post |
|
|
|
9 |
And I log in as "admin"
|
|
|
10 |
And I change window size to "large"
|
|
|
11 |
And I follow "Manage private files..."
|
|
|
12 |
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager
|
|
|
13 |
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.mp4" file to "Files" filemanager
|
|
|
14 |
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
|
|
|
15 |
And I upload "lib/editor/atto/tests/fixtures/pretty-good-en.vtt" file to "Files" filemanager
|
|
|
16 |
And I upload "lib/editor/atto/tests/fixtures/pretty-good-sv.vtt" file to "Files" filemanager
|
|
|
17 |
And I click on "Save changes" "button"
|
|
|
18 |
And I follow "Profile" in the user menu
|
|
|
19 |
And I follow "Blog entries"
|
|
|
20 |
And I follow "Add a new entry"
|
|
|
21 |
And I set the field "Blog entry body" to "<p>Media test</p>"
|
|
|
22 |
And I select the text in the "Blog entry body" Atto editor
|
|
|
23 |
And I set the field "Entry title" to "The best video in the entire world (not really)"
|
|
|
24 |
And I click on "Insert or edit an audio/video file" "button"
|
|
|
25 |
|
|
|
26 |
@javascript
|
|
|
27 |
Scenario: Insert some media as a link
|
|
|
28 |
# We need to disable the media plugin filter to be able to insert a link to a video file.
|
|
|
29 |
# Otherwise, the media plugin filter will try to render the video player instead of the link.
|
|
|
30 |
Given the "mediaplugin" filter is "off"
|
|
|
31 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_link .atto_media_source.atto_media_link_source" "css_element"
|
|
|
32 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
33 |
And I click on "moodle-logo.webm" "link"
|
|
|
34 |
And I click on "Select this file" "button"
|
|
|
35 |
And the field "Enter name" matches value "moodle-logo.webm"
|
|
|
36 |
And I wait until the page is ready
|
|
|
37 |
And I click on "Insert media" "button"
|
|
|
38 |
When I click on "Save changes" "button"
|
|
|
39 |
Then "//a[. = 'moodle-logo.webm']" "xpath_element" should exist
|
|
|
40 |
|
|
|
41 |
@javascript @atto_media_video
|
|
|
42 |
Scenario: Insert some media as a plain video
|
|
|
43 |
Given I click on "Video" "link"
|
|
|
44 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
|
|
45 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
46 |
And I click on "moodle-logo.webm" "link"
|
|
|
47 |
And I click on "Select this file" "button"
|
|
|
48 |
And I click on "Add alternative source" "link"
|
|
|
49 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source:nth-of-type(2)" "css_element"
|
|
|
50 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
51 |
And I click on "moodle-logo.mp4" "link"
|
|
|
52 |
And I click on "Select this file" "button"
|
|
|
53 |
When I click on "Insert media" "button"
|
|
|
54 |
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist
|
|
|
55 |
|
|
|
56 |
@javascript @atto_media_video
|
|
|
57 |
Scenario: Insert some media as a video with display settings
|
|
|
58 |
Given I click on "Video" "link"
|
|
|
59 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
|
|
60 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
61 |
And I click on "moodle-logo.webm" "link"
|
|
|
62 |
And I click on "Select this file" "button"
|
|
|
63 |
And I click on "Display options" "link"
|
|
|
64 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_poster_source" "css_element"
|
|
|
65 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
66 |
And I click on "moodle-logo.png" "link"
|
|
|
67 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
68 |
And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_width_entry ')]" to "420"
|
|
|
69 |
And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_height_entry ')]" to "69"
|
|
|
70 |
And I set the field "Enter title" to "VideoTitle"
|
|
|
71 |
And I click on "Display options" "link"
|
|
|
72 |
When I click on "Insert media" "button"
|
|
|
73 |
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69][@title='VideoTitle']" "xpath_element" should exist
|
|
|
74 |
|
|
|
75 |
@javascript @atto_media_video
|
|
|
76 |
Scenario: Insert some media as a video with advanced settings
|
|
|
77 |
Given I click on "Video" "link"
|
|
|
78 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
|
|
79 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
80 |
And I click on "moodle-logo.webm" "link"
|
|
|
81 |
And I click on "Select this file" "button"
|
|
|
82 |
And I click on "Advanced settings" "link"
|
|
|
83 |
And the field "Show controls" matches value "1"
|
|
|
84 |
And I set the field "Play automatically" to "1"
|
|
|
85 |
And I set the field "Muted" to "1"
|
|
|
86 |
And I set the field "Loop" to "1"
|
|
|
87 |
When I click on "Insert media" "button"
|
|
|
88 |
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist
|
|
|
89 |
|
|
|
90 |
@javascript @atto_media_video
|
|
|
91 |
Scenario: Insert some media as a video with tracks
|
|
|
92 |
Given I click on "Video" "link"
|
|
|
93 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
|
|
94 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
95 |
And I click on "moodle-logo.webm" "link"
|
|
|
96 |
And I click on "Select this file" "button"
|
|
|
97 |
And I click on "Subtitles and captions" "link"
|
|
|
98 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track_source" "css_element"
|
|
|
99 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
100 |
And I click on "pretty-good-sv.vtt" "link"
|
|
|
101 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
102 |
And the field "Label" matches value "Swedish"
|
|
|
103 |
And the field "Language" matches value "sv"
|
|
|
104 |
And I click on "Add subtitle track" "link"
|
|
|
105 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
|
|
106 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
107 |
And I click on "pretty-good-en.vtt" "link"
|
|
|
108 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
109 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[2]" matches value "English"
|
|
|
110 |
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[1]" to "1"
|
|
|
111 |
And I click on "Captions" "link" in the ".nav-item[data-track-kind='captions']" "css_element"
|
|
|
112 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track_source" "css_element"
|
|
|
113 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
114 |
And I click on "pretty-good-sv.vtt" "link"
|
|
|
115 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
116 |
And I click on "Overwrite" "button"
|
|
|
117 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[3]" matches value "Swedish"
|
|
|
118 |
And I click on "Add caption track" "link"
|
|
|
119 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
|
|
120 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
121 |
And I click on "pretty-good-en.vtt" "link"
|
|
|
122 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
123 |
And I click on "Overwrite" "button"
|
|
|
124 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[4]" matches value "English"
|
|
|
125 |
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[4]" to "1"
|
|
|
126 |
And I click on "Descriptions" "link"
|
|
|
127 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track_source" "css_element"
|
|
|
128 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
129 |
And I click on "pretty-good-sv.vtt" "link"
|
|
|
130 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
131 |
And I click on "Overwrite" "button"
|
|
|
132 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[5]" matches value "Swedish"
|
|
|
133 |
And I click on "Add description track" "link"
|
|
|
134 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
|
|
135 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
136 |
And I click on "pretty-good-en.vtt" "link"
|
|
|
137 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
138 |
And I click on "Overwrite" "button"
|
|
|
139 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[6]" matches value "English"
|
|
|
140 |
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[5]" to "1"
|
|
|
141 |
And I click on "Chapters" "link"
|
|
|
142 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track_source" "css_element"
|
|
|
143 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
144 |
And I click on "pretty-good-sv.vtt" "link"
|
|
|
145 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
146 |
And I click on "Overwrite" "button"
|
|
|
147 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[7]" matches value "Swedish"
|
|
|
148 |
And I click on "Add chapter track" "link"
|
|
|
149 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
|
|
150 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
151 |
And I click on "pretty-good-en.vtt" "link"
|
|
|
152 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
153 |
And I click on "Overwrite" "button"
|
|
|
154 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[8]" matches value "English"
|
|
|
155 |
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[8]" to "1"
|
|
|
156 |
And I click on "Metadata" "link"
|
|
|
157 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track_source" "css_element"
|
|
|
158 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
159 |
And I click on "pretty-good-sv.vtt" "link"
|
|
|
160 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
161 |
And I click on "Overwrite" "button"
|
|
|
162 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[9]" matches value "Swedish"
|
|
|
163 |
And I click on "Add metadata track" "link"
|
|
|
164 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
|
|
165 |
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
|
|
166 |
And I click on "pretty-good-en.vtt" "link"
|
|
|
167 |
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
|
|
168 |
And I click on "Overwrite" "button"
|
|
|
169 |
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[10]" matches value "English"
|
|
|
170 |
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[9]" to "1"
|
|
|
171 |
When I click on "Insert media" "button"
|
|
|
172 |
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='subtitles'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='subtitles'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='captions'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='captions'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='descriptions'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='descriptions'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='chapters'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='chapters'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='metadata'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='metadata'][@label='English'][@srclang='en'][not(@default)]]" "xpath_element" should exist
|
|
|
173 |
|
|
|
174 |
@javascript @atto_media_audio
|
|
|
175 |
Scenario: Insert some media as a plain audio
|
|
|
176 |
Given I click on "Audio" "link"
|
|
|
177 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_audio .atto_media_source.atto_media_media_source" "css_element"
|
|
|
178 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
179 |
And I click on "moodle-logo.mp4" "link"
|
|
|
180 |
And I click on "Select this file" "button"
|
|
|
181 |
When I click on "Insert media" "button"
|
|
|
182 |
Then "//audio[descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist
|
|
|
183 |
|
|
|
184 |
@javascript @atto_media_audio
|
|
|
185 |
Scenario: Insert some media as an audio with display settings
|
|
|
186 |
Given I click on "Audio" "link"
|
|
|
187 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_audio .atto_media_source.atto_media_media_source" "css_element"
|
|
|
188 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
189 |
And I click on "moodle-logo.mp4" "link"
|
|
|
190 |
And I click on "Select this file" "button"
|
|
|
191 |
And I click on "Display options" "link" in the "#id_summary_editor_audio" "css_element"
|
|
|
192 |
And I set the field "audio_media-title-entry" to "AudioTitle"
|
|
|
193 |
When I click on "Insert media" "button"
|
|
|
194 |
Then "//audio[descendant::source[contains(@src, 'moodle-logo.mp4')]][@title='AudioTitle']" "xpath_element" should exist
|
|
|
195 |
|
|
|
196 |
@javascript @atto_media_audio
|
|
|
197 |
Scenario: Insert some media as an audio with advanced settings
|
|
|
198 |
Given I click on "Audio" "link"
|
|
|
199 |
And I click on "Browse repositories..." "button" in the "#id_summary_editor_audio .atto_media_source.atto_media_media_source" "css_element"
|
|
|
200 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
201 |
And I click on "moodle-logo.mp4" "link"
|
|
|
202 |
And I click on "Select this file" "button"
|
|
|
203 |
And I click on "Advanced settings" "link" in the "#id_summary_editor_audio" "css_element"
|
|
|
204 |
And the field "audio_media-controls-toggle" matches value "1"
|
|
|
205 |
And I set the field "audio_media-autoplay-toggle" to "1"
|
|
|
206 |
And I set the field "audio_media-mute-toggle" to "1"
|
|
|
207 |
And I set the field "audio_media-loop-toggle" to "1"
|
|
|
208 |
When I click on "Insert media" "button"
|
|
|
209 |
Then "//audio[descendant::source[contains(@src, 'moodle-logo.mp4')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist
|