BEHAT: Create a feature file and script for edit/delete of links/anchors via TinyMCE #630

Open
silverstripe-issues opened this Issue Apr 3, 2013 · 2 comments

Comments

Projects
None yet
3 participants

created by: @jbridson (jbridson)
created at: 2012-12-20
original ticket: http://open.silverstripe.org/ticket/8149


As an administrator I want to be able to insert links into my content via the TinyMCE editor

@todo
  Scenario: I can link to a file
    Given I select "awesome" in the "Content" HTML field
    When I press the "Insert Link" button
    When I check "Download a file"
    And I fill in the "File" dropdown with "file1.jpg"
    And I press the "Insert link" button
    Then the "Content" HTML field should contain "<a href="assets/folder1/file1.jpg">awesome</a>"
    # Required to avoid "unsaved changed" browser dialog
    Then I press the "Save draft" button


  @todo
  Scenario: I can link to an anchor
    Given I fill in the "Content" HTML field with "My awesome content <a name=myanchor>"
    And I select "awesome" in the "Content" HTML field
    When I press the "Insert Link" button
    When I check "Anchor on this page"
    And I fill in the "Select an anchor" dropdown with "myanchor"
    And I press the "Insert link" button
    Then the "Content" HTML field should contain "<a href="#myanchor">awesome</a>"
    # Required to avoid "unsaved changed" browser dialog
    Then I press the "Save draft" button

  @todo
  Scenario: I can edit a link
    Given I fill in the "Content" HTML field with "My <a href="http://silverstripe.org">awesome</a> content"
    And I select "awesome" 
    When I press the "Insert Link" button
    And the "URL" field should contain "http://silverstripe.org"
    When I fill in "http://wordpress.org" for "URL"
    And I press the "Insert link" button
    Then the "Content" HTML field should contain "<a href="http://wordpress.org">awesome</a>"
    # Required to avoid "unsaved changed" browser dialog
    Then I press the "Save draft" button

  @todo
  Scenario: I can delete a link
    Given I fill in the "Content" HTML field with "My <a href="http://silverstripe.org">awesome</a> content"
    And I select "awesome" 
    When I press the "Insert Link" button
    And I press the "Remove link" button
    Then the "Content" HTML field should not contain "<a href="http://silverstripe.org">awesome</a>"
    # Required to avoid "unsaved changed" browser dialog
    Then I press the "Save draft" button

For example assets please look in framework/tests/behat/features/files/

comment by: @chillu (ischommer)
created at: 2013-01-31


Shares some base setup time with silverstripe/silverstripe-cms#628

comment by: @sminnee (sminnee)
created at: 2013-03-04


Picking a few behat tasks to give a priority bump.

simonwelsh added the 3.1 label Mar 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment