# This is not a functional Behat test at the moment, but is here to document # the steps for testing some functionality. These tests assume that one of the # drush make files, and all of the indicated manual steps have been followed. # These tests should pass no matter which of the make files is used. # @TODO: Tweak these steps so that they might actually work without a crazy # amount of custom step definitions in Behat. # Note that this entire set of tests should be followed multiple times, once # with each of the types of files uploaded during the manual steps: image file, # audio file, video file, document file, video stream, audio stream. # The one exception is that tests tagged @image should only be done for images. @javascript Feature: Embed media in WYSIWYG text areas As a content editor I need to embed media in WYSIWYG text areas So that I can produce engaging media-rich content # This should be performed before each of the scenarios below. Note that this # entire set of scenarios should be repeated with each of the types of media # uploaded during the manual setup steps: Background: Given I am logged on as content editor And I visit "/node/add/page" And I fill in "Title" with "My Title" And I press the media browser button under "Body" And I select the "Library" tab And I select the media And I press "Submit" Scenario: I can embed media And I press "Submit" And I press "Save" Then I should see the media in the content area Scenario: I can embed the media with an overridden text field And I fill in "Credit" with 'Special characters... &"<>?' And I press "Submit" And I press "Save" Then I should see 'Special characters... &"<>?' Scenario: I can embed media with an overridden filtered long text field And I fill in "Caption" with "This is my caption" And I press "Submit" And I press "Save" Then I should see "This is my caption" Scenario: I can embed media with an overridden multiple value field And I select "Foo" and "Bar" from "Tags" And I press "Submit" And I press "Save" Then I should see "Foo" And I should see "Bar" Scenario: I can edit a previously embedded media with overridden field values And I fill in "Credit" with 'Special characters... &"<>?' And I fill in "Caption" with "This is my caption" And I select "Foo" and "Bar" from "Tags" And I press "Submit" And I press "Save" And I click "Edit" And I select the media in the Body field And I press the media browser button under "Body" Then I should see 'Special characters... &"<>?' in the "Credit" field And I should see "This is my caption" in the "Caption" field And I should see "Foo" and "Bar" selected in "Tags" Scenario: I can embed 1 piece of media multiple times with different overridden field values And I fill in "Credit" with "Credit 1" And I press "Submit" And I press the media browser button under "Body" And I select the "Library" tab And I select the media And I press "Submit" And I fill in "Credit" with "Credit 2" And I press "Submit" And I press "Save" Then I should see "Credit 1" And I should see "Credit 2" # The following are only for image files. @image Scenario: I can embed an image with an overridden alt attribute And I fill in "Alt text" with "My alt text" And I press "Submit" And I press "Save" Then I should see an image with alt attribute "My alt text" @image Scenario: I can embed an image with an overridden title attribute And I fill in "Title text" with '"Foo" & Bar' (including double-quotes) And I press "Submit" And I press "Save" Then I should see an image with title attribute ""Foo" & Bar" @image Scenario: Embedded media from older 2.0-beta versions still work in the WYSIWYG And I visit a "page" node containing: [[{"fid":"1","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"My previous alt","field_file_image_title_text[und][0][value]":"My previous title","field_caption[und][0][value]":"%3Cp%3EMy%20previous%20caption%3C%2Fp%3E","field_caption[und][0][format]":"filtered_html"},"type":"media","attributes":{"height":154,"width":140,"class":"media-element file-default"},"link_text":null}]] And I click "Edit" And I select the image And I press the media browser button under "Body" Then I should see "My previous alt" in "Alt text" And I should see "My previous title" in "Title text" And I should see "My previous caption" in "Caption"