mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-02-07 07:53:00 -05:00
a
This commit is contained in:
74
lms-plugins/mediacms-moodle/tiny/tests/behat/image.feature
Executable file
74
lms-plugins/mediacms-moodle/tiny/tests/behat/image.feature
Executable file
@@ -0,0 +1,74 @@
|
||||
@editor @editor_tiny @tiny_mediacms @javascript
|
||||
Feature: Use the TinyMCE editor to upload an image
|
||||
In order to work with images
|
||||
As a user
|
||||
I need to be able to upload and manipulate images
|
||||
|
||||
Scenario: Clicking on the Image button in the TinyMCE editor opens the image dialog
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Image" button for the "Description" TinyMCE editor
|
||||
Then "Insert image" "dialogue" should exist
|
||||
|
||||
Scenario: Browsing repositories in the TinyMCE editor opens the image dialog and shows the FilePicker
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Image" button for the "Description" TinyMCE editor
|
||||
And I click on "Browse repositories" "button" in the "Insert image" "dialogue"
|
||||
Then "File picker" "dialogue" should exist
|
||||
|
||||
Scenario: Focus returns to the correct location after closing a nested FilePicker
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Image" button for the "Description" TinyMCE editor
|
||||
And I press "Browse repositories"
|
||||
When I press the escape key
|
||||
Then the focused element is "Browse repositories" "button"
|
||||
|
||||
@_file_upload @test_tiny
|
||||
Scenario: Browsing repositories in the TinyMCE editor shows the FilePicker and upload url image
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Image" button for the "Description" TinyMCE editor
|
||||
And I click on "Browse repositories" "button" in the "Insert image" "dialogue"
|
||||
And I upload "/lib/editor/tiny/tests/behat/fixtures/tinyscreenshot.png" to the file picker for TinyMCE
|
||||
# Note: This needs to be replaced with a label.
|
||||
Then ".tiny_image_preview" "css_element" should be visible
|
||||
|
||||
@_file_upload
|
||||
Scenario: Insert image to the TinyMCE editor
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
And I click on the "Image" button for the "Description" TinyMCE editor
|
||||
And I click on "Browse repositories" "button" in the "Insert image" "dialogue"
|
||||
And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" to the file picker for TinyMCE
|
||||
And I set the field "How would you describe this image to someone who can't see it?" to "It's the Moodle"
|
||||
And I click on "Save" "button" in the "Image details" "dialogue"
|
||||
When I select the "img" element in position "0" of the "Description" TinyMCE editor
|
||||
And I click on the "Image" button for the "Description" TinyMCE editor
|
||||
Then the field "How would you describe this image to someone who can't see it?" matches value "It's the Moodle"
|
||||
# Note: This needs to be replaced with a label.
|
||||
And ".tiny_image_preview" "css_element" should be visible
|
||||
|
||||
@_file_upload
|
||||
Scenario: Resizing the image uses the original and custom sizes and the keep proportion checkbox
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
And I click on the "Image" button for the "Description" TinyMCE editor
|
||||
And I click on "Browse repositories" "button" in the "Insert image" "dialogue"
|
||||
And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" to the file picker for TinyMCE
|
||||
And I click on "This image is decorative only" "checkbox"
|
||||
And I click on "Save" "button" in the "Image details" "dialogue"
|
||||
When I select the "img" element in position "0" of the "Description" TinyMCE editor
|
||||
And I click on the "Image" button for the "Description" TinyMCE editor
|
||||
Then the field "Original size" matches value "1"
|
||||
And I click on "Custom size" "radio"
|
||||
Then the field "Keep proportion" matches value "1"
|
||||
And I click on "Keep proportion" "checkbox"
|
||||
And I set the field "Width" to "102"
|
||||
And I click on "Save" "button" in the "Image details" "dialogue"
|
||||
When I select the "img" element in position "0" of the "Description" TinyMCE editor
|
||||
And I click on the "Image" button for the "Description" TinyMCE editor
|
||||
Then the field "Custom size" matches value "1"
|
||||
And the field "Width" matches value "102"
|
||||
And the field "Keep proportion" matches value "0"
|
||||
58
lms-plugins/mediacms-moodle/tiny/tests/behat/video.feature
Executable file
58
lms-plugins/mediacms-moodle/tiny/tests/behat/video.feature
Executable file
@@ -0,0 +1,58 @@
|
||||
@editor @editor_tiny @tiny_mediacms @javascript
|
||||
Feature: Use the TinyMCE editor to upload a video
|
||||
In order to work with videos
|
||||
As a user
|
||||
I need to be able to upload and manipulate videos
|
||||
|
||||
Scenario: Clicking on the Video button in the TinyMCE editor opens the video dialog
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Multimedia" button for the "Description" TinyMCE editor
|
||||
Then "Insert media" "dialogue" should exist
|
||||
|
||||
Scenario: Browsing repositories in the TinyMCE editor shows the FilePicker
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Multimedia" button for the "Description" TinyMCE editor
|
||||
And I click on "Browse repositories" "button" in the "Insert media" "dialogue"
|
||||
Then "File picker" "dialogue" should exist
|
||||
|
||||
@_file_upload
|
||||
Scenario: Browsing repositories in the TinyMCE editor shows the FilePicker
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
When I click on the "Multimedia" button for the "Description" TinyMCE editor
|
||||
And I follow "Video"
|
||||
And I click on "Browse repositories..." "button" in the "#id_description_editor_video .tiny_media_source.tiny_media_media_source" "css_element"
|
||||
And I upload "/lib/editor/tiny/tests/behat/fixtures/moodle-logo.mp4" to the file picker for TinyMCE
|
||||
When I click on "Insert media" "button"
|
||||
And I select the "video" element in position "1" of the "Description" TinyMCE editor
|
||||
|
||||
@_file_upload
|
||||
Scenario: Insert and update video in the TinyMCE editor
|
||||
Given I log in as "admin"
|
||||
And I open my profile in edit mode
|
||||
And I click on the "Multimedia" button for the "Description" TinyMCE editor
|
||||
And I follow "Video"
|
||||
And I click on "Browse repositories..." "button" in the "#id_description_editor_video .tiny_media_source.tiny_media_media_source" "css_element"
|
||||
And I upload "/lib/editor/tiny/tests/behat/fixtures/moodle-logo.mp4" to the file picker for TinyMCE
|
||||
And I click on "Insert media" "button"
|
||||
And I select the "video" element in position "1" of the "Description" TinyMCE editor
|
||||
When I click on the "Multimedia" button for the "Description" TinyMCE editor
|
||||
And I click on "Display options" "link"
|
||||
And I set the field "Title" to "Test title"
|
||||
And I click on "Advanced settings" "link"
|
||||
And I click on "Play automatically" "checkbox"
|
||||
And I click on "Muted" "checkbox"
|
||||
And I click on "Loop" "checkbox"
|
||||
Then "Insert media" "button" should not exist in the "Insert media" "dialogue"
|
||||
And "Update media" "button" should exist in the "Insert media" "dialogue"
|
||||
And I click on "Update media" "button"
|
||||
And I select the "video" element in position "1" of the "Description" TinyMCE editor
|
||||
And I click on the "Multimedia" button for the "Description" TinyMCE editor
|
||||
And I click on "Display options" "link"
|
||||
And the field "Title" matches value "Test title"
|
||||
And I click on "Advanced settings" "link"
|
||||
And the field "Play automatically" matches value "1"
|
||||
And the field "Muted" matches value "1"
|
||||
And the field "Loop" matches value "1"
|
||||
Reference in New Issue
Block a user