2017-04-21 07:10:48 +02:00
|
|
|
@assets @retry
|
2013-10-08 00:23:44 +02:00
|
|
|
Feature: Insert links into a page
|
|
|
|
As a cms author
|
|
|
|
I want to insert a link into my content
|
|
|
|
So that I can link to a external website or a page on my site
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given a "page" "Home"
|
2016-02-15 02:58:24 +01:00
|
|
|
And a "page" "About Us" has the "Content" "<p>My awesome content</p>"
|
|
|
|
And a "page" "Details" has the "Content" "<p>My sub-par content<a name="youranchor"></a></p>"
|
2016-02-24 02:29:02 +01:00
|
|
|
And a "file" "file1.jpg"
|
2013-10-08 00:23:44 +02:00
|
|
|
And I am logged in with "ADMIN" permissions
|
|
|
|
And I go to "/admin/pages"
|
|
|
|
And I click on "About Us" in the tree
|
|
|
|
|
|
|
|
Scenario: I can link to an external URL
|
|
|
|
Given I select "awesome" in the "Content" HTML field
|
2017-05-09 04:07:31 +02:00
|
|
|
And I press the "Insert Link" HTML field button
|
2017-05-16 06:47:07 +02:00
|
|
|
When I click "Link to external URL" in the ".mce-menu" element
|
2017-05-09 04:07:31 +02:00
|
|
|
And I should see an "form#Form_EditorToolbarEditorExternalLink" element
|
|
|
|
When I fill in "http://silverstripe.org" for "URL"
|
|
|
|
And I check "Open in new window/tab"
|
|
|
|
And I press the "Insert" button
|
2013-10-08 00:23:44 +02:00
|
|
|
Then the "Content" HTML field should contain "<a href="http://silverstripe.org" target="_blank">awesome</a>"
|
2014-01-06 02:38:02 +01:00
|
|
|
# Required to avoid "unsaved changes" browser dialog
|
2013-10-08 00:23:44 +02:00
|
|
|
Then I press the "Save draft" button
|
|
|
|
|
|
|
|
Scenario: I can edit a link
|
2014-08-01 02:03:07 +02:00
|
|
|
Given I fill in the "Content" HTML field with "<p>My <a href='http://silverstripe.org'>awesome</a> content"
|
2017-05-09 04:07:31 +02:00
|
|
|
And I select "awesome" in the "Content" HTML field
|
2016-02-15 02:58:24 +01:00
|
|
|
When I press the "Insert Link" HTML field button
|
2017-05-16 06:47:07 +02:00
|
|
|
And I click "Link to external URL" in the ".mce-menu" element
|
2017-05-09 04:07:31 +02:00
|
|
|
And I should see an "form#Form_EditorToolbarEditorExternalLink" element
|
|
|
|
Then the "URL" field should contain "http://silverstripe.org"
|
2014-01-06 02:38:02 +01:00
|
|
|
# This doesn't seem to suffer from that issue
|
|
|
|
When I fill in "http://google.com" for "URL"
|
2015-10-15 00:08:52 +02:00
|
|
|
And I press the "Insert" button
|
2014-01-06 02:38:02 +01:00
|
|
|
Then the "Content" HTML field should contain "<a href="http://google.com">awesome</a>"
|
|
|
|
# Required to avoid "unsaved changes" browser dialog
|
2013-10-08 00:23:44 +02:00
|
|
|
Then I press the "Save draft" button
|
|
|
|
|
2014-01-06 02:38:02 +01:00
|
|
|
Scenario: I can remove a link
|
2014-08-01 02:03:07 +02:00
|
|
|
Given I fill in the "Content" HTML field with "My <a href='http://silverstripe.org'>awesome</a> content"
|
2014-01-06 02:38:02 +01:00
|
|
|
And I select "awesome" in the "Content" HTML field
|
2016-02-15 02:58:24 +01:00
|
|
|
When I press the "Remove link" HTML field button
|
2014-01-06 02:38:02 +01:00
|
|
|
Then the "Content" HTML field should contain "My awesome content"
|
|
|
|
And the "Content" HTML field should not contain "http://silverstripe.org"
|
|
|
|
# Required to avoid "unsaved changes" browser dialog
|
2014-08-01 02:03:07 +02:00
|
|
|
Then I press the "Save draft" button
|