Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@editor @editor_tiny @tiny_media @javascript
2
Feature: Use the TinyMCE editor to upload a media file
3
  In order to work with media files
4
  As a user
5
  I need to be able to upload and change settings of media files
6
 
7
  Background:
8
    Given I log in as "admin"
9
    And I open my profile in edit mode
10
    And I click on the "Multimedia" button for the "Description" TinyMCE editor
11
 
12
  Scenario: Clicking on the media button in the TinyMCE editor opens the insert media dialog
13
    Then "Insert media" "dialogue" should exist
14
    And "Browse repositories" "button" should exist in the "Insert media" "dialogue"
15
    And I click on "Browse repositories" "button" in the "Insert media" "dialogue"
16
    And "File picker" "dialogue" should exist
17
 
18
  @_file_upload
19
  Scenario Outline: Insert and update media in the TinyMCE editor
20
    Given I click on "Browse repositories" "button"
21
    When I upload "/lib/editor/tiny/tests/behat/fixtures/<fixturefile>" to the file picker for TinyMCE
22
    Then "Media details" "dialogue" should exist
23
    And "Media title" "field" should exist in the "Media details" "dialogue"
24
    And "Add custom thumbnail" "button" <thumbnailaction> in the "Media details" "dialogue"
25
    And "Subtitles and captions" "link" should exist in the "Media details" "dialogue"
26
    And the field "Media title" in the "Media details" "dialogue" matches value "<fixturetitle>"
27
    And the field "Show controls" in the "Media details" "dialogue" matches value "1"
28
    And the field "Autoplay" in the "Media details" "dialogue" matches value "0"
29
    And the field "Muted" in the "Media details" "dialogue" matches value "0"
30
    And the field "Loop" in the "Media details" "dialogue" matches value "0"
31
    And <originalsizeverify>
32
    And <customsizeverify1>
33
    And I click on "Delete media" "button" in the "Media details" "dialogue"
34
    And "Delete media" "dialogue" should exist
35
    And I click on "Delete" "button" in the "Delete media" "dialogue"
36
    And "Insert media" "dialogue" should exist
37
    And I click on "Browse repositories" "button"
38
    And I upload "/lib/editor/tiny/tests/behat/fixtures/<fixturefile>" to the file picker for TinyMCE
39
    And I click on "Overwrite" "button"
40
    And I set the field "Media title" to "<newfixturetitle>"
41
    And I set the field "Autoplay" to "1"
42
    And I set the field "Muted" to "1"
43
    And I set the field "Loop" to "1"
44
    And <customsizestep>
45
    And <customsizeaction>
46
    And I click on "Subtitles and captions" "link" in the "Media details" "dialogue"
47
    And I click on "Browse repositories..." "button" in the "Media details" "dialogue"
48
    And I upload "/lib/editor/tiny/tests/behat/fixtures/<subtitlefile>" to the file picker for TinyMCE
49
    And I set the field "Language" in the "Media details" "dialogue" to "<subtitlelang>"
50
    And I set the field "Label" in the "Media details" "dialogue" to "<subtitletitle>"
51
    And I click on "Save" "button" in the "Media details" "dialogue"
52
    And I switch to the "Description" TinyMCE editor iframe
53
    And "//*[contains(@data-id, 'id_description_editor')]//<mediatype>[@title='<newfixturetitle>' and @autoplay='autoplay' and @loop='loop' and @muted='true' and @controls='controls']" "xpath_element" should exist
54
    And "//*[contains(@data-id, 'id_description_editor')]//<mediatype>//source[contains(@src, '<fixturefile>')]" "xpath_element" should exist
55
    And "//*[contains(@data-id, 'id_description_editor')]//<mediatype>//track[contains(@src, '<subtitlefile>') and @kind='subtitles' and contains(@srclang, '<subtitlelangcode>') and @label='<subtitletitle>']" "xpath_element" should exist
56
    And I switch to the main frame
57
    And I select the "video" element in position "1" of the "Description" TinyMCE editor
58
    And I click on the "Multimedia" button for the "Description" TinyMCE editor
59
    And the field "Media title" in the "Media details" "dialogue" matches value "<newfixturetitle>"
60
    And the field "Show controls" in the "Media details" "dialogue" matches value "1"
61
    And the field "Autoplay" in the "Media details" "dialogue" matches value "1"
62
    And the field "Muted" in the "Media details" "dialogue" matches value "1"
63
    And the field "Loop" in the "Media details" "dialogue" matches value "1"
64
    And <customsizeverify2>
65
    And <customsizeverify3>
66
    And I click on "Subtitles and captions" "link" in the "Media details" "dialogue"
67
    And the field "Subtitle track URL" in the "Media details" "dialogue" does not match value ""
68
    And the field "Language" in the "Media details" "dialogue" matches value "<subtitlelang>"
69
    And the field "Label" in the "Media details" "dialogue" matches value "<subtitletitle>"
70
 
71
    Examples:
72
      | mediatype | fixturefile      | fixturetitle | newfixturetitle   | subtitlefile        | subtitletitle             | subtitlelangcode | subtitlelang | thumbnailaction  | originalsizeverify                                                            | customsizeverify1                                                           | customsizeverify2                                                           | customsizeverify3                                                       | customsizestep                                                             | customsizeaction                                                         |
73
      | video     | moodle-logo.mp4  | moodle-logo  | Moodle LMS Logo   | subtitle-sample.vtt | Subtitle sample for video | he               | Hebrew       | should exist     | the field "Original size" in the "Media details" "dialogue" matches value "1" | the field "Custom size" in the "Media details" "dialogue" matches value "0" | the field "Custom size" in the "Media details" "dialogue" matches value "1" | the field "Width" in the "Media details" "dialogue" matches value "300" | I click on "Custom size" "radio" in the "Media details" "dialogue"         | I set the field "Width" in the "Media details" "dialogue" to "300"       |
74
      | audio     | audio-sample.mp3 | audio-sample | Sample Audio File | subtitle-sample.vtt | Subtitle sample for audio | fr               | French       | should not exist | "Original size" "field" should not exist in the "Media details" "dialogue"    | "Custom size" "field" should not exist in the "Media details" "dialogue"    | "Custom size" "field" should not exist in the "Media details" "dialogue"    | "Width" "field" should not exist in the "Media details" "dialogue"      | "Original size" "field" should not exist in the "Media details" "dialogue" | "Custom size" "field" should not exist in the "Media details" "dialogue" |
75
 
76
  @_file_upload
77
  Scenario: Add custom thumbnail to a video in TinyMCE editor
78
    Given I click on "Browse repositories" "button" in the "Insert media" "dialogue"
79
    And I upload "/lib/editor/tiny/tests/behat/fixtures/moodle-logo.mp4" to the file picker for TinyMCE
80
    When I click on "Add custom thumbnail" "button" in the "Media details" "dialogue"
81
    Then "Insert media thumbnail" "dialogue" should exist
82
    And I click on "Browse repositories" "button" in the "Insert media thumbnail" "dialogue"
83
    And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" to the file picker for TinyMCE
84
    And "Media thumbnail" "dialogue" should exist
85
    And "tiny-media-thumbnail-preview" "region" should exist in the "Media thumbnail" "dialogue"
86
    And I click on "Delete media thumbnail" "button" in the "Media thumbnail" "dialogue"
87
    And "Delete media thumbnail" "dialogue" should exist
88
    And I click on "Delete" "button" in the "Delete media thumbnail" "dialogue"
89
    And I click on "Browse repositories" "button" in the "Insert media thumbnail" "dialogue"
90
    And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" to the file picker for TinyMCE
91
    And I click on "Overwrite" "button" in the "File exists" "dialogue"
92
    And I click on "Next" "button" in the "Media thumbnail" "dialogue"
93
    But "Add custom thumbnail" "button" should not exist in the "Media details" "dialogue"
94
    And "Change thumbnail" "button" should exist in the "Media details" "dialogue"
95
    And I click on "Delete thumbnail" "button" in the "Media details" "dialogue"
96
    And I click on "Delete" "button" in the "Delete thumbnail" "dialogue"
97
    And "Media details" "dialogue" should exist
98
    And "Change thumbnail" "button" should not exist in the "Media details" "dialogue"
99
    And "Delete thumbnail" "button" should not exist in the "Media details" "dialogue"
100
    And I click on "Add custom thumbnail" "button" in the "Media details" "dialogue"
101
    And "Insert media thumbnail" "dialogue" should exist
102
    And I click on "Browse repositories" "button" in the "Insert media thumbnail" "dialogue"
103
    And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" to the file picker for TinyMCE
104
    And I click on "Overwrite" "button" in the "File exists" "dialogue"
105
    And I click on "Next" "button" in the "Media thumbnail" "dialogue"
106
    And I click on "Save" "button" in the "Media details" "dialogue"
107
    And I switch to the "Description" TinyMCE editor iframe
108
    And "//*[contains(@data-id, 'id_description_editor')]//video[contains(@poster, 'moodle-logo.png')]" "xpath_element" should exist
109
 
110
  Scenario: Embed external video link - External video service
111
    Given the "mediaplugin" filter is "on"
112
    And I enable "youtube" "media" plugin
113
    And I disable "videojs" "media" plugin
114
    And I log in as "admin"
115
    And I open my profile in edit mode
116
    And I click on the "Multimedia" button for the "Description" TinyMCE editor
117
    When I set the field "Or add via URL" to "https://www.youtube.com/watch?v=JeimE8Wz6e4"
118
    And I click on "Add" "button" in the "Insert media" "dialogue"
119
    Then "Media details" "dialogue" should exist
120
    And "Media title" "field" should exist in the "Media details" "dialogue"
121
    And "Show controls" "field" should not exist in the "Media details" "dialogue"
122
    And "Autoplay" "field" should not exist in the "Media details" "dialogue"
123
    And "Muted" "field" should not exist in the "Media details" "dialogue"
124
    And "Loop" "field" should not exist in the "Media details" "dialogue"
125
    And the field "Media title" in the "Media details" "dialogue" matches value "https://www.youtube.com/watch?v=JeimE8Wz6e4"
126
    And I set the field "Media title" to "Hey, that is pretty good!"
127
    And I click on "Save" "button" in the "Media details" "dialogue"
128
    And I switch to the "Description" TinyMCE editor iframe
129
    And "//*[contains(@data-id, 'id_description_editor')]//a[@class='external-media-provider' and @href='https://www.youtube.com/watch?v=JeimE8Wz6e4' and normalize-space(text())='Hey, that is pretty good!']" "xpath_element" should exist
130
    And I switch to the main frame
131
    And I select the "a" element in position "0" of the "Description" TinyMCE editor
132
    And I click on the "Multimedia" button for the "Description" TinyMCE editor
133
    And the field "Media title" in the "Media details" "dialogue" matches value "Hey, that is pretty good!"
134
    And I click on "Cancel" "button" in the "Media details" "dialogue"
135
    And I press "Update profile"
136
    And "//span[contains(@class, 'mediaplugin_youtube')]//iframe[@title='Hey, that is pretty good!']" "xpath_element" should exist