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