From 0030362e4c260351a51e362f0fc0daa03411b5b0 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Fri, 12 Oct 2018 12:16:33 +0100 Subject: [PATCH] MDL-63431 atto_media: Fix non-unique id issues and extend tests. --- .../plugins/media/tests/behat/media.feature | 45 ++++++++++++++++-- .../moodle-atto_media-button-debug.js | Bin 48118 -> 48486 bytes .../moodle-atto_media-button-min.js | Bin 24274 -> 24410 bytes .../moodle-atto_media-button.js | Bin 48118 -> 48486 bytes .../plugins/media/yui/src/button/js/button.js | 28 +++++++---- 5 files changed, 59 insertions(+), 14 deletions(-) diff --git a/lib/editor/atto/plugins/media/tests/behat/media.feature b/lib/editor/atto/plugins/media/tests/behat/media.feature index b123a470785..b600418b9c1 100644 --- a/lib/editor/atto/plugins/media/tests/behat/media.feature +++ b/lib/editor/atto/plugins/media/tests/behat/media.feature @@ -31,7 +31,7 @@ Feature: Add media to Atto When I click on "Save changes" "button" Then "//a[. = 'moodle-logo.webm']" "xpath_element" should exist - @javascript + @javascript @atto_media_video Scenario: Insert some media as a plain video Given I click on "Video" "link" And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" @@ -46,7 +46,7 @@ Feature: Add media to Atto When I click on "Insert media" "button" Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist - @javascript + @javascript @atto_media_video Scenario: Insert some media as a video with display settings Given I click on "Video" "link" And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" @@ -66,7 +66,7 @@ Feature: Add media to Atto When I click on "Insert media" "button" Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69][@title='VideoTitle']" "xpath_element" should exist - @javascript + @javascript @atto_media_video Scenario: Insert some media as a video with advanced settings Given I click on "Video" "link" And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" @@ -81,7 +81,7 @@ Feature: Add media to Atto When I click on "Insert media" "button" Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist - @javascript + @javascript @atto_media_video Scenario: Insert some media as a video with tracks Given I click on "Video" "link" And I change window size to "large" @@ -165,3 +165,40 @@ Feature: Add media to Atto And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[9]" to "1" When I click on "Insert media" "button" 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 + + @javascript @atto_media_audio + Scenario: Insert some media as a plain audio + Given I click on "Audio" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_audio .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.mp4" "link" + And I click on "Select this file" "button" + When I click on "Insert media" "button" + Then "//audio[descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist + + @javascript @atto_media_audio + Scenario: Insert some media as an audio with display settings + Given I click on "Audio" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_audio .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.mp4" "link" + And I click on "Select this file" "button" + And I click on "Display options" "link" in the "#id_summary_editor_audio" "css_element" + And I set the field "audio_media-title-entry" to "AudioTitle" + When I click on "Insert media" "button" + Then "//audio[descendant::source[contains(@src, 'moodle-logo.mp4')]][@title='AudioTitle']" "xpath_element" should exist + + @javascript @atto_media_audio + Scenario: Insert some media as an audio with advanced settings + Given I click on "Audio" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_audio .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.mp4" "link" + And I click on "Select this file" "button" + And I click on "Advanced settings" "link" in the "#id_summary_editor_audio" "css_element" + And the field "audio_media-controls-toggle" matches value "1" + And I set the field "audio_media-autoplay-toggle" to "1" + And I set the field "audio_media-mute-toggle" to "1" + And I set the field "audio_media-loop-toggle" to "1" + When I click on "Insert media" "button" + Then "//audio[descendant::source[contains(@src, 'moodle-logo.mp4')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist \ No newline at end of file diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-debug.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-debug.js index b9b5151f8ee76f74cf5e58e49d758118366132a7..1050a6771639fbee1c6e512bc5187bed1c1892ac 100644 GIT binary patch delta 323 zcmezNo$1*xrVUBTlQ($FPcBgwoLrC^SuF(DByU9@w@e!>j+ji$wzvU569*lr(ab7 DDi%#I diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js index 9bcc4313a55fc5a8c31f1686072c280c9f8c1e82..49dc8128c17f465150675608502843f018635eef 100644 GIT binary patch delta 192 zcmcb#m+{s<#tlbACyC2Xz9uR-SyNnZ^DogjMs_Y8$50nf|H=M>_M7L5e`kUzh?LCR z%q1p-$d%c<^oc%&=8Jyjx p4j12iTzxecBiH64qc)b!Kh0hXF>+1T50&2h-!q40bBh8Zd_nP1Fza=$e1tv$wv%(!)=gGYx8%xAP038u%`GiSom{UfKDk-Fbuzz(C^SuF(DByU9@w@e!>j+ji$wzvU569*lr(ab7 DDi%#I diff --git a/lib/editor/atto/plugins/media/yui/src/button/js/button.js b/lib/editor/atto/plugins/media/yui/src/button/js/button.js index 19cc7193aa2..6204834e9ea 100644 --- a/lib/editor/atto/plugins/media/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/media/yui/src/button/js/button.js @@ -169,7 +169,7 @@ var COMPONENTNAME = 'atto_media', '' + '{{get_string "advancedsettings" component}}' + '' + '' + '' + '